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

MTK

开发平台:

C/C++

  1.         POC_MAX_URI_LEN * sizeof(U8));
  2.     myMsgPtr->pinfo.is_active = MMI_TRUE;
  3.     myMsgPtr->pinfo.person.activity_present = g_poc_cntx_p->person_pres_disp.activity_present;
  4.     myMsgPtr->pinfo.person.activity = g_poc_cntx_p->person_pres_disp.activity;
  5.     myMsgPtr->pinfo.person.mood_present = g_poc_cntx_p->person_pres_disp.mood_present;
  6.     myMsgPtr->pinfo.person.mood = g_poc_cntx_p->person_pres_disp.mood;
  7.     myMsgPtr->pinfo.num_service = 0;
  8.     Message.oslSrcId = MOD_MMI;
  9.     Message.oslDestId = MOD_POC;
  10.     Message.oslMsgId = MSG_ID_POC_PRESENCE_PUBLISH_REQ;
  11.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  12.     Message.oslPeerBuffPtr = NULL;
  13.     OslMsgSendExtQueue(&Message);
  14.     SetProtocolEventHandler(mmi_poc_presence_publish_rsp, MSG_ID_POC_PRESENCE_PUBLISH_RSP);
  15. }
  16. /*****************************************************************************
  17.  * FUNCTION
  18.  *  mmi_poc_presence_publish_rsp
  19.  * DESCRIPTION
  20.  *  presence publish response handler
  21.  * PARAMETERS
  22.  *  info        [IN]        Local parameters from protocol
  23.  * RETURNS
  24.  *  void
  25.  *****************************************************************************/
  26. void mmi_poc_presence_publish_rsp(void *info)
  27. {
  28.     /*----------------------------------------------------------------*/
  29.     /* Local Variables                                                */
  30.     /*----------------------------------------------------------------*/
  31.     poc_presence_publish_rsp_struct *msgRsp;
  32.     U8 data;
  33.     S16 error;
  34.     /*----------------------------------------------------------------*/
  35.     /* Code Body                                                      */
  36.     /*----------------------------------------------------------------*/
  37.     msgRsp = (poc_presence_publish_rsp_struct*) info;
  38.     ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_PUBLISH_RSP);
  39.     g_poc_cntx_p->progressing.my_status = MMI_FALSE;
  40.     if (msgRsp->result == POC_OK)
  41.     {
  42.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  43.         {
  44.             DisplayPopup(
  45.                 (U8*) GetString(STR_GLOBAL_DONE),
  46.                 IMG_GLOBAL_ACTIVATED,
  47.                 1,
  48.                 UI_POPUP_NOTIFYDURATION_TIME,
  49.                 (U8) SUCCESS_TONE);
  50.         }
  51.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  52.         g_poc_cntx_p->person_pres.activity_present = g_poc_cntx_p->person_pres_disp.activity_present;
  53.         g_poc_cntx_p->person_pres.activity = g_poc_cntx_p->person_pres_disp.activity;
  54.         g_poc_cntx_p->person_pres.mood_present = g_poc_cntx_p->person_pres_disp.mood_present;
  55.         g_poc_cntx_p->person_pres.mood = g_poc_cntx_p->person_pres_disp.mood;
  56.         data = g_poc_cntx_p->person_pres.activity_present;
  57.         WriteValue(NVRAM_POC_ACTIVITY_PRESENT, &data, DS_BYTE, &error);
  58.         data = g_poc_cntx_p->person_pres.activity;
  59.         WriteValue(NVRAM_POC_ACTIVITY, &data, DS_BYTE, &error);
  60.         data = g_poc_cntx_p->person_pres.mood_present;
  61.         WriteValue(NVRAM_POC_MOOD_PRESENT, &data, DS_BYTE, &error);
  62.         data = g_poc_cntx_p->person_pres.mood;
  63.         WriteValue(NVRAM_POC_MOOD, &data, DS_BYTE, &error);
  64.     }
  65.     else
  66.     {
  67.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  68.         {
  69.             DisplayPopup(
  70.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  71.                 IMG_GLOBAL_UNFINISHED,
  72.                 1,
  73.                 UI_POPUP_NOTIFYDURATION_TIME,
  74.                 (U8) ERROR_TONE);
  75.         }
  76.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  77.     }
  78. }
  79. /*****************************************************************************
  80.  * FUNCTION
  81.  *  mmi_poc_entry_settings_my_status_mood
  82.  * DESCRIPTION
  83.  *  mood screen
  84.  * PARAMETERS
  85.  *  void
  86.  * RETURNS
  87.  *  void
  88.  *****************************************************************************/
  89. void mmi_poc_entry_settings_my_status_mood(void)
  90. {
  91.     /*----------------------------------------------------------------*/
  92.     /* Local Variables                                                */
  93.     /*----------------------------------------------------------------*/
  94.     U16 nStrItemList[MAX_SUB_MENUS];
  95.     U16 nNumofItem;
  96.     U8 *guiBuffer;
  97.     U8 i;
  98.     /*----------------------------------------------------------------*/
  99.     /* Code Body                                                      */
  100.     /*----------------------------------------------------------------*/
  101.     EntryNewScreen(SCR_ID_POC_SETTING_MYSTATUS_MOOD, NULL, mmi_poc_entry_settings_my_status_mood, NULL);
  102.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_MYSTATUS_MOOD);
  103.     nNumofItem = POC_MAX_MOOD_NUM;
  104.     SetParentHandler(MENU_ID_POC_SETTINGS_MY_STATUS_MOOD);
  105.     RegisterHighlightHandler(mmi_poc_mood_highlight_handler);
  106.     nStrItemList[0] = STR_GLOBAL_EMPTY;
  107.     for (i = 1; i < nNumofItem; i++)
  108.     {
  109.         nStrItemList[i] = STR_ID_POC_HAPPY + i - 1;
  110.     }
  111.     if (guiBuffer == NULL)
  112.     {
  113.         g_poc_cntx_p->mood_selected = 0;
  114.     }
  115.     ShowCategory52Screen(
  116.         STR_ID_POC_MOOD,
  117.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  118.         STR_GLOBAL_OK,
  119.         IMG_GLOBAL_OK,
  120.         STR_GLOBAL_BACK,
  121.         IMG_GLOBAL_BACK,
  122.         nNumofItem,
  123.         nStrItemList,
  124.         (U16*) gIndexIconsImageList,
  125.         NULL,
  126.         0,
  127.         g_poc_cntx_p->mood_selected,
  128.         guiBuffer);
  129.     SetLeftSoftkeyFunction(mmi_poc_entry_set_mood, KEY_EVENT_UP);
  130.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  131.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  132. }
  133. /*****************************************************************************
  134.  * FUNCTION
  135.  *  mmi_poc_mood_highlight_handler
  136.  * DESCRIPTION
  137.  *  mood screen highlight handler
  138.  * PARAMETERS
  139.  *  index       [IN]        Currently selected index
  140.  * RETURNS
  141.  *  void
  142.  *****************************************************************************/
  143. void mmi_poc_mood_highlight_handler(S32 index)
  144. {
  145.     /*----------------------------------------------------------------*/
  146.     /* Local Variables                                                */
  147.     /*----------------------------------------------------------------*/
  148.     /*----------------------------------------------------------------*/
  149.     /* Code Body                                                      */
  150.     /*----------------------------------------------------------------*/
  151.     g_poc_cntx_p->mood_selected = (U8) index;
  152. }
  153. /*****************************************************************************
  154.  * FUNCTION
  155.  *  mmi_poc_entry_set_mood
  156.  * DESCRIPTION
  157.  *  set mood
  158.  * PARAMETERS
  159.  *  void
  160.  * RETURNS
  161.  *  void
  162.  *****************************************************************************/
  163. void mmi_poc_entry_set_mood(void)
  164. {
  165.     /*----------------------------------------------------------------*/
  166.     /* Local Variables                                                */
  167.     /*----------------------------------------------------------------*/
  168.     /*----------------------------------------------------------------*/
  169.     /* Code Body                                                      */
  170.     /*----------------------------------------------------------------*/
  171.     memcpy(&g_poc_cntx_p->person_pres_disp, &g_poc_cntx_p->person_pres, sizeof(mmi_poc_person_pinfo_struct));
  172.     switch (g_poc_cntx_p->mood_selected)
  173.     {
  174.         case 0:
  175.             g_poc_cntx_p->person_pres_disp.mood_present = MMI_FALSE;
  176.             break;
  177.         case 1:
  178.             g_poc_cntx_p->person_pres_disp.mood_present = MMI_TRUE;
  179.             g_poc_cntx_p->person_pres_disp.mood = POC_MOOD_HAPPY;
  180.             break;
  181.         case 2:
  182.             g_poc_cntx_p->person_pres_disp.mood_present = MMI_TRUE;
  183.             g_poc_cntx_p->person_pres_disp.mood = POC_MOOD_BORED;
  184.             break;
  185.         case 3:
  186.             g_poc_cntx_p->person_pres_disp.mood_present = MMI_TRUE;
  187.             g_poc_cntx_p->person_pres_disp.mood = POC_MOOD_DEPRESSED;
  188.             break;
  189.         default:
  190.             break;
  191.     }
  192.     mmi_poc_entry_progressing();
  193.     DeleteUptoScrID(SCR_ID_POC_SETTING);
  194.     mmi_poc_presence_publish_req();
  195. }
  196. /*****************************************************************************
  197.  * FUNCTION
  198.  *  mmi_poc_switch_ans_mode
  199.  * DESCRIPTION
  200.  *  switch answer mode
  201.  * PARAMETERS
  202.  *  void
  203.  * RETURNS
  204.  *  void
  205.  *****************************************************************************/
  206. void mmi_poc_switch_ans_mode(void)
  207. {
  208.     /*----------------------------------------------------------------*/
  209.     /* Local Variables                                                */
  210.     /*----------------------------------------------------------------*/
  211.     /*----------------------------------------------------------------*/
  212.     /* Code Body                                                      */
  213.     /*----------------------------------------------------------------*/
  214.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  215.     {
  216.         DisplayPopup(
  217.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  218.             IMG_GLOBAL_UNFINISHED,
  219.             1,
  220.             UI_POPUP_NOTIFYDURATION_TIME,
  221.             (U8) ERROR_TONE);
  222.         return;
  223.     }
  224.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  225.     {
  226.         DisplayPopup(
  227.             (U8*) GetString(STR_ID_POC_PROCESSING),
  228.             IMG_GLOBAL_WARNING,
  229.             1,
  230.             UI_POPUP_NOTIFYDURATION_TIME,
  231.             (U8) WARNING_TONE);
  232.         return;
  233.     }
  234.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  235.     {
  236.         MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
  237.         DisplayPopup(
  238.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  239.             IMG_GLOBAL_WARNING,
  240.             1,
  241.             UI_POPUP_NOTIFYDURATION_TIME,
  242.             (U8) WARNING_TONE);
  243.         return;
  244.     }
  245.     mmi_poc_entry_progressing();
  246.     mmi_poc_switch_ans_mode_req();
  247. }
  248. /*****************************************************************************
  249.  * FUNCTION
  250.  *  mmi_poc_switch_ans_mode_req
  251.  * DESCRIPTION
  252.  *  switch answer mode request
  253.  * PARAMETERS
  254.  *  void
  255.  * RETURNS
  256.  *  void
  257.  *****************************************************************************/
  258. void mmi_poc_switch_ans_mode_req(void)
  259. {
  260.     /*----------------------------------------------------------------*/
  261.     /* Local Variables                                                */
  262.     /*----------------------------------------------------------------*/
  263.     MYQUEUE Message;
  264.     poc_setting_req_struct *myMsgPtr;
  265.     /*----------------------------------------------------------------*/
  266.     /* Code Body                                                      */
  267.     /*----------------------------------------------------------------*/
  268.     myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
  269.     memset(
  270.         (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
  271.         0,
  272.         sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
  273.     g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
  274.     if (g_poc_cntx_p->curr_ans_mode == MMI_TRUE)
  275.     {
  276.         myMsgPtr->data.auto_answer = MMI_FALSE;
  277.     }
  278.     else
  279.     {
  280.         myMsgPtr->data.auto_answer = MMI_TRUE;
  281.     }
  282.     myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
  283.     myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
  284.     myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
  285.     myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
  286.     memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
  287.     Message.oslSrcId = MOD_MMI;
  288.     Message.oslDestId = MOD_POC;
  289.     Message.oslMsgId = PRT_POC_SETTING_REQ;
  290.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  291.     Message.oslPeerBuffPtr = NULL;
  292.     OslMsgSendExtQueue(&Message);
  293.     SetProtocolEventHandler(mmi_poc_switch_ans_mode_rsp, PRT_POC_SETTING_RSP);
  294. }
  295. /*****************************************************************************
  296.  * FUNCTION
  297.  *  mmi_poc_switch_ans_mode_rsp
  298.  * DESCRIPTION
  299.  *  switch ans mode response handler
  300.  * PARAMETERS
  301.  *  info        [IN]        Local parameters from protocol
  302.  * RETURNS
  303.  *  void
  304.  *****************************************************************************/
  305. void mmi_poc_switch_ans_mode_rsp(void *info)
  306. {
  307.     /*----------------------------------------------------------------*/
  308.     /* Local Variables                                                */
  309.     /*----------------------------------------------------------------*/
  310.     U8 data;
  311.     S16 error;
  312.     poc_setting_rsp_struct *msgRsp;
  313.     /*----------------------------------------------------------------*/
  314.     /* Code Body                                                      */
  315.     /*----------------------------------------------------------------*/
  316.     msgRsp = (poc_setting_rsp_struct*) info;
  317.     ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
  318.     g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
  319.     if (msgRsp->result == POC_OK)
  320.     {
  321.         if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
  322.         {
  323.             DisplayPopup(
  324.                 (U8*) GetString(STR_GLOBAL_DONE),
  325.                 IMG_GLOBAL_ACTIVATED,
  326.                 1,
  327.                 UI_POPUP_NOTIFYDURATION_TIME,
  328.                 (U8) SUCCESS_TONE);
  329.         }
  330.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  331.         if (g_poc_cntx_p->curr_ans_mode == MMI_TRUE)
  332.         {
  333.             g_poc_cntx_p->curr_ans_mode = MMI_FALSE;
  334.         }
  335.         else
  336.         {
  337.             g_poc_cntx_p->curr_ans_mode = MMI_TRUE;
  338.         }
  339.         data = g_poc_cntx_p->curr_ans_mode;
  340.         WriteValue(NVRAM_POC_ANS_MODE, &data, DS_BYTE, &error);
  341.     }
  342.     else
  343.     {
  344.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  345.         {
  346.             DisplayPopup(
  347.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  348.                 IMG_GLOBAL_UNFINISHED,
  349.                 1,
  350.                 UI_POPUP_NOTIFYDURATION_TIME,
  351.                 (U8) ERROR_TONE);
  352.         }
  353.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  354.     }
  355. }
  356. /*****************************************************************************
  357.  * FUNCTION
  358.  *  mmi_poc_switch_call_barring_mode
  359.  * DESCRIPTION
  360.  *  switch call barring mode
  361.  * PARAMETERS
  362.  *  void
  363.  * RETURNS
  364.  *  void
  365.  *****************************************************************************/
  366. void mmi_poc_switch_call_barring_mode(void)
  367. {
  368.     /*----------------------------------------------------------------*/
  369.     /* Local Variables                                                */
  370.     /*----------------------------------------------------------------*/
  371.     /*----------------------------------------------------------------*/
  372.     /* Code Body                                                      */
  373.     /*----------------------------------------------------------------*/
  374.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  375.     {
  376.         DisplayPopup(
  377.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  378.             IMG_GLOBAL_UNFINISHED,
  379.             1,
  380.             UI_POPUP_NOTIFYDURATION_TIME,
  381.             (U8) ERROR_TONE);
  382.         return;
  383.     }
  384.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  385.     {
  386.         DisplayPopup(
  387.             (U8*) GetString(STR_ID_POC_PROCESSING),
  388.             IMG_GLOBAL_WARNING,
  389.             1,
  390.             UI_POPUP_NOTIFYDURATION_TIME,
  391.             (U8) WARNING_TONE);
  392.         return;
  393.     }
  394.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  395.     {
  396.         MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
  397.         DisplayPopup(
  398.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  399.             IMG_GLOBAL_WARNING,
  400.             1,
  401.             UI_POPUP_NOTIFYDURATION_TIME,
  402.             (U8) WARNING_TONE);
  403.         return;
  404.     }
  405.     mmi_poc_entry_progressing();
  406.     mmi_poc_switch_call_barring_mode_req();
  407. }
  408. /*****************************************************************************
  409.  * FUNCTION
  410.  *  mmi_poc_switch_call_barring_mode_req
  411.  * DESCRIPTION
  412.  *  switch call barring mode request
  413.  * PARAMETERS
  414.  *  void
  415.  * RETURNS
  416.  *  void
  417.  *****************************************************************************/
  418. void mmi_poc_switch_call_barring_mode_req(void)
  419. {
  420.     /*----------------------------------------------------------------*/
  421.     /* Local Variables                                                */
  422.     /*----------------------------------------------------------------*/
  423.     MYQUEUE Message;
  424.     poc_setting_req_struct *myMsgPtr;
  425.     /*----------------------------------------------------------------*/
  426.     /* Code Body                                                      */
  427.     /*----------------------------------------------------------------*/
  428.     myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
  429.     memset(
  430.         (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
  431.         0,
  432.         sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
  433.     g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
  434.     myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
  435.     if (g_poc_cntx_p->curr_call_bar_mode == MMI_TRUE)
  436.     {
  437.         myMsgPtr->data.isb = MMI_FALSE;
  438.     }
  439.     else
  440.     {
  441.         myMsgPtr->data.isb = MMI_TRUE;
  442.     }
  443.     myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
  444.     myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
  445.     myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
  446.     memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
  447.     Message.oslSrcId = MOD_MMI;
  448.     Message.oslDestId = MOD_POC;
  449.     Message.oslMsgId = PRT_POC_SETTING_REQ;
  450.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  451.     Message.oslPeerBuffPtr = NULL;
  452.     OslMsgSendExtQueue(&Message);
  453.     SetProtocolEventHandler(mmi_poc_switch_call_barring_mode_rsp, PRT_POC_SETTING_RSP);
  454. }
  455. /*****************************************************************************
  456.  * FUNCTION
  457.  *  mmi_poc_switch_call_barring_mode_rsp
  458.  * DESCRIPTION
  459.  *  switch call barring mode response handler
  460.  * PARAMETERS
  461.  *  info        [IN]        Local parameters from protocol
  462.  * RETURNS
  463.  *  void
  464.  *****************************************************************************/
  465. void mmi_poc_switch_call_barring_mode_rsp(void *info)
  466. {
  467.     /*----------------------------------------------------------------*/
  468.     /* Local Variables                                                */
  469.     /*----------------------------------------------------------------*/
  470.     U8 data;
  471.     S16 error;
  472.     poc_setting_rsp_struct *msgRsp;
  473.     /*----------------------------------------------------------------*/
  474.     /* Code Body                                                      */
  475.     /*----------------------------------------------------------------*/
  476.     msgRsp = (poc_setting_rsp_struct*) info;
  477.     ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
  478.     g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
  479.     if (msgRsp->result == POC_OK)
  480.     {
  481.         if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
  482.         {
  483.             DisplayPopup(
  484.                 (U8*) GetString(STR_GLOBAL_DONE),
  485.                 IMG_GLOBAL_ACTIVATED,
  486.                 1,
  487.                 UI_POPUP_NOTIFYDURATION_TIME,
  488.                 (U8) SUCCESS_TONE);
  489.         }
  490.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  491.         if (g_poc_cntx_p->curr_call_bar_mode == MMI_TRUE)
  492.         {
  493.             g_poc_cntx_p->curr_call_bar_mode = MMI_FALSE;
  494.         }
  495.         else
  496.         {
  497.             g_poc_cntx_p->curr_call_bar_mode = MMI_TRUE;
  498.         }
  499.         data = g_poc_cntx_p->curr_call_bar_mode;
  500.         WriteValue(NVRAM_POC_CALL_BAR_MODE, &data, DS_BYTE, &error);
  501.     }
  502.     else
  503.     {
  504.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  505.         {
  506.             DisplayPopup(
  507.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  508.                 IMG_GLOBAL_UNFINISHED,
  509.                 1,
  510.                 UI_POPUP_NOTIFYDURATION_TIME,
  511.                 (U8) ERROR_TONE);
  512.         }
  513.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  514.     }
  515. }
  516. /*****************************************************************************
  517.  * FUNCTION
  518.  *  mmi_poc_switch_alert_barring_mode
  519.  * DESCRIPTION
  520.  *  switch alert barring mode
  521.  * PARAMETERS
  522.  *  void
  523.  * RETURNS
  524.  *  void
  525.  *****************************************************************************/
  526. void mmi_poc_switch_alert_barring_mode(void)
  527. {
  528.     /*----------------------------------------------------------------*/
  529.     /* Local Variables                                                */
  530.     /*----------------------------------------------------------------*/
  531.     /*----------------------------------------------------------------*/
  532.     /* Code Body                                                      */
  533.     /*----------------------------------------------------------------*/
  534.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  535.     {
  536.         DisplayPopup(
  537.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  538.             IMG_GLOBAL_UNFINISHED,
  539.             1,
  540.             UI_POPUP_NOTIFYDURATION_TIME,
  541.             (U8) ERROR_TONE);
  542.         return;
  543.     }
  544.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  545.     {
  546.         DisplayPopup(
  547.             (U8*) GetString(STR_ID_POC_PROCESSING),
  548.             IMG_GLOBAL_WARNING,
  549.             1,
  550.             UI_POPUP_NOTIFYDURATION_TIME,
  551.             (U8) WARNING_TONE);
  552.         return;
  553.     }
  554.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  555.     {
  556.         MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
  557.         DisplayPopup(
  558.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  559.             IMG_GLOBAL_WARNING,
  560.             1,
  561.             UI_POPUP_NOTIFYDURATION_TIME,
  562.             (U8) WARNING_TONE);
  563.         return;
  564.     }
  565.     mmi_poc_entry_progressing();
  566.     mmi_poc_switch_alert_barring_mode_req();
  567. }
  568. /*****************************************************************************
  569.  * FUNCTION
  570.  *  mmi_poc_switch_mao_mode
  571.  * DESCRIPTION
  572.  *  switch mao mode
  573.  * PARAMETERS
  574.  *  void
  575.  * RETURNS
  576.  *  void
  577.  *****************************************************************************/
  578. void mmi_poc_switch_mao_mode(void)
  579. {
  580.     /*----------------------------------------------------------------*/
  581.     /* Local Variables                                                */
  582.     /*----------------------------------------------------------------*/
  583.     /*----------------------------------------------------------------*/
  584.     /* Code Body                                                      */
  585.     /*----------------------------------------------------------------*/
  586.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  587.     {
  588.         DisplayPopup(
  589.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  590.             IMG_GLOBAL_UNFINISHED,
  591.             1,
  592.             UI_POPUP_NOTIFYDURATION_TIME,
  593.             (U8) ERROR_TONE);
  594.         return;
  595.     }
  596.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  597.     {
  598.         DisplayPopup(
  599.             (U8*) GetString(STR_ID_POC_PROCESSING),
  600.             IMG_GLOBAL_WARNING,
  601.             1,
  602.             UI_POPUP_NOTIFYDURATION_TIME,
  603.             (U8) WARNING_TONE);
  604.         return;
  605.     }
  606.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  607.     {
  608.         MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
  609.         DisplayPopup(
  610.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  611.             IMG_GLOBAL_WARNING,
  612.             1,
  613.             UI_POPUP_NOTIFYDURATION_TIME,
  614.             (U8) WARNING_TONE);
  615.         return;
  616.     }
  617.     mmi_poc_entry_progressing();
  618.     mmi_poc_switch_mao_mode_req();
  619. }
  620. /*****************************************************************************
  621.  * FUNCTION
  622.  *  mmi_poc_switch_alert_barring_mode_req
  623.  * DESCRIPTION
  624.  *  switch alert barring mode request
  625.  * PARAMETERS
  626.  *  void
  627.  * RETURNS
  628.  *  void
  629.  *****************************************************************************/
  630. void mmi_poc_switch_alert_barring_mode_req(void)
  631. {
  632.     /*----------------------------------------------------------------*/
  633.     /* Local Variables                                                */
  634.     /*----------------------------------------------------------------*/
  635.     MYQUEUE Message;
  636.     poc_setting_req_struct *myMsgPtr;
  637.     /*----------------------------------------------------------------*/
  638.     /* Code Body                                                      */
  639.     /*----------------------------------------------------------------*/
  640.     myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
  641.     memset(
  642.         (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
  643.         0,
  644.         sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
  645.     g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
  646.     myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
  647.     myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
  648.     if (g_poc_cntx_p->curr_alert_bar_mode == MMI_TRUE)
  649.     {
  650.         myMsgPtr->data.ipab = MMI_FALSE;
  651.     }
  652.     else
  653.     {
  654.         myMsgPtr->data.ipab = MMI_TRUE;
  655.     }
  656.     myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
  657.     myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
  658.     memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
  659.     Message.oslSrcId = MOD_MMI;
  660.     Message.oslDestId = MOD_POC;
  661.     Message.oslMsgId = PRT_POC_SETTING_REQ;
  662.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  663.     Message.oslPeerBuffPtr = NULL;
  664.     OslMsgSendExtQueue(&Message);
  665.     SetProtocolEventHandler(mmi_poc_switch_alert_barring_mode_rsp, PRT_POC_SETTING_RSP);
  666. }
  667. /*****************************************************************************
  668.  * FUNCTION
  669.  *  mmi_poc_switch_mao_mode_req
  670.  * DESCRIPTION
  671.  *  switch mao mode request
  672.  * PARAMETERS
  673.  *  void
  674.  * RETURNS
  675.  *  void
  676.  *****************************************************************************/
  677. void mmi_poc_switch_mao_mode_req(void)
  678. {
  679.     /*----------------------------------------------------------------*/
  680.     /* Local Variables                                                */
  681.     /*----------------------------------------------------------------*/
  682.     MYQUEUE Message;
  683.     poc_setting_req_struct *myMsgPtr;
  684.     /*----------------------------------------------------------------*/
  685.     /* Code Body                                                      */
  686.     /*----------------------------------------------------------------*/
  687.     myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
  688.     memset(
  689.         (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
  690.         0,
  691.         sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
  692.     g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
  693.     myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
  694.     myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
  695.     myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
  696.     if (g_poc_cntx_p->curr_mao_mode == MMI_TRUE)
  697.     {
  698.         myMsgPtr->data.enable_mao = MMI_FALSE;
  699.     }
  700.     else
  701.     {
  702.         myMsgPtr->data.enable_mao = MMI_TRUE;
  703.     }
  704.     myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
  705.     memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
  706.     Message.oslSrcId = MOD_MMI;
  707.     Message.oslDestId = MOD_POC;
  708.     Message.oslMsgId = PRT_POC_SETTING_REQ;
  709.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  710.     Message.oslPeerBuffPtr = NULL;
  711.     OslMsgSendExtQueue(&Message);
  712.     SetProtocolEventHandler(mmi_poc_switch_mao_mode_rsp, PRT_POC_SETTING_RSP);
  713. }
  714. /*****************************************************************************
  715.  * FUNCTION
  716.  *  mmi_poc_switch_alert_barring_mode_rsp
  717.  * DESCRIPTION
  718.  *  switch alert barring mode response handler
  719.  * PARAMETERS
  720.  *  info        [IN]        Local parameters from protocol
  721.  * RETURNS
  722.  *  void
  723.  *****************************************************************************/
  724. void mmi_poc_switch_alert_barring_mode_rsp(void *info)
  725. {
  726.     /*----------------------------------------------------------------*/
  727.     /* Local Variables                                                */
  728.     /*----------------------------------------------------------------*/
  729.     U8 data;
  730.     S16 error;
  731.     poc_setting_rsp_struct *msgRsp;
  732.     /*----------------------------------------------------------------*/
  733.     /* Code Body                                                      */
  734.     /*----------------------------------------------------------------*/
  735.     msgRsp = (poc_setting_rsp_struct*) info;
  736.     ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
  737.     g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
  738.     if (msgRsp->result == POC_OK)
  739.     {
  740.         if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
  741.         {
  742.             DisplayPopup(
  743.                 (U8*) GetString(STR_GLOBAL_DONE),
  744.                 IMG_GLOBAL_ACTIVATED,
  745.                 1,
  746.                 UI_POPUP_NOTIFYDURATION_TIME,
  747.                 (U8) SUCCESS_TONE);
  748.         }
  749.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  750.         if (g_poc_cntx_p->curr_alert_bar_mode == MMI_TRUE)
  751.         {
  752.             g_poc_cntx_p->curr_alert_bar_mode = MMI_FALSE;
  753.         }
  754.         else
  755.         {
  756.             g_poc_cntx_p->curr_alert_bar_mode = MMI_TRUE;
  757.         }
  758.         data = g_poc_cntx_p->curr_alert_bar_mode;
  759.         WriteValue(NVRAM_POC_ALERT_BAR_MODE, &data, DS_BYTE, &error);
  760.     }
  761.     else
  762.     {
  763.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  764.         {
  765.             DisplayPopup(
  766.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  767.                 IMG_GLOBAL_UNFINISHED,
  768.                 1,
  769.                 UI_POPUP_NOTIFYDURATION_TIME,
  770.                 (U8) ERROR_TONE);
  771.         }
  772.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  773.     }
  774. }
  775. /*****************************************************************************
  776.  * FUNCTION
  777.  *  mmi_poc_switch_mao_mode_rsp
  778.  * DESCRIPTION
  779.  *  switch mao mode response handler
  780.  * PARAMETERS
  781.  *  info        [IN]        Local parameters from protocol
  782.  * RETURNS
  783.  *  void
  784.  *****************************************************************************/
  785. void mmi_poc_switch_mao_mode_rsp(void *info)
  786. {
  787.     /*----------------------------------------------------------------*/
  788.     /* Local Variables                                                */
  789.     /*----------------------------------------------------------------*/
  790.     U8 data;
  791.     S16 error;
  792.     poc_setting_rsp_struct *msgRsp;
  793.     /*----------------------------------------------------------------*/
  794.     /* Code Body                                                      */
  795.     /*----------------------------------------------------------------*/
  796.     msgRsp = (poc_setting_rsp_struct*) info;
  797.     ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
  798.     g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
  799.     if (msgRsp->result == POC_OK)
  800.     {
  801.         if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
  802.         {
  803.             DisplayPopup(
  804.                 (U8*) GetString(STR_GLOBAL_DONE),
  805.                 IMG_GLOBAL_ACTIVATED,
  806.                 1,
  807.                 UI_POPUP_NOTIFYDURATION_TIME,
  808.                 (U8) SUCCESS_TONE);
  809.         }
  810.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  811.         if (g_poc_cntx_p->curr_mao_mode == MMI_TRUE)
  812.         {
  813.             g_poc_cntx_p->curr_mao_mode = MMI_FALSE;
  814.         }
  815.         else
  816.         {
  817.             g_poc_cntx_p->curr_mao_mode = MMI_TRUE;
  818.         }
  819.         data = g_poc_cntx_p->curr_mao_mode;
  820.         WriteValue(NVRAM_POC_MAO_MODE, &data, DS_BYTE, &error);
  821.     }
  822.     else
  823.     {
  824.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  825.         {
  826.             DisplayPopup(
  827.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  828.                 IMG_GLOBAL_UNFINISHED,
  829.                 1,
  830.                 UI_POPUP_NOTIFYDURATION_TIME,
  831.                 (U8) ERROR_TONE);
  832.         }
  833.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  834.     }
  835. }
  836. /*****************************************************************************
  837.  * FUNCTION
  838.  *  mmi_poc_entry_settings_privacy
  839.  * DESCRIPTION
  840.  *  privacy screen
  841.  * PARAMETERS
  842.  *  void
  843.  * RETURNS
  844.  *  void
  845.  *****************************************************************************/
  846. void mmi_poc_entry_settings_privacy(void)
  847. {
  848.     /*----------------------------------------------------------------*/
  849.     /* Local Variables                                                */
  850.     /*----------------------------------------------------------------*/
  851.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  852.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  853.     U8 *guiBuffer;                      /* Buffer holding history data */
  854.     U16 menuId;
  855.     /*----------------------------------------------------------------*/
  856.     /* Code Body                                                      */
  857.     /*----------------------------------------------------------------*/
  858.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  859.     {
  860.         DisplayPopup(
  861.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  862.             IMG_GLOBAL_UNFINISHED,
  863.             1,
  864.             UI_POPUP_NOTIFYDURATION_TIME,
  865.             (U8) ERROR_TONE);
  866.         return;
  867.     }
  868.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  869.     {
  870.         DisplayPopup(
  871.             (U8*) GetString(STR_ID_POC_PROCESSING),
  872.             IMG_GLOBAL_WARNING,
  873.             1,
  874.             UI_POPUP_NOTIFYDURATION_TIME,
  875.             (U8) WARNING_TONE);
  876.         return;
  877.     }
  878.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  879.     {
  880.         DisplayPopup(
  881.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  882.             IMG_GLOBAL_WARNING,
  883.             1,
  884.             UI_POPUP_NOTIFYDURATION_TIME,
  885.             (U8) WARNING_TONE);
  886.         return;
  887.     }
  888.     EntryNewScreen(SCR_ID_POC_SETTING_PRIVACY, NULL, mmi_poc_entry_settings_privacy, NULL);
  889.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PRIVACY);
  890.     menuId = MENU_ID_POC_SETTINGS_PRIVACY;
  891.     nNumofItem = GetNumOfChild(menuId);
  892.     GetSequenceStringIds(menuId, nStrItemList);
  893.     SetParentHandler(menuId);
  894.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  895.     ShowCategory15Screen(
  896.         STR_ID_POC_PRIVACY,
  897.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  898.         STR_GLOBAL_OK,
  899.         IMG_GLOBAL_OK,
  900.         STR_GLOBAL_BACK,
  901.         IMG_GLOBAL_BACK,
  902.         nNumofItem,
  903.         nStrItemList,
  904.         (U16*) gIndexIconsImageList,
  905.         1,
  906.         0,
  907.         guiBuffer);
  908.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  909.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  910. }
  911. /*****************************************************************************
  912.  * FUNCTION
  913.  *  mmi_poc_set_privacy_disable
  914.  * DESCRIPTION
  915.  *  set privacy disable
  916.  * PARAMETERS
  917.  *  void
  918.  * RETURNS
  919.  *  void
  920.  *****************************************************************************/
  921. void mmi_poc_set_privacy_disable(void)
  922. {
  923.     /*----------------------------------------------------------------*/
  924.     /* Local Variables                                                */
  925.     /*----------------------------------------------------------------*/
  926.     /*----------------------------------------------------------------*/
  927.     /* Code Body                                                      */
  928.     /*----------------------------------------------------------------*/
  929.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  930.     {
  931.         DisplayPopup(
  932.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  933.             IMG_GLOBAL_UNFINISHED,
  934.             1,
  935.             UI_POPUP_NOTIFYDURATION_TIME,
  936.             (U8) ERROR_TONE);
  937.         DeleteUptoScrID(STR_ID_POC_SETTINGS);
  938.         return;
  939.     }
  940.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  941.     {
  942.         DisplayPopup(
  943.             (U8*) GetString(STR_ID_POC_PROCESSING),
  944.             IMG_GLOBAL_WARNING,
  945.             1,
  946.             UI_POPUP_NOTIFYDURATION_TIME,
  947.             (U8) WARNING_TONE);
  948.         DeleteUptoScrID(STR_ID_POC_SETTINGS);
  949.         return;
  950.     }
  951.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  952.     {
  953.         DisplayPopup(
  954.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  955.             IMG_GLOBAL_WARNING,
  956.             1,
  957.             UI_POPUP_NOTIFYDURATION_TIME,
  958.             (U8) WARNING_TONE);
  959.         DeleteUptoScrID(STR_ID_POC_SETTINGS);
  960.         return;
  961.     }
  962.     mmi_poc_entry_progressing();
  963.     DeleteScreenIfPresent(SCR_ID_POC_SETTING_PRIVACY);
  964.     mmi_poc_set_privacy_disable_req();
  965. }
  966. /*****************************************************************************
  967.  * FUNCTION
  968.  *  mmi_poc_set_privacy_disable_req
  969.  * DESCRIPTION
  970.  *  set privacy disable request
  971.  * PARAMETERS
  972.  *  void
  973.  * RETURNS
  974.  *  void
  975.  *****************************************************************************/
  976. void mmi_poc_set_privacy_disable_req(void)
  977. {
  978.     /*----------------------------------------------------------------*/
  979.     /* Local Variables                                                */
  980.     /*----------------------------------------------------------------*/
  981.     MYQUEUE Message;
  982.     poc_setting_req_struct *myMsgPtr;
  983.     /*----------------------------------------------------------------*/
  984.     /* Code Body                                                      */
  985.     /*----------------------------------------------------------------*/
  986.     myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
  987.     memset(
  988.         (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
  989.         0,
  990.         sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
  991.     g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
  992.     myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
  993.     myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
  994.     myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
  995.     myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
  996.     myMsgPtr->data.enable_privacy = MMI_FALSE;
  997.     memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
  998.     Message.oslSrcId = MOD_MMI;
  999.     Message.oslDestId = MOD_POC;
  1000.     Message.oslMsgId = PRT_POC_SETTING_REQ;
  1001.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  1002.     Message.oslPeerBuffPtr = NULL;
  1003.     OslMsgSendExtQueue(&Message);
  1004.     SetProtocolEventHandler(mmi_poc_set_privacy_disable_rsp, PRT_POC_SETTING_RSP);
  1005. }
  1006. /*****************************************************************************
  1007.  * FUNCTION
  1008.  *  mmi_poc_set_privacy_disable_rsp
  1009.  * DESCRIPTION
  1010.  *  set privacy disable response handler
  1011.  * PARAMETERS
  1012.  *  info        [IN]        Local parameters from protocol
  1013.  * RETURNS
  1014.  *  void
  1015.  *****************************************************************************/
  1016. void mmi_poc_set_privacy_disable_rsp(void *info)
  1017. {
  1018.     /*----------------------------------------------------------------*/
  1019.     /* Local Variables                                                */
  1020.     /*----------------------------------------------------------------*/
  1021.     U8 data;
  1022.     S16 error;
  1023.     poc_setting_rsp_struct *msgRsp;
  1024.     /*----------------------------------------------------------------*/
  1025.     /* Code Body                                                      */
  1026.     /*----------------------------------------------------------------*/
  1027.     msgRsp = (poc_setting_rsp_struct*) info;
  1028.     ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
  1029.     g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
  1030.     if (msgRsp->result == POC_OK)
  1031.     {
  1032.         if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
  1033.         {
  1034.             DisplayPopup(
  1035.                 (U8*) GetString(STR_GLOBAL_DONE),
  1036.                 IMG_GLOBAL_ACTIVATED,
  1037.                 1,
  1038.                 UI_POPUP_NOTIFYDURATION_TIME,
  1039.                 (U8) SUCCESS_TONE);
  1040.         }
  1041.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  1042.         g_poc_cntx_p->curr_privacy_mode = MMI_FALSE;
  1043.         data = g_poc_cntx_p->curr_privacy_mode;
  1044.         WriteValue(NVRAM_POC_PRIVACY_MODE, &data, DS_BYTE, &error);
  1045.     }
  1046.     else
  1047.     {
  1048.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  1049.         {
  1050.             DisplayPopup(
  1051.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  1052.                 IMG_GLOBAL_UNFINISHED,
  1053.                 1,
  1054.                 UI_POPUP_NOTIFYDURATION_TIME,
  1055.                 (U8) ERROR_TONE);
  1056.         }
  1057.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  1058.     }
  1059. }
  1060. /*****************************************************************************
  1061.  * FUNCTION
  1062.  *  mmi_poc_entry_settings_privacy_enable
  1063.  * DESCRIPTION
  1064.  *  privacy enable screen
  1065.  * PARAMETERS
  1066.  *  void
  1067.  * RETURNS
  1068.  *  void
  1069.  *****************************************************************************/
  1070. void mmi_poc_entry_settings_privacy_enable(void)
  1071. {
  1072.     /*----------------------------------------------------------------*/
  1073.     /* Local Variables                                                */
  1074.     /*----------------------------------------------------------------*/
  1075.     U8 *guiBuffer;  /* Buffer holding history data */
  1076.     /*----------------------------------------------------------------*/
  1077.     /* Code Body                                                      */
  1078.     /*----------------------------------------------------------------*/
  1079.     if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
  1080.     {
  1081.         DisplayPopup(
  1082.             (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
  1083.             IMG_GLOBAL_UNFINISHED,
  1084.             1,
  1085.             UI_POPUP_NOTIFYDURATION_TIME,
  1086.             (U8) ERROR_TONE);
  1087.         DeleteUptoScrID(STR_ID_POC_SETTINGS);
  1088.         return;
  1089.     }
  1090.     if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
  1091.     {
  1092.         DisplayPopup(
  1093.             (U8*) GetString(STR_ID_POC_PROCESSING),
  1094.             IMG_GLOBAL_WARNING,
  1095.             1,
  1096.             UI_POPUP_NOTIFYDURATION_TIME,
  1097.             (U8) WARNING_TONE);
  1098.         DeleteUptoScrID(STR_ID_POC_SETTINGS);
  1099.         return;
  1100.     }
  1101.     if (g_poc_cntx_p->call_status != POC_CALL_NONE)
  1102.     {
  1103.         DisplayPopup(
  1104.             (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
  1105.             IMG_GLOBAL_WARNING,
  1106.             1,
  1107.             UI_POPUP_NOTIFYDURATION_TIME,
  1108.             (U8) WARNING_TONE);
  1109.         DeleteUptoScrID(STR_ID_POC_SETTINGS);
  1110.         return;
  1111.     }
  1112.     EntryNewScreen(SCR_ID_POC_SETTING_PRIVACY_ADDR, NULL, mmi_poc_entry_settings_privacy_enable, NULL);
  1113.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PRIVACY_ADDR);
  1114.     if (guiBuffer == NULL)
  1115.     {
  1116.         memset(g_poc_cntx_p->privacy_addr_disp, 0, sizeof(g_poc_cntx_p->privacy_addr_disp));
  1117.         if (strlen((S8*) g_poc_cntx_p->privacy_addr.uri) == 0)
  1118.         {
  1119.             AnsiiNToUnicodeString(
  1120.                 (S8*) g_poc_cntx_p->privacy_addr_disp,
  1121.                 (S8*) POC_MMI_DEFAULT_PRIVACY_ADDR,
  1122.                 POC_MAX_URI_LEN - 1);
  1123.         }
  1124.         else
  1125.         {
  1126.             AnsiiNToUnicodeString(
  1127.                 (S8*) g_poc_cntx_p->privacy_addr_disp,
  1128.                 (S8*) g_poc_cntx_p->privacy_addr.uri,
  1129.                 POC_MAX_URI_LEN - 1);
  1130.         }
  1131.     }
  1132.     RegisterInputBoxValidationFunction(mmi_poc_privacy_addr_msg_key);
  1133.     ShowCategory5Screen(
  1134.         STR_ID_POC_PRIVACY_ADDR,
  1135.         0,
  1136.         STR_GLOBAL_OK,
  1137.         IMG_GLOBAL_OK,
  1138.         STR_GLOBAL_BACK,
  1139.         IMG_GLOBAL_BACK,
  1140.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  1141.         (U8*) g_poc_cntx_p->privacy_addr_disp,
  1142.         POC_MAX_URI_LEN,
  1143.         guiBuffer);
  1144.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1145.     SetLeftSoftkeyFunction(mmi_poc_set_privacy_enable_req, KEY_EVENT_UP);
  1146.     SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
  1147.     SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
  1148.     SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
  1149.     SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
  1150.     if (pfnUnicodeStrlen((S8*) g_poc_cntx_p->privacy_addr_disp) == 0)
  1151.     {
  1152.         ChangeLeftSoftkey(0, 0);
  1153.     }
  1154. }
  1155. /*****************************************************************************
  1156.  * FUNCTION
  1157.  *  mmi_poc_privacy_addr_msg_key
  1158.  * DESCRIPTION
  1159.  *  privacy address message key
  1160.  * PARAMETERS
  1161.  *  text        [?]         
  1162.  *  cursor      [?]         
  1163.  *  length      [IN]        
  1164.  *  Framework parameters, don't care.(?)
  1165.  * RETURNS
  1166.  *  void
  1167.  *****************************************************************************/
  1168. void mmi_poc_privacy_addr_msg_key(U8 *text, U8 *cursor, S32 length)
  1169. {
  1170.     /*----------------------------------------------------------------*/
  1171.     /* Local Variables                                                */
  1172.     /*----------------------------------------------------------------*/
  1173.     /*----------------------------------------------------------------*/
  1174.     /* Code Body                                                      */
  1175.     /*----------------------------------------------------------------*/
  1176.     /* check the validity of the input password */
  1177.     if ((length) < 1)
  1178.     {
  1179.         /* if length is short then disable lsk */
  1180.         ChangeLeftSoftkey(0, 0);
  1181.     }
  1182.     else
  1183.     {
  1184.         /* if its valid length then enable lsk */
  1185.         EnableLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1186.     }
  1187. }
  1188. /*****************************************************************************
  1189.  * FUNCTION
  1190.  *  mmi_poc_set_privacy_enable_req
  1191.  * DESCRIPTION
  1192.  *  set privacy enable request
  1193.  * PARAMETERS
  1194.  *  void
  1195.  * RETURNS
  1196.  *  void
  1197.  *****************************************************************************/
  1198. void mmi_poc_set_privacy_enable_req(void)
  1199. {
  1200.     /*----------------------------------------------------------------*/
  1201.     /* Local Variables                                                */
  1202.     /*----------------------------------------------------------------*/
  1203.     MYQUEUE Message;
  1204.     poc_setting_req_struct *myMsgPtr;
  1205.     /*----------------------------------------------------------------*/
  1206.     /* Code Body                                                      */
  1207.     /*----------------------------------------------------------------*/
  1208.     myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
  1209.     memset(
  1210.         (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
  1211.         0,
  1212.         sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
  1213.     mmi_poc_entry_progressing();
  1214.     DeleteScreenIfPresent(SCR_ID_POC_SETTING_PRIVACY);
  1215.     DeleteScreenIfPresent(SCR_ID_POC_SETTING_PRIVACY_ADDR);
  1216.     g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
  1217.     myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
  1218.     myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
  1219.     myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
  1220.     myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
  1221.     myMsgPtr->data.enable_privacy = MMI_TRUE;
  1222.     memset(&myMsgPtr->data.privacy_addr, 0, sizeof(myMsgPtr->data.privacy_addr));
  1223.     UnicodeNToAnsii(
  1224.         (S8*) myMsgPtr->data.privacy_addr.uri,
  1225.         (S8*) g_poc_cntx_p->privacy_addr_disp,
  1226.         POC_MAX_URI_LEN - 1);
  1227.     Message.oslSrcId = MOD_MMI;
  1228.     Message.oslDestId = MOD_POC;
  1229.     Message.oslMsgId = PRT_POC_SETTING_REQ;
  1230.     Message.oslDataPtr = (oslParaType*) myMsgPtr;
  1231.     Message.oslPeerBuffPtr = NULL;
  1232.     OslMsgSendExtQueue(&Message);
  1233.     SetProtocolEventHandler(mmi_poc_set_privacy_enable_rsp, PRT_POC_SETTING_RSP);
  1234. }
  1235. /*****************************************************************************
  1236.  * FUNCTION
  1237.  *  mmi_poc_set_privacy_enable_rsp
  1238.  * DESCRIPTION
  1239.  *  set privacy enable response handler
  1240.  * PARAMETERS
  1241.  *  info        [IN]        Local parameters from protocol
  1242.  * RETURNS
  1243.  *  void
  1244.  *****************************************************************************/
  1245. void mmi_poc_set_privacy_enable_rsp(void *info)
  1246. {
  1247.     /*----------------------------------------------------------------*/
  1248.     /* Local Variables                                                */
  1249.     /*----------------------------------------------------------------*/
  1250.     U8 data;
  1251.     S16 error;
  1252.     poc_setting_rsp_struct *msgRsp;
  1253.     poc_addr_struct temp_privacy;
  1254.     /*----------------------------------------------------------------*/
  1255.     /* Code Body                                                      */
  1256.     /*----------------------------------------------------------------*/
  1257.     msgRsp = (poc_setting_rsp_struct*) info;
  1258.     ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
  1259.     g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
  1260.     if (msgRsp->result == POC_OK)
  1261.     {
  1262.         if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
  1263.         {
  1264.             DisplayPopup(
  1265.                 (U8*) GetString(STR_GLOBAL_DONE),
  1266.                 IMG_GLOBAL_ACTIVATED,
  1267.                 1,
  1268.                 UI_POPUP_NOTIFYDURATION_TIME,
  1269.                 (U8) SUCCESS_TONE);
  1270.         }
  1271.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  1272.         memset(g_poc_cntx_p->privacy_addr.uri, 0, sizeof(g_poc_cntx_p->privacy_addr.uri));
  1273.         UnicodeNToAnsii(
  1274.             (S8*) g_poc_cntx_p->privacy_addr.uri,
  1275.             (S8*) g_poc_cntx_p->privacy_addr_disp,
  1276.             POC_MAX_URI_LEN - 1);
  1277.         g_poc_cntx_p->curr_privacy_mode = MMI_TRUE;
  1278.         data = g_poc_cntx_p->curr_privacy_mode;
  1279.         WriteValue(NVRAM_POC_PRIVACY_MODE, &data, DS_BYTE, &error);
  1280.         memset(&temp_privacy, 0, sizeof(poc_addr_struct));
  1281.         memcpy(temp_privacy.uri, g_poc_cntx_p->privacy_addr.uri, sizeof(temp_privacy.uri));
  1282.         WriteRecord(NVRAM_EF_POC_PRIVACY_LID, 1, &temp_privacy, NVRAM_MAX_POC_PRIVACY_SIZE, &error);
  1283.     }
  1284.     else
  1285.     {
  1286.         if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
  1287.         {
  1288.             DisplayPopup(
  1289.                 (U8*) GetString(STR_GLOBAL_NOT_DONE),
  1290.                 IMG_GLOBAL_UNFINISHED,
  1291.                 1,
  1292.                 UI_POPUP_NOTIFYDURATION_TIME,
  1293.                 (U8) ERROR_TONE);
  1294.         }
  1295.         DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
  1296.     }
  1297. }
  1298. /*****************************************************************************
  1299.  * FUNCTION
  1300.  *  mmi_poc_set_start_at_bootup
  1301.  * DESCRIPTION
  1302.  *  set start at bootup
  1303.  * PARAMETERS
  1304.  *  void
  1305.  * RETURNS
  1306.  *  void
  1307.  *****************************************************************************/
  1308. void mmi_poc_set_start_at_bootup(void)
  1309. {
  1310.     /*----------------------------------------------------------------*/
  1311.     /* Local Variables                                                */
  1312.     /*----------------------------------------------------------------*/
  1313.     U8 data = 0;
  1314.     S16 error;
  1315.     /*----------------------------------------------------------------*/
  1316.     /* Code Body                                                      */
  1317.     /*----------------------------------------------------------------*/
  1318.     if (g_poc_cntx_p->curr_boot_start_mode == MMI_TRUE)
  1319.     {
  1320.         g_poc_cntx_p->curr_boot_start_mode = MMI_FALSE;
  1321.     }
  1322.     else
  1323.     {
  1324.         g_poc_cntx_p->curr_boot_start_mode = MMI_TRUE;
  1325.     }
  1326.     data = g_poc_cntx_p->curr_boot_start_mode;
  1327.     WriteValue(NVRAM_POC_START_BOOTUP, &data, DS_BYTE, &error);
  1328.     DisplayPopup(
  1329.         (U8*) GetString(STR_GLOBAL_DONE),
  1330.         IMG_GLOBAL_ACTIVATED,
  1331.         1,
  1332.         UI_POPUP_NOTIFYDURATION_TIME,
  1333.         (U8) SUCCESS_TONE);
  1334. }
  1335. /*****************************************************************************
  1336.  * FUNCTION
  1337.  *  mmi_poc_set_xdm_mode
  1338.  * DESCRIPTION
  1339.  *  set xdm mode
  1340.  * PARAMETERS
  1341.  *  void
  1342.  * RETURNS
  1343.  *  void
  1344.  *****************************************************************************/
  1345. void mmi_poc_set_xdm_mode(void)
  1346. {
  1347.     /*----------------------------------------------------------------*/
  1348.     /* Local Variables                                                */
  1349.     /*----------------------------------------------------------------*/
  1350.     U8 data = 0;
  1351.     S16 error;
  1352.     /*----------------------------------------------------------------*/
  1353.     /* Code Body                                                      */
  1354.     /*----------------------------------------------------------------*/
  1355.     if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
  1356.     {
  1357.         DisplayPopup(
  1358.             (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
  1359.             IMG_GLOBAL_UNFINISHED,
  1360.             1,
  1361.             CS_NOTIFYDURATION,
  1362.             ERROR_TONE);
  1363.         return;
  1364.     }
  1365.     if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
  1366.     {
  1367.         g_poc_cntx_p->curr_use_xdm_mode = MMI_FALSE;
  1368.     }
  1369.     else
  1370.     {
  1371.         g_poc_cntx_p->curr_use_xdm_mode = MMI_TRUE;
  1372.     }
  1373.     data = g_poc_cntx_p->curr_use_xdm_mode;
  1374.     WriteValue(NVRAM_POC_USE_XDM, &data, DS_BYTE, &error);
  1375.     DisplayPopup(
  1376.         (U8*) GetString(STR_GLOBAL_DONE),
  1377.         IMG_GLOBAL_ACTIVATED,
  1378.         1,
  1379.         UI_POPUP_NOTIFYDURATION_TIME,
  1380.         (U8) SUCCESS_TONE);
  1381. }
  1382. /*****************************************************************************
  1383.  * FUNCTION
  1384.  *  mmi_poc_set_pres_mode
  1385.  * DESCRIPTION
  1386.  *  set presence mode
  1387.  * PARAMETERS
  1388.  *  void
  1389.  * RETURNS
  1390.  *  void
  1391.  *****************************************************************************/
  1392. void mmi_poc_set_pres_mode(void)
  1393. {
  1394.     /*----------------------------------------------------------------*/
  1395.     /* Local Variables                                                */
  1396.     /*----------------------------------------------------------------*/
  1397.     U8 data = 0;
  1398.     S16 error;
  1399.     /*----------------------------------------------------------------*/
  1400.     /* Code Body                                                      */
  1401.     /*----------------------------------------------------------------*/
  1402.     if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
  1403.     {
  1404.         DisplayPopup(
  1405.             (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
  1406.             IMG_GLOBAL_UNFINISHED,
  1407.             1,
  1408.             CS_NOTIFYDURATION,
  1409.             ERROR_TONE);
  1410.         return;
  1411.     }
  1412.     if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
  1413.     {
  1414.         g_poc_cntx_p->curr_use_pres_mode = MMI_FALSE;
  1415.     }
  1416.     else
  1417.     {
  1418.         g_poc_cntx_p->curr_use_pres_mode = MMI_TRUE;
  1419.     }
  1420.     data = g_poc_cntx_p->curr_use_pres_mode;
  1421.     WriteValue(NVRAM_POC_USE_PRES, &data, DS_BYTE, &error);
  1422.     DisplayPopup(
  1423.         (U8*) GetString(STR_GLOBAL_DONE),
  1424.         IMG_GLOBAL_ACTIVATED,
  1425.         1,
  1426.         UI_POPUP_NOTIFYDURATION_TIME,
  1427.         (U8) SUCCESS_TONE);
  1428. }
  1429. #ifdef __MMI_POC_ADHOC_STR_INPUT__
  1430. /*****************************************************************************
  1431.  * FUNCTION
  1432.  *  mmi_poc_entry_settings_adhoc_str
  1433.  * DESCRIPTION
  1434.  *  adhoc string screen
  1435.  * PARAMETERS
  1436.  *  void
  1437.  * RETURNS
  1438.  *  void
  1439.  *****************************************************************************/
  1440. void mmi_poc_entry_settings_adhoc_str(void)
  1441. {
  1442.     /*----------------------------------------------------------------*/
  1443.     /* Local Variables                                                */
  1444.     /*----------------------------------------------------------------*/
  1445.     U8 *guiBuffer;  /* Buffer holding history data */
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Code Body                                                      */
  1448.     /*----------------------------------------------------------------*/
  1449.     EntryNewScreen(SCR_ID_POC_SETTING_ADHOC_STR, NULL, mmi_poc_entry_settings_adhoc_str, NULL);
  1450.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_ADHOC_STR);
  1451.     if (guiBuffer == NULL)
  1452.     {
  1453.         AnsiiNToUnicodeString(
  1454.             (S8*) g_poc_adhoc_str_disp,
  1455.             (S8*) poc_custom_get_conference_factory_uri(),
  1456.             POC_AD_HOC_STR_MAX_LEN - 1);
  1457.     }
  1458.     RegisterInputBoxValidationFunction(mmi_poc_privacy_addr_msg_key);
  1459.     ShowCategory5Screen(
  1460.         STR_ID_POC_ADHOC_STR,
  1461.         0,
  1462.         STR_GLOBAL_OK,
  1463.         IMG_GLOBAL_OK,
  1464.         STR_GLOBAL_BACK,
  1465.         IMG_GLOBAL_BACK,
  1466.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
  1467.         (U8*) g_poc_adhoc_str_disp,
  1468.         POC_AD_HOC_STR_MAX_LEN - 1,
  1469.         guiBuffer);
  1470.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1471.     SetLeftSoftkeyFunction(mmi_poc_set_adhoc_str, KEY_EVENT_UP);
  1472.     SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
  1473.     SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
  1474.     SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
  1475.     SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
  1476.     if (pfnUnicodeStrlen((S8*) g_poc_adhoc_str_disp) == 0)
  1477.     {
  1478.         ChangeLeftSoftkey(0, 0);
  1479.     }
  1480. }
  1481. /*****************************************************************************
  1482.  * FUNCTION
  1483.  *  mmi_poc_set_adhoc_str
  1484.  * DESCRIPTION
  1485.  *  set adhoc string
  1486.  * PARAMETERS
  1487.  *  void
  1488.  * RETURNS
  1489.  *  void
  1490.  *****************************************************************************/
  1491. void mmi_poc_set_adhoc_str(void)
  1492. {
  1493.     /*----------------------------------------------------------------*/
  1494.     /* Local Variables                                                */
  1495.     /*----------------------------------------------------------------*/
  1496.     U8 temp_buf[POC_AD_HOC_STR_MAX_LEN];
  1497.     /*----------------------------------------------------------------*/
  1498.     /* Code Body                                                      */
  1499.     /*----------------------------------------------------------------*/
  1500.     DisplayPopup(
  1501.         (U8*) GetString(STR_GLOBAL_DONE),
  1502.         IMG_GLOBAL_ACTIVATED,
  1503.         1,
  1504.         UI_POPUP_NOTIFYDURATION_TIME,
  1505.         (U8) SUCCESS_TONE);
  1506.     DeleteScreenIfPresent(SCR_ID_POC_SETTING_ADHOC_STR);
  1507.     memset(temp_buf, 0, sizeof(temp_buf));
  1508.     UnicodeToAnsii((S8*) temp_buf, (S8*) g_poc_adhoc_str_disp);
  1509.     poc_custom_set_conference_factory_uri((kal_char*) temp_buf);
  1510. }
  1511. #endif /* __MMI_POC_ADHOC_STR_INPUT__ */ 
  1512. /*****************************************************************************
  1513.  * FUNCTION
  1514.  *  mmi_poc_entry_settings_profiles
  1515.  * DESCRIPTION
  1516.  *  setting profiles screen
  1517.  * PARAMETERS
  1518.  *  void
  1519.  * RETURNS
  1520.  *  void
  1521.  *****************************************************************************/
  1522. void mmi_poc_entry_settings_profiles(void)
  1523. {
  1524.     /*----------------------------------------------------------------*/
  1525.     /* Local Variables                                                */
  1526.     /*----------------------------------------------------------------*/
  1527.     U8 *guiBuffer;
  1528.     U8 i;
  1529.     U16 icon_list[POC_MAX_PROFILE_NUM];
  1530.     U8 *nStrItemList[POC_MAX_PROFILE_NUM];
  1531.     mmi_poc_profile_struct temp_profile;
  1532.     S16 error;
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Code Body                                                      */
  1535.     /*----------------------------------------------------------------*/
  1536.     EntryNewScreen(SCR_ID_POC_SETTING_PROF, NULL, mmi_poc_entry_settings_profiles, NULL);
  1537.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF);
  1538.     RegisterHighlightHandler(mmi_poc_profile_highlight_handler);
  1539.     memset(icon_list, 0, sizeof(icon_list));
  1540.     icon_list[g_poc_cntx_p->profile_active] = IMG_ID_POC_PROFILE_SELECTED;
  1541.     for (i = 0; i < POC_MAX_PROFILE_NUM; i++)
  1542.     {
  1543.         ReadRecord(NVRAM_EF_POC_PROFILE_LID, (U8) (i + 1), &temp_profile, NVRAM_MAX_POC_PROFILE_SIZE, &error);
  1544.         if (temp_profile.prof_name[0] == 0xFF)
  1545.         {
  1546.             memset(&g_poc_cntx_p->profile_list[i], 0, sizeof(g_poc_cntx_p->profile_list[i]));
  1547.             g_poc_cntx_p->profile_list[i].data_account = mmi_dtcnt_get_first_account_id(DATA_ACCOUNT_BEARER_GPRS | DATA_ACCOUNT_BEARER_WIFI);
  1548.             pfnUnicodeStrcpy(
  1549.                 (PS8) g_poc_cntx_p->profile_list[i].prof_name,
  1550.                 (PS8) GetString((U16) (STR_ID_POC_PROFILE_1 + i)));
  1551.         }
  1552.     }
  1553.     for (i = 0; i < POC_MAX_PROFILE_NUM; i++)
  1554.     {
  1555.         if (UCS2Strlen((S8*) g_poc_cntx_p->profile_list[i].prof_name) > 0)
  1556.         {
  1557.             nStrItemList[i] = g_poc_cntx_p->profile_list[i].prof_name;
  1558.         }
  1559.         else
  1560.         {
  1561.             nStrItemList[i] = (U8*) GetString((U16) (STR_ID_POC_PROFILE_1 + i));
  1562.         }
  1563.     }
  1564.     ShowCategory84Screen(
  1565.         STR_ID_POC_PROFILES,
  1566.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  1567.         STR_GLOBAL_OK,
  1568.         IMG_GLOBAL_OK,
  1569.         STR_GLOBAL_BACK,
  1570.         IMG_GLOBAL_BACK,
  1571.         POC_MAX_PROFILE_NUM,
  1572.         (U8 **) nStrItemList,
  1573.         icon_list,
  1574.         1,
  1575.         0,
  1576.         guiBuffer);
  1577.     SetLeftSoftkeyFunction(mmi_poc_entry_settings_profiles_opt, KEY_EVENT_UP);
  1578.     SetKeyHandler(mmi_poc_entry_settings_profiles_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1579.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1580.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1581. }
  1582. /*****************************************************************************
  1583.  * FUNCTION
  1584.  *  mmi_poc_profile_highlight_handler
  1585.  * DESCRIPTION
  1586.  *  highlight handler
  1587.  * PARAMETERS
  1588.  *  index       [IN]        Currently selected index
  1589.  * RETURNS
  1590.  *  void
  1591.  *****************************************************************************/
  1592. void mmi_poc_profile_highlight_handler(S32 index)
  1593. {
  1594.     /*----------------------------------------------------------------*/
  1595.     /* Local Variables                                                */
  1596.     /*----------------------------------------------------------------*/
  1597.     /*----------------------------------------------------------------*/
  1598.     /* Code Body                                                      */
  1599.     /*----------------------------------------------------------------*/
  1600.     g_poc_cntx_p->profile_selected = (U8) index;
  1601.     return;
  1602. }
  1603. /*****************************************************************************
  1604.  * FUNCTION
  1605.  *  mmi_poc_entry_settings_profiles_opt
  1606.  * DESCRIPTION
  1607.  *  profiles option screen
  1608.  * PARAMETERS
  1609.  *  void
  1610.  * RETURNS
  1611.  *  void
  1612.  *****************************************************************************/
  1613. void mmi_poc_entry_settings_profiles_opt(void)
  1614. {
  1615.     /*----------------------------------------------------------------*/
  1616.     /* Local Variables                                                */
  1617.     /*----------------------------------------------------------------*/
  1618.     U16 nStrItemList[MAX_SUB_MENUS];
  1619.     U16 nNumofItem;
  1620.     U8 *guiBuffer;
  1621.     /*----------------------------------------------------------------*/
  1622.     /* Code Body                                                      */
  1623.     /*----------------------------------------------------------------*/
  1624.     EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT, NULL, mmi_poc_entry_settings_profiles_opt, NULL);
  1625.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT);
  1626.     nNumofItem = GetNumOfChild(MENU_ID_POC_SETTINGS_PROFILES_OPTION);
  1627.     GetSequenceStringIds(MENU_ID_POC_SETTINGS_PROFILES_OPTION, nStrItemList);
  1628.     SetParentHandler(MENU_ID_POC_SETTINGS_PROFILES_OPTION);
  1629.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1630.     ShowCategory52Screen(
  1631.         STR_GLOBAL_OPTIONS,
  1632.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  1633.         STR_GLOBAL_OK,
  1634.         IMG_GLOBAL_OK,
  1635.         STR_GLOBAL_BACK,
  1636.         IMG_GLOBAL_BACK,
  1637.         nNumofItem,
  1638.         nStrItemList,
  1639.         (U16*) gIndexIconsImageList,
  1640.         0,
  1641.         0,
  1642.         0,
  1643.         guiBuffer);
  1644.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1645.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1646. }
  1647. /*****************************************************************************
  1648.  * FUNCTION
  1649.  *  mmi_poc_set_activate_profile
  1650.  * DESCRIPTION
  1651.  *  set active profile
  1652.  * PARAMETERS
  1653.  *  void
  1654.  * RETURNS
  1655.  *  void
  1656.  *****************************************************************************/
  1657. void mmi_poc_set_activate_profile(void)
  1658. {
  1659.     /*----------------------------------------------------------------*/
  1660.     /* Local Variables                                                */
  1661.     /*----------------------------------------------------------------*/
  1662.     U8 data = 0;
  1663.     S16 error;
  1664.     /*----------------------------------------------------------------*/
  1665.     /* Code Body                                                      */
  1666.     /*----------------------------------------------------------------*/
  1667.     if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
  1668.     {
  1669.         DisplayPopup(
  1670.             (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
  1671.             IMG_GLOBAL_UNFINISHED,
  1672.             1,
  1673.             CS_NOTIFYDURATION,
  1674.             ERROR_TONE);
  1675.         return;
  1676.     }
  1677.     if (g_poc_cntx_p->profile_active != (U8) g_poc_cntx_p->profile_selected)
  1678.     {
  1679.         data = (U8) g_poc_cntx_p->profile_selected;
  1680.         WriteValue(NVRAM_POC_PROFILE_ACTIVE, &data, DS_BYTE, &error);
  1681.         g_poc_cntx_p->profile_active = (U8) g_poc_cntx_p->profile_selected;
  1682.     }
  1683.     DisplayPopup(
  1684.         (U8*) GetString(STR_GLOBAL_DONE),
  1685.         IMG_GLOBAL_ACTIVATED,
  1686.         1,
  1687.         UI_POPUP_NOTIFYDURATION_TIME,
  1688.         (U8) SUCCESS_TONE);
  1689.     DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT);
  1690. }
  1691. /*****************************************************************************
  1692.  * FUNCTION
  1693.  *  mmi_poc_entry_setting_prof_edit_pre
  1694.  * DESCRIPTION
  1695.  *  profile edit pre-handler
  1696.  * PARAMETERS
  1697.  *  void
  1698.  * RETURNS
  1699.  *  void
  1700.  *****************************************************************************/
  1701. void mmi_poc_entry_setting_prof_edit_pre(void)
  1702. {
  1703.     /*----------------------------------------------------------------*/
  1704.     /* Local Variables                                                */
  1705.     /*----------------------------------------------------------------*/
  1706.     /*----------------------------------------------------------------*/
  1707.     /* Code Body                                                      */
  1708.     /*----------------------------------------------------------------*/
  1709.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1710.     SetKeyHandler(NULL, KEY_END, KEY_EVENT_DOWN);
  1711.     DataAccountReadyCheck(mmi_poc_entry_settings_profiles_edit);
  1712. }
  1713. /*****************************************************************************
  1714.  * FUNCTION
  1715.  *  mmi_poc_entry_settings_profiles_edit
  1716.  * DESCRIPTION
  1717.  *  profile edit screen
  1718.  * PARAMETERS
  1719.  *  void
  1720.  * RETURNS
  1721.  *  void
  1722.  *****************************************************************************/
  1723. void mmi_poc_entry_settings_profiles_edit(void)
  1724. {
  1725.     /*----------------------------------------------------------------*/
  1726.     /* Local Variables                                                */
  1727.     /*----------------------------------------------------------------*/
  1728.     U16 nStrItemList[MAX_SUB_MENUS];
  1729.     U16 nNumofItem;
  1730.     U8 *guiBuffer;
  1731.     U8 *PoCHint[MAX_SUB_MENUS];
  1732.     /*----------------------------------------------------------------*/
  1733.     /* Code Body                                                      */
  1734.     /*----------------------------------------------------------------*/
  1735.     EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT, NULL, mmi_poc_entry_settings_profiles_edit, NULL);
  1736.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT);
  1737.     nNumofItem = GetNumOfChild(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT);
  1738.     GetSequenceStringIds(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT, nStrItemList);
  1739.     SetParentHandler(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT);
  1740.     ConstructHintsList(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT, PoCHint);
  1741.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1742.     ShowCategory52Screen(
  1743.         STR_GLOBAL_EDIT,
  1744.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  1745.         STR_GLOBAL_OK,
  1746.         IMG_GLOBAL_OK,
  1747.         STR_GLOBAL_BACK,
  1748.         IMG_GLOBAL_BACK,
  1749.         nNumofItem,
  1750.         nStrItemList,
  1751.         (U16*) gIndexIconsImageList,
  1752.         PoCHint,
  1753.         0,
  1754.         0,
  1755.         guiBuffer);
  1756.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1757.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1758. }
  1759. /*****************************************************************************
  1760.  * FUNCTION
  1761.  *  mmi_poc_entry_settings_profiles_option_edit_poc
  1762.  * DESCRIPTION
  1763.  *  edit poc screen
  1764.  * PARAMETERS
  1765.  *  void
  1766.  * RETURNS
  1767.  *  void
  1768.  *****************************************************************************/
  1769. void mmi_poc_entry_settings_profiles_option_edit_poc(void)
  1770. {
  1771.     /*----------------------------------------------------------------*/
  1772.     /* Local Variables                                                */
  1773.     /*----------------------------------------------------------------*/
  1774.     U8 i, ImageLocation = 0;
  1775.     U8 *inputBuffer;
  1776.     U8 *guiBuffer;
  1777.     U16 inputBufferSize;
  1778.     U16 IconList[POC_PROFILE_POC_INLINE_NUM];
  1779.     U8 tempPortBuf[POC_MAX_PROFILE_PORT_LEN];
  1780.     /*----------------------------------------------------------------*/
  1781.     /* Code Body                                                      */
  1782.     /*----------------------------------------------------------------*/
  1783.     EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC, mmi_poc_exit_settings_profiles_option_edit_poc, NULL, NULL);
  1784.     InitializeCategory57Screen();
  1785.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC);
  1786.     inputBuffer = GetCurrNInputBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC, &inputBufferSize);
  1787.     SetParentHandler(0);
  1788.     if (inputBuffer == NULL)
  1789.     {
  1790.         memcpy(
  1791.             g_poc_cntx_p->profile_disp.prof_name,
  1792.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].prof_name,
  1793.             POC_MAX_PROF_NAME_LEN);
  1794.         AnsiiNToUnicodeString(
  1795.             (S8*) g_poc_cntx_p->profile_disp.disp_name,
  1796.             (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_name,
  1797.             POC_MAX_DISP_LEN - 1);
  1798.         if (strlen((S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri))
  1799.         {
  1800.             AnsiiNToUnicodeString(
  1801.                 (S8*) g_poc_cntx_p->profile_disp.uri,
  1802.                 (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri,
  1803.                 POC_MAX_URI_LEN - 1);
  1804.         }
  1805.         else
  1806.         {
  1807.             AnsiiNToUnicodeString(
  1808.                 (S8*) g_poc_cntx_p->profile_disp.uri,
  1809.                 (S8*) POC_MMI_SIP_PREFIX,
  1810.                 POC_MAX_URI_LEN - 1);
  1811.         }
  1812.         AnsiiNToUnicodeString(
  1813.             (S8*) g_poc_cntx_p->profile_disp.password,
  1814.             (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].password,
  1815.             POC_MAX_PASSWORD_LEN - 1);
  1816.         AnsiiNToUnicodeString(
  1817.             (S8*) g_poc_cntx_p->profile_disp.poc_addr,
  1818.             (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_addr,
  1819.             POC_PROXY_ADDR_LEN - 1);
  1820.         if (g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port == 0)
  1821.         {
  1822.             sprintf((char*)tempPortBuf, "");
  1823.         }
  1824.         else
  1825.         {
  1826.             sprintf((char*)tempPortBuf, "%d", g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port);
  1827.         }
  1828.         AnsiiNToUnicodeString(
  1829.             (S8*) g_poc_cntx_p->profile_disp.poc_port,
  1830.             (S8*) tempPortBuf,
  1831.             POC_MAX_PROFILE_PORT_LEN - 1);
  1832.         if (strlen((S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr))
  1833.         {
  1834.             AnsiiNToUnicodeString(
  1835.                 (S8*) g_poc_cntx_p->profile_disp.xdm_addr,
  1836.                 (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr,
  1837.                 POC_PROXY_ADDR_LEN - 1);
  1838.         }
  1839.         else
  1840.         {
  1841.             AnsiiNToUnicodeString(
  1842.                 (S8*) g_poc_cntx_p->profile_disp.xdm_addr,
  1843.                 (S8*) POC_MMI_HTTP_PREFIX,
  1844.                 POC_PROXY_ADDR_LEN - 1);
  1845.         }
  1846.     }
  1847.     mmi_poc_profile_fill_inline_struct();
  1848.     if (inputBuffer != NULL)
  1849.     {
  1850.         U8 tmp_profile_port_disp[POC_MAX_PROFILE_PORT_LEN * ENCODING_LENGTH];
  1851.         memcpy(tmp_profile_port_disp, g_poc_cntx_p->profile_disp.poc_port, sizeof(tmp_profile_port_disp));
  1852.         SetCategory57Data(wgui_inline_items, POC_PROFILE_POC_INLINE_NUM, inputBuffer);
  1853.         memcpy(g_poc_cntx_p->profile_disp.poc_port, tmp_profile_port_disp, sizeof(g_poc_cntx_p->profile_disp.poc_port));
  1854.     }
  1855.     if (guiBuffer == 0)
  1856.     {
  1857.         g_poc_cntx_p->inline_item_changed = MMI_FALSE;
  1858.     }
  1859.     if ((get_wgui_inline_list_menu_status() || g_poc_cntx_p->inline_item_changed) &&
  1860.         (GetInlineDoneFlag(guiBuffer) == 0))
  1861.     {
  1862.         SetInlineDoneFlag(guiBuffer);
  1863.     }
  1864.     for (i = 0; i < POC_PROFILE_POC_INLINE_NUM; i++)
  1865.     {
  1866.         if (i % 2)
  1867.         {
  1868.             IconList[i] = IMG_ID_POC_NOIMAGE;
  1869.         }
  1870.         else
  1871.         {
  1872.             IconList[i] = IMG_ID_POC_PROFILE_NAME + ImageLocation;
  1873.             ImageLocation++;
  1874.         }
  1875.     }
  1876.     ShowCategory57Screen(
  1877.         STR_GLOBAL_EDIT,
  1878.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  1879.         STR_GLOBAL_EDIT,
  1880.         IMG_GLOBAL_OK,
  1881.         STR_GLOBAL_BACK,
  1882.         IMG_GLOBAL_BACK,
  1883.         POC_PROFILE_POC_INLINE_NUM,
  1884.         IconList,
  1885.         wgui_inline_items,
  1886.         0,
  1887.         guiBuffer);
  1888.     SetCategory57RightSoftkeyFunctions(mmi_poc_entry_profile_edit_cfrm, GoBackHistory);
  1889. }
  1890. /*****************************************************************************
  1891.  * FUNCTION
  1892.  *  mmi_poc_exit_settings_profiles_option_edit_poc
  1893.  * DESCRIPTION
  1894.  *  exit function for edit poc screen
  1895.  * PARAMETERS
  1896.  *  void
  1897.  * RETURNS
  1898.  *  void
  1899.  *****************************************************************************/
  1900. void mmi_poc_exit_settings_profiles_option_edit_poc(void)
  1901. {
  1902.     /*----------------------------------------------------------------*/
  1903.     /* Local Variables                                                */
  1904.     /*----------------------------------------------------------------*/
  1905.     /*----------------------------------------------------------------*/
  1906.     /* Code Body                                                      */
  1907.     /*----------------------------------------------------------------*/
  1908.     set_leading_zero(TRUE);
  1909.     GenericExitInlineScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC, mmi_poc_entry_settings_profiles_option_edit_poc);
  1910. }
  1911. /*****************************************************************************
  1912.  * FUNCTION
  1913.  *  mmi_poc_entry_profile_edit_cfrm
  1914.  * DESCRIPTION
  1915.  *  edit confirm screen
  1916.  * PARAMETERS
  1917.  *  void
  1918.  * RETURNS
  1919.  *  void
  1920.  *****************************************************************************/
  1921. void mmi_poc_entry_profile_edit_cfrm(void)
  1922. {
  1923.     /*----------------------------------------------------------------*/
  1924.     /* Local Variables                                                */
  1925.     /*----------------------------------------------------------------*/
  1926.     /*----------------------------------------------------------------*/
  1927.     /* Code Body                                                      */
  1928.     /*----------------------------------------------------------------*/
  1929.     DisplayConfirm(
  1930.         STR_GLOBAL_YES,
  1931.         IMG_GLOBAL_YES,
  1932.         STR_GLOBAL_NO,
  1933.         IMG_GLOBAL_NO,
  1934.         get_string(STR_GLOBAL_SAVE),
  1935.         IMG_GLOBAL_QUESTION,
  1936.         WARNING_TONE);
  1937.     SetLeftSoftkeyFunction(mmi_poc_profile_edit_nvram, KEY_EVENT_UP);
  1938.     SetRightSoftkeyFunction(mmi_poc_go_back_profile, KEY_EVENT_UP);
  1939. }
  1940. /*****************************************************************************
  1941.  * FUNCTION
  1942.  *  mmi_poc_go_back_profile
  1943.  * DESCRIPTION
  1944.  *  go back profile
  1945.  * PARAMETERS
  1946.  *  void
  1947.  * RETURNS
  1948.  *  void
  1949.  *****************************************************************************/
  1950. void mmi_poc_go_back_profile(void)
  1951. {
  1952.     /*----------------------------------------------------------------*/
  1953.     /* Local Variables                                                */
  1954.     /*----------------------------------------------------------------*/
  1955.     /*----------------------------------------------------------------*/
  1956.     /* Code Body                                                      */
  1957.     /*----------------------------------------------------------------*/
  1958.     stopRequestedTone(WARNING_TONE);
  1959.     DeleteUptoScrID(SCR_ID_POC_SETTING_PROF_OPT_EDIT);
  1960.     GoBackHistory();
  1961. }
  1962. /*****************************************************************************
  1963.  * FUNCTION
  1964.  *  mmi_poc_profile_fill_inline_struct
  1965.  * DESCRIPTION
  1966.  *  fill profile inline structure
  1967.  * PARAMETERS
  1968.  *  void
  1969.  * RETURNS
  1970.  *  void
  1971.  *****************************************************************************/
  1972. void mmi_poc_profile_fill_inline_struct(void)
  1973. {
  1974.     /*----------------------------------------------------------------*/
  1975.     /* Local Variables                                                */
  1976.     /*----------------------------------------------------------------*/
  1977.     S32 BufferSize = 0;
  1978.     /*----------------------------------------------------------------*/
  1979.     /* Code Body                                                      */
  1980.     /*----------------------------------------------------------------*/
  1981.     set_leading_zero(FALSE);
  1982.     SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_NAME), KEY_LSK, KEY_EVENT_UP);
  1983.     SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_DISP_NAME), KEY_LSK, KEY_EVENT_UP);
  1984.     SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_URI), KEY_LSK, KEY_EVENT_UP);
  1985.     SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_PASS), KEY_LSK, KEY_EVENT_UP);
  1986.     SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_SERVERADDR), KEY_LSK, KEY_EVENT_UP);
  1987.     SetInlineItemActivation(
  1988.         (wgui_inline_items + POC_PROFILE_POC_SERVERPORT),
  1989.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1990.         0);
  1991.     SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_XDMADDR), KEY_LSK, KEY_EVENT_UP);
  1992.     SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_NAME_STR), (U8*) GetString(STR_ID_POC_PROFILE_NAME));
  1993.     SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_DISP_NAME_STR), (U8*) GetString(STR_ID_POC_NAME));
  1994.     SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_URI_STR), (U8*) GetString(STR_ID_POC_URI));
  1995.     SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_PASS_STR), (U8*) GetString(STR_ID_POC_PASSWORD));
  1996.     SetInlineItemCaption(
  1997.         (wgui_inline_items + POC_PROFILE_POC_SERVERADDR_STR),
  1998.         (U8*) GetString(STR_ID_POC_SERVER_ADDR));
  1999.     SetInlineItemCaption(
  2000.         (wgui_inline_items + POC_PROFILE_POC_SERVERPORT_STR),
  2001.         (U8*) GetString(STR_ID_POC_SERVER_PORT));
  2002.     SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_XDMADDR_STR), (U8*) GetString(STR_ID_POC_XDM_ADDR));
  2003.     BufferSize = POC_MAX_PROF_NAME_LEN / 2;
  2004.     SetInlineItemFullScreenEdit_ext(
  2005.         (wgui_inline_items + POC_PROFILE_POC_NAME),
  2006.         STR_ID_POC_PROFILE_NAME,
  2007.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2008.         (U8*) (g_poc_cntx_p->profile_disp.prof_name),
  2009.         BufferSize,
  2010.         (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
  2011.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2012.     SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_NAME, mmi_poc_entry_full_line_edit);
  2013.     BufferSize = POC_MAX_DISP_LEN / 2;
  2014.     SetInlineItemFullScreenEdit_ext(
  2015.         (wgui_inline_items + POC_PROFILE_POC_DISP_NAME),
  2016.         STR_ID_POC_NAME,
  2017.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2018.         (U8*) (g_poc_cntx_p->profile_disp.disp_name),
  2019.         BufferSize,
  2020.         (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
  2021.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2022.     SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_DISP_NAME, mmi_poc_entry_full_line_edit);
  2023.     /* BufferSize = POC_MAX_URI_LEN ; */
  2024.     BufferSize = POC_MAX_INLINE_ADDR_LEN;
  2025.     SetInlineItemFullScreenEdit_ext(
  2026.         (wgui_inline_items + POC_PROFILE_POC_URI),
  2027.         STR_ID_POC_URI,
  2028.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2029.         (U8*) (g_poc_cntx_p->profile_disp.uri),
  2030.         BufferSize,
  2031.         (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
  2032.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2033.     SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_URI, mmi_poc_entry_full_line_edit);
  2034.     BufferSize = POC_MAX_PASSWORD_LEN;
  2035.     SetInlineItemFullScreenEdit_ext(
  2036.         (wgui_inline_items + POC_PROFILE_POC_PASS),
  2037.         STR_ID_POC_PASSWORD,
  2038.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2039.         (U8*) (g_poc_cntx_p->profile_disp.password),
  2040.         BufferSize,
  2041.         (INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
  2042.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2043.     SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_PASS, mmi_poc_entry_full_line_edit);
  2044.     /* BufferSize = POC_PROXY_ADDR_LEN ; */
  2045.     BufferSize = POC_MAX_INLINE_ADDR_LEN;
  2046.     SetInlineItemFullScreenEdit_ext(
  2047.         (wgui_inline_items + POC_PROFILE_POC_SERVERADDR),
  2048.         STR_ID_POC_SERVER_ADDR,
  2049.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2050.         (U8*) (g_poc_cntx_p->profile_disp.poc_addr),
  2051.         BufferSize,
  2052.         (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
  2053.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2054.     SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_SERVERADDR, mmi_poc_entry_full_line_edit);
  2055.     BufferSize = POC_MAX_PROFILE_PORT_LEN;
  2056.     SetInlineItemTextEdit(
  2057.         (wgui_inline_items + POC_PROFILE_POC_SERVERPORT),
  2058.         (U8*) (g_poc_cntx_p->profile_disp.poc_port),
  2059.         BufferSize,
  2060.         INPUT_TYPE_NUMERIC);
  2061.     EnableInlineItemBoundary(wgui_inline_items + POC_PROFILE_POC_SERVERPORT);
  2062.     DisableInlineItemHighlight(wgui_inline_items + POC_PROFILE_POC_SERVERPORT);
  2063.     BufferSize = POC_PROXY_ADDR_LEN;
  2064.     /* BufferSize = POC_MAX_INLINE_ADDR_LEN ; */
  2065.     SetInlineItemFullScreenEdit_ext(
  2066.         (wgui_inline_items + POC_PROFILE_POC_XDMADDR),
  2067.         STR_ID_POC_XDM_ADDR,
  2068.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2069.         (U8*) (g_poc_cntx_p->profile_disp.xdm_addr),
  2070.         BufferSize,
  2071.         (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
  2072.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2073.     SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_XDMADDR, mmi_poc_entry_full_line_edit);
  2074. }
  2075. /*****************************************************************************
  2076.  * FUNCTION
  2077.  *  mmi_poc_entry_full_line_edit
  2078.  * DESCRIPTION
  2079.  *  entry inline editor full line editor
  2080.  * PARAMETERS
  2081.  *  void
  2082.  * RETURNS
  2083.  *  void
  2084.  *****************************************************************************/
  2085. void mmi_poc_entry_full_line_edit(void)
  2086. {
  2087.     /*----------------------------------------------------------------*/
  2088.     /* Local Variables                                                */
  2089.     /*----------------------------------------------------------------*/
  2090.     /*----------------------------------------------------------------*/
  2091.     /* Code Body                                                      */
  2092.     /*----------------------------------------------------------------*/
  2093.     ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  2094.     SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(MENU_ID_POC_MAIN));
  2095.     SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
  2096. }
  2097. /*****************************************************************************
  2098.  * FUNCTION
  2099.  *  mmi_poc_profile_edit_nvram
  2100.  * DESCRIPTION
  2101.  *  profile edit nvram
  2102.  * PARAMETERS
  2103.  *  void
  2104.  * RETURNS
  2105.  *  void
  2106.  *****************************************************************************/
  2107. void mmi_poc_profile_edit_nvram(void)
  2108. {
  2109.     /*----------------------------------------------------------------*/
  2110.     /* Local Variables                                                */
  2111.     /*----------------------------------------------------------------*/
  2112.     S16 error;
  2113.     S32 temp_proxy_port = 0;
  2114.     mmi_poc_profile_struct temp_profile;
  2115.     /*----------------------------------------------------------------*/
  2116.     /* Code Body                                                      */
  2117.     /*----------------------------------------------------------------*/
  2118.     memset(&temp_profile, 0, sizeof(mmi_poc_profile_struct));
  2119.     if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
  2120.     {
  2121.         DisplayPopup(
  2122.             (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
  2123.             IMG_GLOBAL_UNFINISHED,
  2124.             1,
  2125.             CS_NOTIFYDURATION,
  2126.             ERROR_TONE);
  2127.         DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC);
  2128.         return;
  2129.     }
  2130.     memcpy(temp_profile.prof_name, g_poc_cntx_p->profile_disp.prof_name, sizeof(temp_profile.prof_name));
  2131.     UnicodeNToAnsii((S8*) temp_profile.disp_name, (S8*) g_poc_cntx_p->profile_disp.disp_name, POC_MAX_DISP_LEN - 1);
  2132.     temp_profile.disp_charset = 0;
  2133.     UnicodeNToAnsii((S8*) temp_profile.uri, (S8*) g_poc_cntx_p->profile_disp.uri, POC_MAX_URI_LEN - 1);
  2134.     UnicodeNToAnsii((S8*) temp_profile.password, (S8*) g_poc_cntx_p->profile_disp.password, POC_MAX_PASSWORD_LEN - 1);
  2135.     UnicodeNToAnsii((S8*) temp_profile.poc_addr, (S8*) g_poc_cntx_p->profile_disp.poc_addr, POC_PROXY_ADDR_LEN - 1);
  2136.     temp_proxy_port = gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.poc_port);
  2137.     if (temp_proxy_port > 65535 || temp_proxy_port == 0)
  2138.     {
  2139.         DisplayPopup(
  2140.             (PU8) GetString(STR_ID_POC_ERR_INVALID_SETTING),
  2141.             IMG_GLOBAL_UNFINISHED,
  2142.             1,
  2143.             CS_NOTIFYDURATION,
  2144.             ERROR_TONE);
  2145.         return;
  2146.     }
  2147.     else
  2148.     {
  2149.         temp_profile.poc_port = (U16) temp_proxy_port;
  2150.     }
  2151.     UnicodeNToAnsii((S8*) temp_profile.xdm_addr, (S8*) g_poc_cntx_p->profile_disp.xdm_addr, POC_PROXY_ADDR_LEN - 1);
  2152.     temp_profile.data_account = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].data_account;
  2153.     temp_profile.use_proxy = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].use_proxy;
  2154.     memcpy(
  2155.         temp_profile.proxy_username,
  2156.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_username,
  2157.         sizeof(temp_profile.proxy_username));
  2158.     memcpy(
  2159.         temp_profile.proxy_password,
  2160.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_password,
  2161.         sizeof(temp_profile.proxy_password));
  2162.     memcpy(
  2163.         temp_profile.proxy_ip,
  2164.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip,
  2165.         sizeof(temp_profile.proxy_ip));
  2166.     temp_profile.proxy_port = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port;
  2167.     if (temp_profile.uri[0] == 0 || temp_profile.poc_addr[0] == 0 || temp_profile.poc_port > 65535 ||
  2168.         temp_profile.xdm_addr[0] == 0)
  2169.     {
  2170.         DisplayPopup((PU8) GetString(STR_ID_POC_NULL_STR_ERR), IMG_GLOBAL_UNFINISHED, 1, CS_NOTIFYDURATION, ERROR_TONE);
  2171.     }
  2172.     else
  2173.     {
  2174.         if (WriteRecord(
  2175.                 NVRAM_EF_POC_PROFILE_LID,
  2176.                 (U8) (g_poc_cntx_p->profile_selected + 1),
  2177.                 &temp_profile,
  2178.                 NVRAM_MAX_POC_PROFILE_SIZE,
  2179.                 &error) < NVRAM_MAX_POC_PROFILE_SIZE)
  2180.         {
  2181.             ASSERT(0);
  2182.         }
  2183.         memcpy(
  2184.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].prof_name,
  2185.             temp_profile.prof_name,
  2186.             sizeof(U8) * POC_MAX_PROF_NAME_LEN);
  2187.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_charset = temp_profile.disp_charset;
  2188.         memcpy(
  2189.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_name,
  2190.             temp_profile.disp_name,
  2191.             sizeof(U8) * POC_MAX_DISP_LEN);
  2192.         memcpy(
  2193.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri,
  2194.             temp_profile.uri,
  2195.             sizeof(U8) * POC_MAX_URI_LEN);
  2196.         memcpy(
  2197.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].password,
  2198.             temp_profile.password,
  2199.             sizeof(U8) * POC_MAX_PASSWORD_LEN);
  2200.         memcpy(
  2201.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_addr,
  2202.             temp_profile.poc_addr,
  2203.             sizeof(U8) * POC_PROXY_ADDR_LEN);
  2204.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port = temp_profile.poc_port;
  2205.         memcpy(
  2206.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr,
  2207.             temp_profile.xdm_addr,
  2208.             sizeof(U8) * POC_PROXY_ADDR_LEN);
  2209.         DisplayPopup(
  2210.             (U8*) GetString(STR_GLOBAL_DONE),
  2211.             IMG_GLOBAL_ACTIVATED,
  2212.             1,
  2213.             UI_POPUP_NOTIFYDURATION_TIME,
  2214.             (U8) SUCCESS_TONE);
  2215.         DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC);
  2216.     }
  2217. }
  2218. /*****************************************************************************
  2219.  * FUNCTION
  2220.  *  mmi_poc_entry_settings_profiles_option_edit_conn
  2221.  * DESCRIPTION
  2222.  *  edit connection settings screen
  2223.  * PARAMETERS
  2224.  *  void
  2225.  * RETURNS
  2226.  *  void
  2227.  *****************************************************************************/
  2228. void mmi_poc_entry_settings_profiles_option_edit_conn(void)
  2229. {
  2230.     /*----------------------------------------------------------------*/
  2231.     /* Local Variables                                                */
  2232.     /*----------------------------------------------------------------*/
  2233.     U8 *guiBuffer;
  2234.     U8 *inputBuffer;
  2235.     U16 inputBufferSize;
  2236.     U16 icon_list[] = 
  2237.     {
  2238.         IMG_GLOBAL_L1, 0,
  2239.         IMG_GLOBAL_L2, 0,
  2240.         IMG_GLOBAL_L3, 0,
  2241.         IMG_GLOBAL_L4, 0,
  2242.         IMG_GLOBAL_L5, 0,
  2243.         IMG_GLOBAL_L6, 0
  2244.     };
  2245.     /*----------------------------------------------------------------*/
  2246.     /* Code Body                                                      */
  2247.     /*----------------------------------------------------------------*/
  2248.     EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN, mmi_poc_exit_settings_profiles_option_edit_conn, NULL, NULL);
  2249.     InitializeCategory57Screen();
  2250.     guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
  2251.     inputBuffer = GetCurrNInputBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN, &inputBufferSize);
  2252.     if (inputBuffer == NULL)
  2253.     {
  2254.         g_poc_cntx_p->profile_disp.data_account =
  2255.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].data_account;
  2256.         g_poc_cntx_p->profile_disp.use_proxy = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].use_proxy;
  2257.         AnsiiNToUnicodeString(
  2258.             (S8*) g_poc_cntx_p->profile_disp.proxy_username,
  2259.             (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_username,
  2260.             XDM_MAX_PROXY_USERNAME_LEN);
  2261.         AnsiiNToUnicodeString(
  2262.             (S8*) g_poc_cntx_p->profile_disp.proxy_password,
  2263.             (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_password,
  2264.             XDM_MAX_PROXY_PASS_LEN);
  2265.         if (g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[0] == 0)
  2266.         {
  2267.             pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[0], (S8*) g_poc_zero_ip);
  2268.             pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[1], (S8*) g_poc_zero_ip);
  2269.             pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[2], (S8*) g_poc_zero_ip);
  2270.             pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[3], (S8*) g_poc_zero_ip);
  2271.         }
  2272.         else
  2273.         {
  2274.             gui_itoa(
  2275.                 (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[0],
  2276.                 (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[0],
  2277.                 10);
  2278.             gui_itoa(
  2279.                 (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[1],
  2280.                 (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[1],
  2281.                 10);
  2282.             gui_itoa(
  2283.                 (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[2],
  2284.                 (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[2],
  2285.                 10);
  2286.             gui_itoa(
  2287.                 (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[3],
  2288.                 (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[3],
  2289.                 10);
  2290.         }
  2291.         if (g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port == 0)
  2292.         {
  2293.             memset(g_poc_cntx_p->profile_disp.proxy_port, 0, sizeof(g_poc_cntx_p->profile_disp.proxy_port));
  2294.         }
  2295.         else
  2296.         {
  2297.             gui_itoa(
  2298.                 g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port,
  2299.                 (UI_string_type) g_poc_cntx_p->profile_disp.proxy_port,
  2300.                 10);
  2301.         }
  2302.         mmi_dtcnt_get_account_name(
  2303.             g_poc_cntx_p->profile_disp.data_account,
  2304.             (S8*) g_poc_cntx_p->profile_disp.dt_acct_name,
  2305.             MAX_DATA_ACCOUNT_NAME_LEN);
  2306.     }
  2307.     mmi_poc_prof_conn_fill_inline_struct();
  2308.     if (inputBuffer != NULL)
  2309.     {
  2310.         SetCategory57Data(wgui_inline_items, POC_PROFILE_CONN_INLINE_NUM, inputBuffer);
  2311.     }
  2312.     if (guiBuffer == 0)
  2313.     {
  2314.         g_poc_cntx_p->inline_item_changed = MMI_FALSE;
  2315.     }
  2316.     if ((get_wgui_inline_list_menu_status() || g_poc_cntx_p->inline_item_changed) &&
  2317.         (GetInlineDoneFlag(guiBuffer) == 0))
  2318.     {
  2319.         SetInlineDoneFlag(guiBuffer);
  2320.     }
  2321.     ShowCategory57Screen(
  2322.         STR_ID_POC_CONNECTION_SETTINGS,
  2323.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2324.         STR_GLOBAL_EDIT,
  2325.         IMG_GLOBAL_BACK,
  2326.         STR_GLOBAL_DONE,
  2327.         IMG_GLOBAL_BACK,
  2328.         POC_PROFILE_CONN_INLINE_NUM,
  2329.         (U16*) icon_list,
  2330.         wgui_inline_items,
  2331.         0,
  2332.         guiBuffer);
  2333.     SetCategory57RightSoftkeyFunctions(mmi_poc_entry_profile_edit_conn_cfrm, GoBackHistory);
  2334. }
  2335. /*****************************************************************************
  2336.  * FUNCTION
  2337.  *  mmi_poc_exit_settings_profiles_option_edit_conn
  2338.  * DESCRIPTION
  2339.  *  Exit function for inlnine editor screen of Connection Setting
  2340.  * PARAMETERS
  2341.  *  void
  2342.  * RETURNS
  2343.  *  void
  2344.  *****************************************************************************/
  2345. void mmi_poc_exit_settings_profiles_option_edit_conn(void)
  2346. {
  2347.     /*----------------------------------------------------------------*/
  2348.     /* Local Variables                                                */
  2349.     /*----------------------------------------------------------------*/
  2350.     /*----------------------------------------------------------------*/
  2351.     /* Code Body                                                      */
  2352.     /*----------------------------------------------------------------*/
  2353.     set_leading_zero(TRUE);
  2354.     GenericExitInlineScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN, mmi_poc_entry_settings_profiles_option_edit_conn);
  2355. }
  2356. /*****************************************************************************
  2357.  * FUNCTION
  2358.  *  mmi_poc_prof_conn_fill_inline_struct
  2359.  * DESCRIPTION
  2360.  *  Fill inline editor structure of profile.
  2361.  * PARAMETERS
  2362.  *  void
  2363.  * RETURNS
  2364.  *  void
  2365.  *****************************************************************************/
  2366. void mmi_poc_prof_conn_fill_inline_struct(void)
  2367. {
  2368.     /*----------------------------------------------------------------*/
  2369.     /* Local Variables                                                */
  2370.     /*----------------------------------------------------------------*/
  2371.     /*----------------------------------------------------------------*/
  2372.     /* Code Body                                                      */
  2373.     /*----------------------------------------------------------------*/
  2374.     /*  Yes/No */
  2375.     g_poc_cntx_p->profile_disp.yes_no_list[0] = (U8*) GetString(STR_GLOBAL_NO);
  2376.     g_poc_cntx_p->profile_disp.yes_no_list[1] = (U8*) GetString(STR_GLOBAL_YES);
  2377.     set_leading_zero(FALSE);
  2378.     /* Data Account */
  2379.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT_STR], KEY_LSK, KEY_EVENT_UP);
  2380.     SetInlineItemCaption(
  2381.         &wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT_STR],
  2382.         (U8*) GetString(STR_ID_POC_DATA_ACCOUNT));
  2383.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT], KEY_LSK, KEY_EVENT_UP);
  2384.     SetInlineItemImageText(
  2385.         &wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT],
  2386.         (U8*) g_poc_cntx_p->profile_disp.dt_acct_name,
  2387.         (PU8) NULL,
  2388.         NULL,
  2389.         NULL,
  2390.         MAX_DATA_ACCOUNT_NAME_LEN,
  2391.         0,
  2392.         0,
  2393.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
  2394.     SetInlineFullScreenEditCustomFunctionImageText(
  2395.         &wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT],
  2396.         mmi_poc_prof_list_data_acct);
  2397.     ShowAsControl(&wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT]);
  2398.     /* Use proxy */
  2399.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USE_PROXY_STR], KEY_LSK, KEY_EVENT_UP);
  2400.     SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_USE_PROXY_STR], (U8*) GetString(STR_ID_POC_USE_PROXY));
  2401.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USE_PROXY], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2402.     SetInlineItemSelect(
  2403.         &wgui_inline_items[POC_PROFILE_CONN_USE_PROXY],
  2404.         2,
  2405.         g_poc_cntx_p->profile_disp.yes_no_list,
  2406.         &g_poc_cntx_p->profile_disp.use_proxy);
  2407.     /* Proxy server */
  2408.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYADDR_STR], KEY_LSK, KEY_EVENT_UP);
  2409.     SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_PROXYADDR_STR], (U8*) GetString(STR_ID_POC_PROXY_ADDR));
  2410.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYRADDR], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2411.     SetInlineItemIP4(
  2412.         &wgui_inline_items[POC_PROFILE_CONN_PROXYRADDR],
  2413.         (U8*) g_poc_cntx_p->profile_disp.proxy_ip[0],
  2414.         (U8*) g_poc_cntx_p->profile_disp.proxy_ip[1],
  2415.         (U8*) g_poc_cntx_p->profile_disp.proxy_ip[2],
  2416.         (U8*) g_poc_cntx_p->profile_disp.proxy_ip[3],
  2417.         mmi_poc_prof_ip_addr_callback);
  2418.     /* Proxy port */
  2419.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT_STR], KEY_LSK, KEY_EVENT_UP);
  2420.     SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT_STR], (U8*) GetString(STR_ID_POC_PROXY_PORT));
  2421.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2422.     SetInlineItemTextEdit(
  2423.         &wgui_inline_items[POC_PROFILE_CONN_PROXYPORT],
  2424.         (U8*) (g_poc_cntx_p->profile_disp.proxy_port),
  2425.         POC_MAX_PROFILE_PORT_LEN,
  2426.         INPUT_TYPE_NUMERIC);
  2427.     EnableInlineItemBoundary(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT]);
  2428.     DisableInlineItemHighlight(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT]);
  2429.     /* Proxy User Name */
  2430.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USERNAME_STR], KEY_LSK, KEY_EVENT_UP);
  2431.     SetInlineItemCaption(
  2432.         &wgui_inline_items[POC_PROFILE_CONN_USERNAME_STR],
  2433.         (U8*) GetString(STR_ID_POC_PROXY_USERNAME));
  2434.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USERNAME], KEY_LSK, KEY_EVENT_UP);
  2435.     SetInlineItemFullScreenEdit_ext(
  2436.         &wgui_inline_items[POC_PROFILE_CONN_USERNAME],
  2437.         STR_ID_POC_PROXY_USERNAME,
  2438.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2439.         (U8*) g_poc_cntx_p->profile_disp.proxy_username,
  2440.         XDM_MAX_PROXY_USERNAME_LEN,
  2441.         (INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE),
  2442.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2443.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[POC_PROFILE_CONN_USERNAME], mmi_poc_entry_full_line_edit);
  2444.     /* Proxy Password */
  2445.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PASS_STR], KEY_LSK, KEY_EVENT_UP);
  2446.     SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_PASS_STR], (U8*) GetString(STR_ID_POC_PASSWORD));
  2447.     SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PASS], KEY_LSK, KEY_EVENT_UP);
  2448.     SetInlineItemFullScreenEdit_ext(
  2449.         &wgui_inline_items[POC_PROFILE_CONN_PASS],
  2450.         STR_ID_POC_PROXY_PASSWORD,
  2451.         GetRootTitleIcon(MENU_ID_POC_MAIN),
  2452.         (U8*) g_poc_cntx_p->profile_disp.proxy_password,
  2453.         XDM_MAX_PROXY_PASS_LEN,
  2454.         (INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_PASSWORD),
  2455.         INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
  2456.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[POC_PROFILE_CONN_PASS], mmi_poc_entry_full_line_edit);
  2457. }
  2458. /*****************************************************************************
  2459.  * FUNCTION
  2460.  *  mmi_poc_prof_list_data_acct
  2461.  * DESCRIPTION
  2462.  *  LSK handler of Data Account item in Profile Setting inline editor screen.
  2463.  * PARAMETERS
  2464.  *  void
  2465.  * RETURNS
  2466.  *  void
  2467.  *****************************************************************************/
  2468. void mmi_poc_prof_list_data_acct(void)
  2469. {
  2470.     /*----------------------------------------------------------------*/
  2471.     /* Local Variables                                                */
  2472.     /*----------------------------------------------------------------*/
  2473.     /*----------------------------------------------------------------*/
  2474.     /* Code Body                                                      */
  2475.     /*----------------------------------------------------------------*/
  2476.     mmi_dtcnt_select_account(
  2477.         mmi_poc_prof_gprs_dt_callback,
  2478.         MENU_ID_POC_MAIN,
  2479.         DATA_ACCOUNT_BEARER_GPRS | DATA_ACCOUNT_BEARER_WIFI);
  2480. }
  2481. /*****************************************************************************
  2482.  * FUNCTION
  2483.  *  mmi_poc_prof_gprs_dt_callback
  2484.  * DESCRIPTION
  2485.  *  Callback function for GPRS Data Account
  2486.  * PARAMETERS
  2487.  *  index       [IN]        Highlight index of selected account
  2488.  * RETURNS
  2489.  *  void
  2490.  *****************************************************************************/
  2491. void mmi_poc_prof_gprs_dt_callback(U16 index)
  2492. {
  2493.     /*----------------------------------------------------------------*/
  2494.     /* Local Variables                                                */
  2495.     /*----------------------------------------------------------------*/
  2496.     /*----------------------------------------------------------------*/
  2497.     /* Code Body                                                      */
  2498.     /*----------------------------------------------------------------*/
  2499.     g_poc_cntx_p->profile_disp.data_account = (U8) index;
  2500.     mmi_dtcnt_get_account_name(
  2501.         g_poc_cntx_p->profile_disp.data_account,
  2502.         (S8*) g_poc_cntx_p->profile_disp.dt_acct_name,
  2503.         MAX_DATA_ACCOUNT_NAME_LEN);
  2504.     DeleteUptoScrID(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
  2505.     g_poc_cntx_p->inline_item_changed = MMI_TRUE;
  2506.     GoBackHistory();
  2507. }
  2508. /*****************************************************************************
  2509.  * FUNCTION
  2510.  *  mmi_poc_prof_ip_addr_callback
  2511.  * DESCRIPTION
  2512.  *  Callback function for IP address editor in inline editor screen
  2513.  * PARAMETERS
  2514.  *  string_buffer       [?]     
  2515.  *  IP1                 [?]     
  2516.  *  IP2                 [?]     
  2517.  *  IP3                 [?]     
  2518.  *  IP4                 [?]     
  2519.  * RETURNS
  2520.  *  void
  2521.  *****************************************************************************/
  2522. void mmi_poc_prof_ip_addr_callback(U8 *string_buffer, U8 *IP1, U8 *IP2, U8 *IP3, U8 *IP4)
  2523. {
  2524.     /*----------------------------------------------------------------*/
  2525.     /* Local Variables                                                */
  2526.     /*----------------------------------------------------------------*/
  2527.     U8 Point[4];
  2528.     /*----------------------------------------------------------------*/
  2529.     /* Code Body                                                      */
  2530.     /*----------------------------------------------------------------*/
  2531.     AnsiiToUnicodeString((S8*) Point, (S8*) ".");
  2532.     pfnUnicodeStrcpy((PS8) string_buffer, (PS8) IP1);
  2533.     pfnUnicodeStrcat((PS8) string_buffer, (PS8) Point);
  2534.     pfnUnicodeStrcat((PS8) string_buffer, (PS8) IP2);
  2535.     pfnUnicodeStrcat((PS8) string_buffer, (PS8) Point);
  2536.     pfnUnicodeStrcat((PS8) string_buffer, (PS8) IP3);
  2537.     pfnUnicodeStrcat((PS8) string_buffer, (PS8) Point);
  2538.     pfnUnicodeStrcat((PS8) string_buffer, (PS8) IP4);
  2539. }
  2540. /*****************************************************************************
  2541.  * FUNCTION
  2542.  *  mmi_poc_entry_profile_edit_conn_cfrm
  2543.  * DESCRIPTION
  2544.  *  edit connection screen confirm
  2545.  * PARAMETERS
  2546.  *  void
  2547.  * RETURNS
  2548.  *  void
  2549.  *****************************************************************************/
  2550. void mmi_poc_entry_profile_edit_conn_cfrm(void)
  2551. {
  2552.     /*----------------------------------------------------------------*/
  2553.     /* Local Variables                                                */
  2554.     /*----------------------------------------------------------------*/
  2555.     /*----------------------------------------------------------------*/
  2556.     /* Code Body                                                      */
  2557.     /*----------------------------------------------------------------*/
  2558.     DisplayConfirm(
  2559.         STR_GLOBAL_YES,
  2560.         IMG_GLOBAL_YES,
  2561.         STR_GLOBAL_NO,
  2562.         IMG_GLOBAL_NO,
  2563.         get_string(STR_GLOBAL_SAVE),
  2564.         IMG_GLOBAL_QUESTION,
  2565.         WARNING_TONE);
  2566.     SetLeftSoftkeyFunction(mmi_poc_profile_edit_conn_nvram, KEY_EVENT_UP);
  2567.     SetRightSoftkeyFunction(mmi_poc_go_back_profile, KEY_EVENT_UP);
  2568. }
  2569. /*****************************************************************************
  2570.  * FUNCTION
  2571.  *  mmi_poc_profile_edit_conn_nvram
  2572.  * DESCRIPTION
  2573.  *  
  2574.  * PARAMETERS
  2575.  *  void
  2576.  * RETURNS
  2577.  *  void
  2578.  *****************************************************************************/
  2579. void mmi_poc_profile_edit_conn_nvram(void)
  2580. {
  2581.     /*----------------------------------------------------------------*/
  2582.     /* Local Variables                                                */
  2583.     /*----------------------------------------------------------------*/
  2584.     S16 error;
  2585.     S32 temp_proxy_port = 0;
  2586.     mmi_poc_profile_struct temp_profile;
  2587.     /*----------------------------------------------------------------*/
  2588.     /* Code Body                                                      */
  2589.     /*----------------------------------------------------------------*/
  2590.     memset(&temp_profile, 0, sizeof(mmi_poc_profile_struct));
  2591.     if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
  2592.     {
  2593.         DisplayPopup(
  2594.             (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
  2595.             IMG_GLOBAL_UNFINISHED,
  2596.             1,
  2597.             CS_NOTIFYDURATION,
  2598.             ERROR_TONE);
  2599.         DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
  2600.         return;
  2601.     }
  2602.     /* set existing values */
  2603.     memcpy(
  2604.         temp_profile.prof_name,
  2605.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].prof_name,
  2606.         sizeof(temp_profile.prof_name));
  2607.     memcpy(
  2608.         temp_profile.disp_name,
  2609.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_name,
  2610.         sizeof(temp_profile.prof_name));
  2611.     temp_profile.disp_charset = 0;
  2612.     memcpy(temp_profile.uri, g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri, sizeof(temp_profile.uri));
  2613.     memcpy(
  2614.         temp_profile.password,
  2615.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].password,
  2616.         sizeof(temp_profile.password));
  2617.     memcpy(
  2618.         temp_profile.poc_addr,
  2619.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_addr,
  2620.         sizeof(temp_profile.poc_addr));
  2621.     temp_profile.poc_port = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port;
  2622.     memcpy(
  2623.         temp_profile.xdm_addr,
  2624.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr,
  2625.         sizeof(temp_profile.xdm_addr));
  2626.     /* set new values from display buffer */
  2627.     temp_profile.data_account = g_poc_cntx_p->profile_disp.data_account;
  2628.     temp_profile.use_proxy = g_poc_cntx_p->profile_disp.use_proxy;
  2629.     UnicodeNToAnsii(
  2630.         (S8*) temp_profile.proxy_username,
  2631.         (S8*) g_poc_cntx_p->profile_disp.proxy_username,
  2632.         XDM_MAX_PROXY_USERNAME_LEN - 1);
  2633.     UnicodeNToAnsii(
  2634.         (S8*) temp_profile.proxy_password,
  2635.         (S8*) g_poc_cntx_p->profile_disp.proxy_password,
  2636.         XDM_MAX_PROXY_PASS_LEN - 1);
  2637.     temp_profile.proxy_ip[0] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[0]);
  2638.     temp_profile.proxy_ip[1] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[1]);
  2639.     temp_profile.proxy_ip[2] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[2]);
  2640.     temp_profile.proxy_ip[3] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[3]);
  2641.     temp_proxy_port = gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_port);
  2642.     if (temp_proxy_port > 65535)
  2643.     {
  2644.         DisplayPopup(
  2645.             (PU8) GetString(STR_ID_POC_ERR_INVALID_SETTING),
  2646.             IMG_GLOBAL_UNFINISHED,
  2647.             1,
  2648.             CS_NOTIFYDURATION,
  2649.             ERROR_TONE);
  2650.         return;
  2651.     }
  2652.     else
  2653.     {
  2654.         temp_profile.proxy_port = (U16) temp_proxy_port;
  2655.     }
  2656.     if (temp_profile.use_proxy == MMI_TRUE && temp_profile.proxy_port == 0)
  2657.     {
  2658.         DisplayPopup(
  2659.             (PU8) GetString(STR_ID_POC_ERR_INVALID_SETTING),
  2660.             IMG_GLOBAL_UNFINISHED,
  2661.             1,
  2662.             CS_NOTIFYDURATION,
  2663.             ERROR_TONE);
  2664.         return;
  2665.     }
  2666.     if (temp_profile.use_proxy == MMI_TRUE && temp_profile.proxy_ip[0] == 0)
  2667.     {
  2668.         DisplayPopup((PU8) GetString(STR_ID_POC_NULL_STR_ERR), IMG_GLOBAL_UNFINISHED, 1, CS_NOTIFYDURATION, ERROR_TONE);
  2669.         return;
  2670.     }
  2671.     else
  2672.     {
  2673.         if (WriteRecord(
  2674.                 NVRAM_EF_POC_PROFILE_LID,
  2675.                 (U8) (g_poc_cntx_p->profile_selected + 1),
  2676.                 &temp_profile,
  2677.                 NVRAM_MAX_POC_PROFILE_SIZE,
  2678.                 &error) < NVRAM_MAX_POC_PROFILE_SIZE)
  2679.         {
  2680.             ASSERT(0);
  2681.         }
  2682.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].data_account = temp_profile.data_account;
  2683.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].use_proxy = temp_profile.use_proxy;
  2684.         memcpy(
  2685.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_username,
  2686.             temp_profile.proxy_username,
  2687.             sizeof(U8) * XDM_MAX_PROXY_USERNAME_LEN);
  2688.         memcpy(
  2689.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_password,
  2690.             temp_profile.proxy_password,
  2691.             sizeof(U8) * XDM_MAX_PROXY_PASS_LEN);
  2692.         memcpy(
  2693.             g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip,
  2694.             temp_profile.proxy_ip,
  2695.             sizeof(U8) * XDM_MAX_IP_LEN);
  2696.         g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port = temp_profile.proxy_port;
  2697.         DisplayPopup(
  2698.             (U8*) GetString(STR_GLOBAL_DONE),
  2699.             IMG_GLOBAL_ACTIVATED,
  2700.             1,
  2701.             UI_POPUP_NOTIFYDURATION_TIME,
  2702.             (U8) SUCCESS_TONE);
  2703.         DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
  2704.     }
  2705. }
  2706. #endif /* __MMI_POC__ */