PoCMain.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:227k
- POC_MAX_URI_LEN * sizeof(U8));
- myMsgPtr->pinfo.is_active = MMI_TRUE;
- myMsgPtr->pinfo.person.activity_present = g_poc_cntx_p->person_pres_disp.activity_present;
- myMsgPtr->pinfo.person.activity = g_poc_cntx_p->person_pres_disp.activity;
- myMsgPtr->pinfo.person.mood_present = g_poc_cntx_p->person_pres_disp.mood_present;
- myMsgPtr->pinfo.person.mood = g_poc_cntx_p->person_pres_disp.mood;
- myMsgPtr->pinfo.num_service = 0;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_PUBLISH_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_presence_publish_rsp, MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_presence_publish_rsp
- * DESCRIPTION
- * presence publish response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_presence_publish_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_publish_rsp_struct *msgRsp;
- U8 data;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_publish_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_PUBLISH_RSP);
- g_poc_cntx_p->progressing.my_status = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- g_poc_cntx_p->person_pres.activity_present = g_poc_cntx_p->person_pres_disp.activity_present;
- g_poc_cntx_p->person_pres.activity = g_poc_cntx_p->person_pres_disp.activity;
- g_poc_cntx_p->person_pres.mood_present = g_poc_cntx_p->person_pres_disp.mood_present;
- g_poc_cntx_p->person_pres.mood = g_poc_cntx_p->person_pres_disp.mood;
- data = g_poc_cntx_p->person_pres.activity_present;
- WriteValue(NVRAM_POC_ACTIVITY_PRESENT, &data, DS_BYTE, &error);
- data = g_poc_cntx_p->person_pres.activity;
- WriteValue(NVRAM_POC_ACTIVITY, &data, DS_BYTE, &error);
- data = g_poc_cntx_p->person_pres.mood_present;
- WriteValue(NVRAM_POC_MOOD_PRESENT, &data, DS_BYTE, &error);
- data = g_poc_cntx_p->person_pres.mood;
- WriteValue(NVRAM_POC_MOOD, &data, DS_BYTE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_my_status_mood
- * DESCRIPTION
- * mood screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_my_status_mood(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nNumofItem;
- U8 *guiBuffer;
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_MYSTATUS_MOOD, NULL, mmi_poc_entry_settings_my_status_mood, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_MYSTATUS_MOOD);
- nNumofItem = POC_MAX_MOOD_NUM;
- SetParentHandler(MENU_ID_POC_SETTINGS_MY_STATUS_MOOD);
- RegisterHighlightHandler(mmi_poc_mood_highlight_handler);
- nStrItemList[0] = STR_GLOBAL_EMPTY;
- for (i = 1; i < nNumofItem; i++)
- {
- nStrItemList[i] = STR_ID_POC_HAPPY + i - 1;
- }
- if (guiBuffer == NULL)
- {
- g_poc_cntx_p->mood_selected = 0;
- }
- ShowCategory52Screen(
- STR_ID_POC_MOOD,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- g_poc_cntx_p->mood_selected,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_entry_set_mood, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_mood_highlight_handler
- * DESCRIPTION
- * mood screen highlight handler
- * PARAMETERS
- * index [IN] Currently selected index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_mood_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->mood_selected = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_set_mood
- * DESCRIPTION
- * set mood
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_set_mood(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memcpy(&g_poc_cntx_p->person_pres_disp, &g_poc_cntx_p->person_pres, sizeof(mmi_poc_person_pinfo_struct));
- switch (g_poc_cntx_p->mood_selected)
- {
- case 0:
- g_poc_cntx_p->person_pres_disp.mood_present = MMI_FALSE;
- break;
- case 1:
- g_poc_cntx_p->person_pres_disp.mood_present = MMI_TRUE;
- g_poc_cntx_p->person_pres_disp.mood = POC_MOOD_HAPPY;
- break;
- case 2:
- g_poc_cntx_p->person_pres_disp.mood_present = MMI_TRUE;
- g_poc_cntx_p->person_pres_disp.mood = POC_MOOD_BORED;
- break;
- case 3:
- g_poc_cntx_p->person_pres_disp.mood_present = MMI_TRUE;
- g_poc_cntx_p->person_pres_disp.mood = POC_MOOD_DEPRESSED;
- break;
- default:
- break;
- }
- mmi_poc_entry_progressing();
- DeleteUptoScrID(SCR_ID_POC_SETTING);
- mmi_poc_presence_publish_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_ans_mode
- * DESCRIPTION
- * switch answer mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_ans_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- mmi_poc_entry_progressing();
- mmi_poc_switch_ans_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_ans_mode_req
- * DESCRIPTION
- * switch answer mode request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_ans_mode_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
- if (g_poc_cntx_p->curr_ans_mode == MMI_TRUE)
- {
- myMsgPtr->data.auto_answer = MMI_FALSE;
- }
- else
- {
- myMsgPtr->data.auto_answer = MMI_TRUE;
- }
- myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
- myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
- myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
- memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_switch_ans_mode_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_ans_mode_rsp
- * DESCRIPTION
- * switch ans mode response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_ans_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- poc_setting_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- if (g_poc_cntx_p->curr_ans_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_ans_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_ans_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_ans_mode;
- WriteValue(NVRAM_POC_ANS_MODE, &data, DS_BYTE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_call_barring_mode
- * DESCRIPTION
- * switch call barring mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_call_barring_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- mmi_poc_entry_progressing();
- mmi_poc_switch_call_barring_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_call_barring_mode_req
- * DESCRIPTION
- * switch call barring mode request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_call_barring_mode_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
- myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
- if (g_poc_cntx_p->curr_call_bar_mode == MMI_TRUE)
- {
- myMsgPtr->data.isb = MMI_FALSE;
- }
- else
- {
- myMsgPtr->data.isb = MMI_TRUE;
- }
- myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
- myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
- memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_switch_call_barring_mode_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_call_barring_mode_rsp
- * DESCRIPTION
- * switch call barring mode response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_call_barring_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- poc_setting_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- if (g_poc_cntx_p->curr_call_bar_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_call_bar_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_call_bar_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_call_bar_mode;
- WriteValue(NVRAM_POC_CALL_BAR_MODE, &data, DS_BYTE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_alert_barring_mode
- * DESCRIPTION
- * switch alert barring mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_alert_barring_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- mmi_poc_entry_progressing();
- mmi_poc_switch_alert_barring_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_mao_mode
- * DESCRIPTION
- * switch mao mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_mao_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POC_CALL_STATE, (S32) g_poc_cntx_p->call_status));
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- mmi_poc_entry_progressing();
- mmi_poc_switch_mao_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_alert_barring_mode_req
- * DESCRIPTION
- * switch alert barring mode request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_alert_barring_mode_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
- myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
- myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
- if (g_poc_cntx_p->curr_alert_bar_mode == MMI_TRUE)
- {
- myMsgPtr->data.ipab = MMI_FALSE;
- }
- else
- {
- myMsgPtr->data.ipab = MMI_TRUE;
- }
- myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
- memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_switch_alert_barring_mode_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_mao_mode_req
- * DESCRIPTION
- * switch mao mode request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_mao_mode_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
- myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
- myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
- myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
- if (g_poc_cntx_p->curr_mao_mode == MMI_TRUE)
- {
- myMsgPtr->data.enable_mao = MMI_FALSE;
- }
- else
- {
- myMsgPtr->data.enable_mao = MMI_TRUE;
- }
- myMsgPtr->data.enable_privacy = g_poc_cntx_p->curr_privacy_mode;
- memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_switch_mao_mode_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_alert_barring_mode_rsp
- * DESCRIPTION
- * switch alert barring mode response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_alert_barring_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- poc_setting_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- if (g_poc_cntx_p->curr_alert_bar_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_alert_bar_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_alert_bar_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_alert_bar_mode;
- WriteValue(NVRAM_POC_ALERT_BAR_MODE, &data, DS_BYTE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_switch_mao_mode_rsp
- * DESCRIPTION
- * switch mao mode response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_switch_mao_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- poc_setting_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- if (g_poc_cntx_p->curr_mao_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_mao_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_mao_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_mao_mode;
- WriteValue(NVRAM_POC_MAO_MODE, &data, DS_BYTE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_privacy
- * DESCRIPTION
- * privacy screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_privacy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- U8 *guiBuffer; /* Buffer holding history data */
- U16 menuId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- EntryNewScreen(SCR_ID_POC_SETTING_PRIVACY, NULL, mmi_poc_entry_settings_privacy, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PRIVACY);
- menuId = MENU_ID_POC_SETTINGS_PRIVACY;
- nNumofItem = GetNumOfChild(menuId);
- GetSequenceStringIds(menuId, nStrItemList);
- SetParentHandler(menuId);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_ID_POC_PRIVACY,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- 1,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_privacy_disable
- * DESCRIPTION
- * set privacy disable
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_privacy_disable(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteUptoScrID(STR_ID_POC_SETTINGS);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(STR_ID_POC_SETTINGS);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(STR_ID_POC_SETTINGS);
- return;
- }
- mmi_poc_entry_progressing();
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PRIVACY);
- mmi_poc_set_privacy_disable_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_privacy_disable_req
- * DESCRIPTION
- * set privacy disable request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_privacy_disable_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
- myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
- myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
- myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
- myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->data.enable_privacy = MMI_FALSE;
- memcpy(&myMsgPtr->data.privacy_addr, &g_poc_cntx_p->privacy_addr, sizeof(poc_addr_struct));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_set_privacy_disable_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_privacy_disable_rsp
- * DESCRIPTION
- * set privacy disable response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_privacy_disable_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- poc_setting_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- g_poc_cntx_p->curr_privacy_mode = MMI_FALSE;
- data = g_poc_cntx_p->curr_privacy_mode;
- WriteValue(NVRAM_POC_PRIVACY_MODE, &data, DS_BYTE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_privacy_enable
- * DESCRIPTION
- * privacy enable screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_privacy_enable(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_REGED)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_NOT_REGISTERED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteUptoScrID(STR_ID_POC_SETTINGS);
- return;
- }
- if (g_poc_cntx_p->progressing.poc_settings == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(STR_ID_POC_SETTINGS);
- return;
- }
- if (g_poc_cntx_p->call_status != POC_CALL_NONE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TERMINATE_CALL_FIRST),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- DeleteUptoScrID(STR_ID_POC_SETTINGS);
- return;
- }
- EntryNewScreen(SCR_ID_POC_SETTING_PRIVACY_ADDR, NULL, mmi_poc_entry_settings_privacy_enable, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PRIVACY_ADDR);
- if (guiBuffer == NULL)
- {
- memset(g_poc_cntx_p->privacy_addr_disp, 0, sizeof(g_poc_cntx_p->privacy_addr_disp));
- if (strlen((S8*) g_poc_cntx_p->privacy_addr.uri) == 0)
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->privacy_addr_disp,
- (S8*) POC_MMI_DEFAULT_PRIVACY_ADDR,
- POC_MAX_URI_LEN - 1);
- }
- else
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->privacy_addr_disp,
- (S8*) g_poc_cntx_p->privacy_addr.uri,
- POC_MAX_URI_LEN - 1);
- }
- }
- RegisterInputBoxValidationFunction(mmi_poc_privacy_addr_msg_key);
- ShowCategory5Screen(
- STR_ID_POC_PRIVACY_ADDR,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- (U8*) g_poc_cntx_p->privacy_addr_disp,
- POC_MAX_URI_LEN,
- guiBuffer);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_poc_set_privacy_enable_req, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
- if (pfnUnicodeStrlen((S8*) g_poc_cntx_p->privacy_addr_disp) == 0)
- {
- ChangeLeftSoftkey(0, 0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_privacy_addr_msg_key
- * DESCRIPTION
- * privacy address message key
- * PARAMETERS
- * text [?]
- * cursor [?]
- * length [IN]
- * Framework parameters, don't care.(?)
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_privacy_addr_msg_key(U8 *text, U8 *cursor, S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* check the validity of the input password */
- if ((length) < 1)
- {
- /* if length is short then disable lsk */
- ChangeLeftSoftkey(0, 0);
- }
- else
- {
- /* if its valid length then enable lsk */
- EnableLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_privacy_enable_req
- * DESCRIPTION
- * set privacy enable request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_privacy_enable_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_setting_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_setting_req_struct*) OslConstructDataPtr(sizeof(poc_setting_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_setting_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- mmi_poc_entry_progressing();
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PRIVACY);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PRIVACY_ADDR);
- g_poc_cntx_p->progressing.poc_settings = MMI_TRUE;
- myMsgPtr->data.auto_answer = g_poc_cntx_p->curr_ans_mode;
- myMsgPtr->data.isb = g_poc_cntx_p->curr_call_bar_mode;
- myMsgPtr->data.ipab = g_poc_cntx_p->curr_alert_bar_mode;
- myMsgPtr->data.enable_mao = g_poc_cntx_p->curr_mao_mode;
- myMsgPtr->data.enable_privacy = MMI_TRUE;
- memset(&myMsgPtr->data.privacy_addr, 0, sizeof(myMsgPtr->data.privacy_addr));
- UnicodeNToAnsii(
- (S8*) myMsgPtr->data.privacy_addr.uri,
- (S8*) g_poc_cntx_p->privacy_addr_disp,
- POC_MAX_URI_LEN - 1);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = PRT_POC_SETTING_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_set_privacy_enable_rsp, PRT_POC_SETTING_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_privacy_enable_rsp
- * DESCRIPTION
- * set privacy enable response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_privacy_enable_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- poc_setting_rsp_struct *msgRsp;
- poc_addr_struct temp_privacy;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_setting_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_POC_SETTING_RSP);
- g_poc_cntx_p->progressing.poc_settings = MMI_FALSE;
- if (msgRsp->result == POC_OK)
- {
- if ((GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING) || (GetActiveScreenId() == SCR_ID_POC_SETTING))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- memset(g_poc_cntx_p->privacy_addr.uri, 0, sizeof(g_poc_cntx_p->privacy_addr.uri));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->privacy_addr.uri,
- (S8*) g_poc_cntx_p->privacy_addr_disp,
- POC_MAX_URI_LEN - 1);
- g_poc_cntx_p->curr_privacy_mode = MMI_TRUE;
- data = g_poc_cntx_p->curr_privacy_mode;
- WriteValue(NVRAM_POC_PRIVACY_MODE, &data, DS_BYTE, &error);
- memset(&temp_privacy, 0, sizeof(poc_addr_struct));
- memcpy(temp_privacy.uri, g_poc_cntx_p->privacy_addr.uri, sizeof(temp_privacy.uri));
- WriteRecord(NVRAM_EF_POC_PRIVACY_LID, 1, &temp_privacy, NVRAM_MAX_POC_PRIVACY_SIZE, &error);
- }
- else
- {
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_start_at_bootup
- * DESCRIPTION
- * set start at bootup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_start_at_bootup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_boot_start_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_boot_start_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_boot_start_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_boot_start_mode;
- WriteValue(NVRAM_POC_START_BOOTUP, &data, DS_BYTE, &error);
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_xdm_mode
- * DESCRIPTION
- * set xdm mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_xdm_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_use_xdm_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_use_xdm_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_use_xdm_mode;
- WriteValue(NVRAM_POC_USE_XDM, &data, DS_BYTE, &error);
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_pres_mode
- * DESCRIPTION
- * set presence mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_pres_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
- {
- g_poc_cntx_p->curr_use_pres_mode = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->curr_use_pres_mode = MMI_TRUE;
- }
- data = g_poc_cntx_p->curr_use_pres_mode;
- WriteValue(NVRAM_POC_USE_PRES, &data, DS_BYTE, &error);
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- #ifdef __MMI_POC_ADHOC_STR_INPUT__
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_adhoc_str
- * DESCRIPTION
- * adhoc string screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_adhoc_str(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_ADHOC_STR, NULL, mmi_poc_entry_settings_adhoc_str, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_ADHOC_STR);
- if (guiBuffer == NULL)
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_adhoc_str_disp,
- (S8*) poc_custom_get_conference_factory_uri(),
- POC_AD_HOC_STR_MAX_LEN - 1);
- }
- RegisterInputBoxValidationFunction(mmi_poc_privacy_addr_msg_key);
- ShowCategory5Screen(
- STR_ID_POC_ADHOC_STR,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- (U8*) g_poc_adhoc_str_disp,
- POC_AD_HOC_STR_MAX_LEN - 1,
- guiBuffer);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_poc_set_adhoc_str, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
- if (pfnUnicodeStrlen((S8*) g_poc_adhoc_str_disp) == 0)
- {
- ChangeLeftSoftkey(0, 0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_adhoc_str
- * DESCRIPTION
- * set adhoc string
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_adhoc_str(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 temp_buf[POC_AD_HOC_STR_MAX_LEN];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_ADHOC_STR);
- memset(temp_buf, 0, sizeof(temp_buf));
- UnicodeToAnsii((S8*) temp_buf, (S8*) g_poc_adhoc_str_disp);
- poc_custom_set_conference_factory_uri((kal_char*) temp_buf);
- }
- #endif /* __MMI_POC_ADHOC_STR_INPUT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_profiles
- * DESCRIPTION
- * setting profiles screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_profiles(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 i;
- U16 icon_list[POC_MAX_PROFILE_NUM];
- U8 *nStrItemList[POC_MAX_PROFILE_NUM];
- mmi_poc_profile_struct temp_profile;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_PROF, NULL, mmi_poc_entry_settings_profiles, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF);
- RegisterHighlightHandler(mmi_poc_profile_highlight_handler);
- memset(icon_list, 0, sizeof(icon_list));
- icon_list[g_poc_cntx_p->profile_active] = IMG_ID_POC_PROFILE_SELECTED;
- for (i = 0; i < POC_MAX_PROFILE_NUM; i++)
- {
- ReadRecord(NVRAM_EF_POC_PROFILE_LID, (U8) (i + 1), &temp_profile, NVRAM_MAX_POC_PROFILE_SIZE, &error);
- if (temp_profile.prof_name[0] == 0xFF)
- {
- memset(&g_poc_cntx_p->profile_list[i], 0, sizeof(g_poc_cntx_p->profile_list[i]));
- g_poc_cntx_p->profile_list[i].data_account = mmi_dtcnt_get_first_account_id(DATA_ACCOUNT_BEARER_GPRS | DATA_ACCOUNT_BEARER_WIFI);
- pfnUnicodeStrcpy(
- (PS8) g_poc_cntx_p->profile_list[i].prof_name,
- (PS8) GetString((U16) (STR_ID_POC_PROFILE_1 + i)));
- }
- }
- for (i = 0; i < POC_MAX_PROFILE_NUM; i++)
- {
- if (UCS2Strlen((S8*) g_poc_cntx_p->profile_list[i].prof_name) > 0)
- {
- nStrItemList[i] = g_poc_cntx_p->profile_list[i].prof_name;
- }
- else
- {
- nStrItemList[i] = (U8*) GetString((U16) (STR_ID_POC_PROFILE_1 + i));
- }
- }
- ShowCategory84Screen(
- STR_ID_POC_PROFILES,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- POC_MAX_PROFILE_NUM,
- (U8 **) nStrItemList,
- icon_list,
- 1,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_entry_settings_profiles_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_entry_settings_profiles_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_profile_highlight_handler
- * DESCRIPTION
- * highlight handler
- * PARAMETERS
- * index [IN] Currently selected index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_profile_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->profile_selected = (U8) index;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_profiles_opt
- * DESCRIPTION
- * profiles option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_profiles_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nNumofItem;
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT, NULL, mmi_poc_entry_settings_profiles_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT);
- nNumofItem = GetNumOfChild(MENU_ID_POC_SETTINGS_PROFILES_OPTION);
- GetSequenceStringIds(MENU_ID_POC_SETTINGS_PROFILES_OPTION, nStrItemList);
- SetParentHandler(MENU_ID_POC_SETTINGS_PROFILES_OPTION);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_OPTIONS,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- 0,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_set_activate_profile
- * DESCRIPTION
- * set active profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_set_activate_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- if (g_poc_cntx_p->profile_active != (U8) g_poc_cntx_p->profile_selected)
- {
- data = (U8) g_poc_cntx_p->profile_selected;
- WriteValue(NVRAM_POC_PROFILE_ACTIVE, &data, DS_BYTE, &error);
- g_poc_cntx_p->profile_active = (U8) g_poc_cntx_p->profile_selected;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_setting_prof_edit_pre
- * DESCRIPTION
- * profile edit pre-handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_setting_prof_edit_pre(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetKeyHandler(NULL, KEY_END, KEY_EVENT_DOWN);
- DataAccountReadyCheck(mmi_poc_entry_settings_profiles_edit);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_profiles_edit
- * DESCRIPTION
- * profile edit screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_profiles_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nNumofItem;
- U8 *guiBuffer;
- U8 *PoCHint[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT, NULL, mmi_poc_entry_settings_profiles_edit, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT);
- nNumofItem = GetNumOfChild(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT);
- GetSequenceStringIds(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT, nStrItemList);
- SetParentHandler(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT);
- ConstructHintsList(MENU_ID_POC_SETTINGS_PROFILES_OPTION_EDIT, PoCHint);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_GLOBAL_EDIT,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- PoCHint,
- 0,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_profiles_option_edit_poc
- * DESCRIPTION
- * edit poc screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_profiles_option_edit_poc(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i, ImageLocation = 0;
- U8 *inputBuffer;
- U8 *guiBuffer;
- U16 inputBufferSize;
- U16 IconList[POC_PROFILE_POC_INLINE_NUM];
- U8 tempPortBuf[POC_MAX_PROFILE_PORT_LEN];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC, mmi_poc_exit_settings_profiles_option_edit_poc, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC, &inputBufferSize);
- SetParentHandler(0);
- if (inputBuffer == NULL)
- {
- memcpy(
- g_poc_cntx_p->profile_disp.prof_name,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].prof_name,
- POC_MAX_PROF_NAME_LEN);
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.disp_name,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_name,
- POC_MAX_DISP_LEN - 1);
- if (strlen((S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri))
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.uri,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri,
- POC_MAX_URI_LEN - 1);
- }
- else
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.uri,
- (S8*) POC_MMI_SIP_PREFIX,
- POC_MAX_URI_LEN - 1);
- }
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.password,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].password,
- POC_MAX_PASSWORD_LEN - 1);
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.poc_addr,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_addr,
- POC_PROXY_ADDR_LEN - 1);
- if (g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port == 0)
- {
- sprintf((char*)tempPortBuf, "");
- }
- else
- {
- sprintf((char*)tempPortBuf, "%d", g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port);
- }
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.poc_port,
- (S8*) tempPortBuf,
- POC_MAX_PROFILE_PORT_LEN - 1);
- if (strlen((S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr))
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.xdm_addr,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr,
- POC_PROXY_ADDR_LEN - 1);
- }
- else
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.xdm_addr,
- (S8*) POC_MMI_HTTP_PREFIX,
- POC_PROXY_ADDR_LEN - 1);
- }
- }
- mmi_poc_profile_fill_inline_struct();
- if (inputBuffer != NULL)
- {
- U8 tmp_profile_port_disp[POC_MAX_PROFILE_PORT_LEN * ENCODING_LENGTH];
- memcpy(tmp_profile_port_disp, g_poc_cntx_p->profile_disp.poc_port, sizeof(tmp_profile_port_disp));
- SetCategory57Data(wgui_inline_items, POC_PROFILE_POC_INLINE_NUM, inputBuffer);
- memcpy(g_poc_cntx_p->profile_disp.poc_port, tmp_profile_port_disp, sizeof(g_poc_cntx_p->profile_disp.poc_port));
- }
- if (guiBuffer == 0)
- {
- g_poc_cntx_p->inline_item_changed = MMI_FALSE;
- }
- if ((get_wgui_inline_list_menu_status() || g_poc_cntx_p->inline_item_changed) &&
- (GetInlineDoneFlag(guiBuffer) == 0))
- {
- SetInlineDoneFlag(guiBuffer);
- }
- for (i = 0; i < POC_PROFILE_POC_INLINE_NUM; i++)
- {
- if (i % 2)
- {
- IconList[i] = IMG_ID_POC_NOIMAGE;
- }
- else
- {
- IconList[i] = IMG_ID_POC_PROFILE_NAME + ImageLocation;
- ImageLocation++;
- }
- }
- ShowCategory57Screen(
- STR_GLOBAL_EDIT,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- POC_PROFILE_POC_INLINE_NUM,
- IconList,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_poc_entry_profile_edit_cfrm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_exit_settings_profiles_option_edit_poc
- * DESCRIPTION
- * exit function for edit poc screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_exit_settings_profiles_option_edit_poc(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_leading_zero(TRUE);
- GenericExitInlineScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC, mmi_poc_entry_settings_profiles_option_edit_poc);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_profile_edit_cfrm
- * DESCRIPTION
- * edit confirm screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_profile_edit_cfrm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_poc_profile_edit_nvram, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_poc_go_back_profile, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_go_back_profile
- * DESCRIPTION
- * go back profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_go_back_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- DeleteUptoScrID(SCR_ID_POC_SETTING_PROF_OPT_EDIT);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_profile_fill_inline_struct
- * DESCRIPTION
- * fill profile inline structure
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_profile_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 BufferSize = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_leading_zero(FALSE);
- SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_NAME), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_DISP_NAME), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_URI), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_PASS), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_SERVERADDR), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation(
- (wgui_inline_items + POC_PROFILE_POC_SERVERPORT),
- INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
- 0);
- SetInlineItemActivation((wgui_inline_items + POC_PROFILE_POC_XDMADDR), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_NAME_STR), (U8*) GetString(STR_ID_POC_PROFILE_NAME));
- SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_DISP_NAME_STR), (U8*) GetString(STR_ID_POC_NAME));
- SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_URI_STR), (U8*) GetString(STR_ID_POC_URI));
- SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_PASS_STR), (U8*) GetString(STR_ID_POC_PASSWORD));
- SetInlineItemCaption(
- (wgui_inline_items + POC_PROFILE_POC_SERVERADDR_STR),
- (U8*) GetString(STR_ID_POC_SERVER_ADDR));
- SetInlineItemCaption(
- (wgui_inline_items + POC_PROFILE_POC_SERVERPORT_STR),
- (U8*) GetString(STR_ID_POC_SERVER_PORT));
- SetInlineItemCaption((wgui_inline_items + POC_PROFILE_POC_XDMADDR_STR), (U8*) GetString(STR_ID_POC_XDM_ADDR));
- BufferSize = POC_MAX_PROF_NAME_LEN / 2;
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_PROFILE_POC_NAME),
- STR_ID_POC_PROFILE_NAME,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->profile_disp.prof_name),
- BufferSize,
- (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_NAME, mmi_poc_entry_full_line_edit);
- BufferSize = POC_MAX_DISP_LEN / 2;
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_PROFILE_POC_DISP_NAME),
- STR_ID_POC_NAME,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->profile_disp.disp_name),
- BufferSize,
- (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_DISP_NAME, mmi_poc_entry_full_line_edit);
- /* BufferSize = POC_MAX_URI_LEN ; */
- BufferSize = POC_MAX_INLINE_ADDR_LEN;
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_PROFILE_POC_URI),
- STR_ID_POC_URI,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->profile_disp.uri),
- BufferSize,
- (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_URI, mmi_poc_entry_full_line_edit);
- BufferSize = POC_MAX_PASSWORD_LEN;
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_PROFILE_POC_PASS),
- STR_ID_POC_PASSWORD,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->profile_disp.password),
- BufferSize,
- (INPUT_TYPE_ALPHANUMERIC_PASSWORD | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_PASS, mmi_poc_entry_full_line_edit);
- /* BufferSize = POC_PROXY_ADDR_LEN ; */
- BufferSize = POC_MAX_INLINE_ADDR_LEN;
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_PROFILE_POC_SERVERADDR),
- STR_ID_POC_SERVER_ADDR,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->profile_disp.poc_addr),
- BufferSize,
- (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_SERVERADDR, mmi_poc_entry_full_line_edit);
- BufferSize = POC_MAX_PROFILE_PORT_LEN;
- SetInlineItemTextEdit(
- (wgui_inline_items + POC_PROFILE_POC_SERVERPORT),
- (U8*) (g_poc_cntx_p->profile_disp.poc_port),
- BufferSize,
- INPUT_TYPE_NUMERIC);
- EnableInlineItemBoundary(wgui_inline_items + POC_PROFILE_POC_SERVERPORT);
- DisableInlineItemHighlight(wgui_inline_items + POC_PROFILE_POC_SERVERPORT);
- BufferSize = POC_PROXY_ADDR_LEN;
- /* BufferSize = POC_MAX_INLINE_ADDR_LEN ; */
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_PROFILE_POC_XDMADDR),
- STR_ID_POC_XDM_ADDR,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->profile_disp.xdm_addr),
- BufferSize,
- (INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(wgui_inline_items + POC_PROFILE_POC_XDMADDR, mmi_poc_entry_full_line_edit);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_full_line_edit
- * DESCRIPTION
- * entry inline editor full line editor
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_full_line_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
- SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(MENU_ID_POC_MAIN));
- SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_profile_edit_nvram
- * DESCRIPTION
- * profile edit nvram
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_profile_edit_nvram(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- S32 temp_proxy_port = 0;
- mmi_poc_profile_struct temp_profile;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&temp_profile, 0, sizeof(mmi_poc_profile_struct));
- if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC);
- return;
- }
- memcpy(temp_profile.prof_name, g_poc_cntx_p->profile_disp.prof_name, sizeof(temp_profile.prof_name));
- UnicodeNToAnsii((S8*) temp_profile.disp_name, (S8*) g_poc_cntx_p->profile_disp.disp_name, POC_MAX_DISP_LEN - 1);
- temp_profile.disp_charset = 0;
- UnicodeNToAnsii((S8*) temp_profile.uri, (S8*) g_poc_cntx_p->profile_disp.uri, POC_MAX_URI_LEN - 1);
- UnicodeNToAnsii((S8*) temp_profile.password, (S8*) g_poc_cntx_p->profile_disp.password, POC_MAX_PASSWORD_LEN - 1);
- UnicodeNToAnsii((S8*) temp_profile.poc_addr, (S8*) g_poc_cntx_p->profile_disp.poc_addr, POC_PROXY_ADDR_LEN - 1);
- temp_proxy_port = gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.poc_port);
- if (temp_proxy_port > 65535 || temp_proxy_port == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_INVALID_SETTING),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- else
- {
- temp_profile.poc_port = (U16) temp_proxy_port;
- }
- UnicodeNToAnsii((S8*) temp_profile.xdm_addr, (S8*) g_poc_cntx_p->profile_disp.xdm_addr, POC_PROXY_ADDR_LEN - 1);
- temp_profile.data_account = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].data_account;
- temp_profile.use_proxy = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].use_proxy;
- memcpy(
- temp_profile.proxy_username,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_username,
- sizeof(temp_profile.proxy_username));
- memcpy(
- temp_profile.proxy_password,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_password,
- sizeof(temp_profile.proxy_password));
- memcpy(
- temp_profile.proxy_ip,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip,
- sizeof(temp_profile.proxy_ip));
- temp_profile.proxy_port = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port;
- if (temp_profile.uri[0] == 0 || temp_profile.poc_addr[0] == 0 || temp_profile.poc_port > 65535 ||
- temp_profile.xdm_addr[0] == 0)
- {
- DisplayPopup((PU8) GetString(STR_ID_POC_NULL_STR_ERR), IMG_GLOBAL_UNFINISHED, 1, CS_NOTIFYDURATION, ERROR_TONE);
- }
- else
- {
- if (WriteRecord(
- NVRAM_EF_POC_PROFILE_LID,
- (U8) (g_poc_cntx_p->profile_selected + 1),
- &temp_profile,
- NVRAM_MAX_POC_PROFILE_SIZE,
- &error) < NVRAM_MAX_POC_PROFILE_SIZE)
- {
- ASSERT(0);
- }
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].prof_name,
- temp_profile.prof_name,
- sizeof(U8) * POC_MAX_PROF_NAME_LEN);
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_charset = temp_profile.disp_charset;
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_name,
- temp_profile.disp_name,
- sizeof(U8) * POC_MAX_DISP_LEN);
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri,
- temp_profile.uri,
- sizeof(U8) * POC_MAX_URI_LEN);
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].password,
- temp_profile.password,
- sizeof(U8) * POC_MAX_PASSWORD_LEN);
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_addr,
- temp_profile.poc_addr,
- sizeof(U8) * POC_PROXY_ADDR_LEN);
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port = temp_profile.poc_port;
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr,
- temp_profile.xdm_addr,
- sizeof(U8) * POC_PROXY_ADDR_LEN);
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_POC);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_settings_profiles_option_edit_conn
- * DESCRIPTION
- * edit connection settings screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_settings_profiles_option_edit_conn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U16 inputBufferSize;
- U16 icon_list[] =
- {
- IMG_GLOBAL_L1, 0,
- IMG_GLOBAL_L2, 0,
- IMG_GLOBAL_L3, 0,
- IMG_GLOBAL_L4, 0,
- IMG_GLOBAL_L5, 0,
- IMG_GLOBAL_L6, 0
- };
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN, mmi_poc_exit_settings_profiles_option_edit_conn, NULL, NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN, &inputBufferSize);
- if (inputBuffer == NULL)
- {
- g_poc_cntx_p->profile_disp.data_account =
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].data_account;
- g_poc_cntx_p->profile_disp.use_proxy = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].use_proxy;
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.proxy_username,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_username,
- XDM_MAX_PROXY_USERNAME_LEN);
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->profile_disp.proxy_password,
- (S8*) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_password,
- XDM_MAX_PROXY_PASS_LEN);
- if (g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[0] == 0)
- {
- pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[0], (S8*) g_poc_zero_ip);
- pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[1], (S8*) g_poc_zero_ip);
- pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[2], (S8*) g_poc_zero_ip);
- pfnUnicodeStrcpy((S8*) g_poc_cntx_p->profile_disp.proxy_ip[3], (S8*) g_poc_zero_ip);
- }
- else
- {
- gui_itoa(
- (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[0],
- (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[0],
- 10);
- gui_itoa(
- (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[1],
- (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[1],
- 10);
- gui_itoa(
- (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[2],
- (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[2],
- 10);
- gui_itoa(
- (S32) g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip[3],
- (UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[3],
- 10);
- }
- if (g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port == 0)
- {
- memset(g_poc_cntx_p->profile_disp.proxy_port, 0, sizeof(g_poc_cntx_p->profile_disp.proxy_port));
- }
- else
- {
- gui_itoa(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port,
- (UI_string_type) g_poc_cntx_p->profile_disp.proxy_port,
- 10);
- }
- mmi_dtcnt_get_account_name(
- g_poc_cntx_p->profile_disp.data_account,
- (S8*) g_poc_cntx_p->profile_disp.dt_acct_name,
- MAX_DATA_ACCOUNT_NAME_LEN);
- }
- mmi_poc_prof_conn_fill_inline_struct();
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, POC_PROFILE_CONN_INLINE_NUM, inputBuffer);
- }
- if (guiBuffer == 0)
- {
- g_poc_cntx_p->inline_item_changed = MMI_FALSE;
- }
- if ((get_wgui_inline_list_menu_status() || g_poc_cntx_p->inline_item_changed) &&
- (GetInlineDoneFlag(guiBuffer) == 0))
- {
- SetInlineDoneFlag(guiBuffer);
- }
- ShowCategory57Screen(
- STR_ID_POC_CONNECTION_SETTINGS,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_BACK,
- STR_GLOBAL_DONE,
- IMG_GLOBAL_BACK,
- POC_PROFILE_CONN_INLINE_NUM,
- (U16*) icon_list,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_poc_entry_profile_edit_conn_cfrm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_exit_settings_profiles_option_edit_conn
- * DESCRIPTION
- * Exit function for inlnine editor screen of Connection Setting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_exit_settings_profiles_option_edit_conn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_leading_zero(TRUE);
- GenericExitInlineScreen(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN, mmi_poc_entry_settings_profiles_option_edit_conn);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_prof_conn_fill_inline_struct
- * DESCRIPTION
- * Fill inline editor structure of profile.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_prof_conn_fill_inline_struct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Yes/No */
- g_poc_cntx_p->profile_disp.yes_no_list[0] = (U8*) GetString(STR_GLOBAL_NO);
- g_poc_cntx_p->profile_disp.yes_no_list[1] = (U8*) GetString(STR_GLOBAL_YES);
- set_leading_zero(FALSE);
- /* Data Account */
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT_STR], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(
- &wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT_STR],
- (U8*) GetString(STR_ID_POC_DATA_ACCOUNT));
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemImageText(
- &wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT],
- (U8*) g_poc_cntx_p->profile_disp.dt_acct_name,
- (PU8) NULL,
- NULL,
- NULL,
- MAX_DATA_ACCOUNT_NAME_LEN,
- 0,
- 0,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(
- &wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT],
- mmi_poc_prof_list_data_acct);
- ShowAsControl(&wgui_inline_items[POC_PROFILE_CONN_DATA_ACCOUNT]);
- /* Use proxy */
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USE_PROXY_STR], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_USE_PROXY_STR], (U8*) GetString(STR_ID_POC_USE_PROXY));
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USE_PROXY], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemSelect(
- &wgui_inline_items[POC_PROFILE_CONN_USE_PROXY],
- 2,
- g_poc_cntx_p->profile_disp.yes_no_list,
- &g_poc_cntx_p->profile_disp.use_proxy);
- /* Proxy server */
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYADDR_STR], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_PROXYADDR_STR], (U8*) GetString(STR_ID_POC_PROXY_ADDR));
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYRADDR], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemIP4(
- &wgui_inline_items[POC_PROFILE_CONN_PROXYRADDR],
- (U8*) g_poc_cntx_p->profile_disp.proxy_ip[0],
- (U8*) g_poc_cntx_p->profile_disp.proxy_ip[1],
- (U8*) g_poc_cntx_p->profile_disp.proxy_ip[2],
- (U8*) g_poc_cntx_p->profile_disp.proxy_ip[3],
- mmi_poc_prof_ip_addr_callback);
- /* Proxy port */
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT_STR], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT_STR], (U8*) GetString(STR_ID_POC_PROXY_PORT));
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemTextEdit(
- &wgui_inline_items[POC_PROFILE_CONN_PROXYPORT],
- (U8*) (g_poc_cntx_p->profile_disp.proxy_port),
- POC_MAX_PROFILE_PORT_LEN,
- INPUT_TYPE_NUMERIC);
- EnableInlineItemBoundary(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT]);
- DisableInlineItemHighlight(&wgui_inline_items[POC_PROFILE_CONN_PROXYPORT]);
- /* Proxy User Name */
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USERNAME_STR], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(
- &wgui_inline_items[POC_PROFILE_CONN_USERNAME_STR],
- (U8*) GetString(STR_ID_POC_PROXY_USERNAME));
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_USERNAME], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- &wgui_inline_items[POC_PROFILE_CONN_USERNAME],
- STR_ID_POC_PROXY_USERNAME,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) g_poc_cntx_p->profile_disp.proxy_username,
- XDM_MAX_PROXY_USERNAME_LEN,
- (INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[POC_PROFILE_CONN_USERNAME], mmi_poc_entry_full_line_edit);
- /* Proxy Password */
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PASS_STR], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption(&wgui_inline_items[POC_PROFILE_CONN_PASS_STR], (U8*) GetString(STR_ID_POC_PASSWORD));
- SetInlineItemActivation(&wgui_inline_items[POC_PROFILE_CONN_PASS], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemFullScreenEdit_ext(
- &wgui_inline_items[POC_PROFILE_CONN_PASS],
- STR_ID_POC_PROXY_PASSWORD,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) g_poc_cntx_p->profile_disp.proxy_password,
- XDM_MAX_PROXY_PASS_LEN,
- (INPUT_TYPE_USE_ONLY_ENGLISH_MODES | INPUT_TYPE_ALPHANUMERIC_PASSWORD),
- INPUT_TYPE_EXT_NO_SHOW_NEW_LINE_SYMBOL);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[POC_PROFILE_CONN_PASS], mmi_poc_entry_full_line_edit);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_prof_list_data_acct
- * DESCRIPTION
- * LSK handler of Data Account item in Profile Setting inline editor screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_prof_list_data_acct(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_dtcnt_select_account(
- mmi_poc_prof_gprs_dt_callback,
- MENU_ID_POC_MAIN,
- DATA_ACCOUNT_BEARER_GPRS | DATA_ACCOUNT_BEARER_WIFI);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_prof_gprs_dt_callback
- * DESCRIPTION
- * Callback function for GPRS Data Account
- * PARAMETERS
- * index [IN] Highlight index of selected account
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_prof_gprs_dt_callback(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->profile_disp.data_account = (U8) index;
- mmi_dtcnt_get_account_name(
- g_poc_cntx_p->profile_disp.data_account,
- (S8*) g_poc_cntx_p->profile_disp.dt_acct_name,
- MAX_DATA_ACCOUNT_NAME_LEN);
- DeleteUptoScrID(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_prof_ip_addr_callback
- * DESCRIPTION
- * Callback function for IP address editor in inline editor screen
- * PARAMETERS
- * string_buffer [?]
- * IP1 [?]
- * IP2 [?]
- * IP3 [?]
- * IP4 [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_prof_ip_addr_callback(U8 *string_buffer, U8 *IP1, U8 *IP2, U8 *IP3, U8 *IP4)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 Point[4];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AnsiiToUnicodeString((S8*) Point, (S8*) ".");
- pfnUnicodeStrcpy((PS8) string_buffer, (PS8) IP1);
- pfnUnicodeStrcat((PS8) string_buffer, (PS8) Point);
- pfnUnicodeStrcat((PS8) string_buffer, (PS8) IP2);
- pfnUnicodeStrcat((PS8) string_buffer, (PS8) Point);
- pfnUnicodeStrcat((PS8) string_buffer, (PS8) IP3);
- pfnUnicodeStrcat((PS8) string_buffer, (PS8) Point);
- pfnUnicodeStrcat((PS8) string_buffer, (PS8) IP4);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_profile_edit_conn_cfrm
- * DESCRIPTION
- * edit connection screen confirm
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_profile_edit_conn_cfrm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_SAVE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_poc_profile_edit_conn_nvram, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_poc_go_back_profile, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_profile_edit_conn_nvram
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_profile_edit_conn_nvram(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- S32 temp_proxy_port = 0;
- mmi_poc_profile_struct temp_profile;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&temp_profile, 0, sizeof(mmi_poc_profile_struct));
- if (g_poc_cntx_p->curr_reg_state != POC_REG_NONE)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_DEREGISTER_FIRST),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
- return;
- }
- /* set existing values */
- memcpy(
- temp_profile.prof_name,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].prof_name,
- sizeof(temp_profile.prof_name));
- memcpy(
- temp_profile.disp_name,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].disp_name,
- sizeof(temp_profile.prof_name));
- temp_profile.disp_charset = 0;
- memcpy(temp_profile.uri, g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].uri, sizeof(temp_profile.uri));
- memcpy(
- temp_profile.password,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].password,
- sizeof(temp_profile.password));
- memcpy(
- temp_profile.poc_addr,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_addr,
- sizeof(temp_profile.poc_addr));
- temp_profile.poc_port = g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].poc_port;
- memcpy(
- temp_profile.xdm_addr,
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].xdm_addr,
- sizeof(temp_profile.xdm_addr));
- /* set new values from display buffer */
- temp_profile.data_account = g_poc_cntx_p->profile_disp.data_account;
- temp_profile.use_proxy = g_poc_cntx_p->profile_disp.use_proxy;
- UnicodeNToAnsii(
- (S8*) temp_profile.proxy_username,
- (S8*) g_poc_cntx_p->profile_disp.proxy_username,
- XDM_MAX_PROXY_USERNAME_LEN - 1);
- UnicodeNToAnsii(
- (S8*) temp_profile.proxy_password,
- (S8*) g_poc_cntx_p->profile_disp.proxy_password,
- XDM_MAX_PROXY_PASS_LEN - 1);
- temp_profile.proxy_ip[0] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[0]);
- temp_profile.proxy_ip[1] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[1]);
- temp_profile.proxy_ip[2] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[2]);
- temp_profile.proxy_ip[3] = (U8) gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_ip[3]);
- temp_proxy_port = gui_atoi((UI_string_type) g_poc_cntx_p->profile_disp.proxy_port);
- if (temp_proxy_port > 65535)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_INVALID_SETTING),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- else
- {
- temp_profile.proxy_port = (U16) temp_proxy_port;
- }
- if (temp_profile.use_proxy == MMI_TRUE && temp_profile.proxy_port == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_ERR_INVALID_SETTING),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- if (temp_profile.use_proxy == MMI_TRUE && temp_profile.proxy_ip[0] == 0)
- {
- DisplayPopup((PU8) GetString(STR_ID_POC_NULL_STR_ERR), IMG_GLOBAL_UNFINISHED, 1, CS_NOTIFYDURATION, ERROR_TONE);
- return;
- }
- else
- {
- if (WriteRecord(
- NVRAM_EF_POC_PROFILE_LID,
- (U8) (g_poc_cntx_p->profile_selected + 1),
- &temp_profile,
- NVRAM_MAX_POC_PROFILE_SIZE,
- &error) < NVRAM_MAX_POC_PROFILE_SIZE)
- {
- ASSERT(0);
- }
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].data_account = temp_profile.data_account;
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].use_proxy = temp_profile.use_proxy;
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_username,
- temp_profile.proxy_username,
- sizeof(U8) * XDM_MAX_PROXY_USERNAME_LEN);
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_password,
- temp_profile.proxy_password,
- sizeof(U8) * XDM_MAX_PROXY_PASS_LEN);
- memcpy(
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_ip,
- temp_profile.proxy_ip,
- sizeof(U8) * XDM_MAX_IP_LEN);
- g_poc_cntx_p->profile_list[g_poc_cntx_p->profile_selected].proxy_port = temp_profile.proxy_port;
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_SETTING_PROF_OPT_EDIT_CONN);
- }
- }
- #endif /* __MMI_POC__ */