PoCGroups.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:363k
源码类别:
MTK
开发平台:
C/C++
- (S8*) g_poc_cntx_p->contact_list[i].entries[new_idx].display_name,
- (S8*) g_poc_cntx_p->contact_entry_disp.display_name,
- (U32) POC_MAX_DISP_LEN - 1);
- g_poc_cntx_p->contact_list[i].entries[new_idx].allow_invite = g_poc_cntx_p->contact_entry_disp.allow_invite;
- memcpy(
- &g_poc_cntx_p->contact_list[i].entries[new_idx].auth_rule,
- &g_poc_cntx_p->contact_entry_disp.auth_rule,
- sizeof(poc_pres_authrule_struct));
- g_poc_cntx_p->contact_list[i].entries[new_idx].sub_pres = g_poc_cntx_p->contact_entry_disp.sub_pres;
- if ((g_poc_cntx_p->contact_list[i].entries[new_idx].sub_pres == POC_SETTING_TRUE) &&
- (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE))
- {
- mmi_poc_entry_update_subscribe_req(
- POC_SUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[i].entries[new_idx].uri);
- SetProtocolEventHandler(mmi_poc_update_subscribe_success_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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->contact_list[i].no_entries++;
- }
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_update_group_entry_rsp
- * DESCRIPTION
- * update group entry response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_update_group_entry_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_update_group_entry_rsp_struct *msgRsp;
- mmi_poc_contact_list_disp *cont;
- U8 i, new_idx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_update_group_entry_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_UPDATE_GROUP_ENTRY_RSP);
- if (msgRsp->result == POC_OK)
- {
- if (g_poc_cntx_p->curr_contact_op == XDM_PUT_REPLACE)
- {
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- if (msgRsp->xdm_item & POC_XDM_GL_PRESENT)
- {
- memset(
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- 0,
- sizeof(g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- (S8*) g_poc_cntx_p->contact_entry_disp.uri,
- (U32) POC_MAX_URI_LEN - 1);
- memset(
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name,
- 0,
- sizeof(g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name,
- (S8*) g_poc_cntx_p->contact_entry_disp.display_name,
- (U32) POC_MAX_DISP_LEN - 1);
- }
- if (msgRsp->xdm_item & POC_XDM_AL_PRESENT)
- {
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].allow_invite =
- g_poc_cntx_p->contact_entry_disp.allow_invite;
- }
- if (msgRsp->xdm_item & POC_XDM_AR_PRESENT)
- {
- memcpy(
- &g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].auth_rule,
- &g_poc_cntx_p->contact_entry_disp.auth_rule,
- sizeof(poc_pres_authrule_struct));
- }
- if (msgRsp->xdm_item & POC_XDM_RLS_PRESENT)
- {
- if (g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].sub_pres !=
- g_poc_cntx_p->contact_entry_disp.sub_pres)
- {
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].sub_pres =
- g_poc_cntx_p->contact_entry_disp.sub_pres;
- #ifdef __POC_NON_RLS__
- if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
- {
- if (g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].sub_pres ==
- POC_SETTING_TRUE)
- {
- mmi_poc_entry_update_subscribe_req(
- POC_SUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont-> entry_id]. uri);
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_partial_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- }
- else if (g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].sub_pres ==
- POC_SETTING_FALSE)
- {
- mmi_poc_entry_update_subscribe_req(
- POC_UNSUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont-> entry_id]. uri);
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_partial_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- #else /* __POC_NON_RLS__ */
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- #endif /* __POC_NON_RLS__ */
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- else
- {
- #ifdef __MMI_POC_ALWAYS_CREATE_MTK_CONTACT__
- for (i = 0; i < MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM; i++)
- {
- if (g_poc_cntx_p->contact_list[i].valid == MMI_TRUE)
- {
- if (!strcmp((S8*) g_poc_cntx_p->contact_list[i].list_name, (S8*) POC_MTK_DEFAULT_CONTACT))
- {
- break;
- }
- }
- }
- ASSERT(i != MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM);
- #else /* __MMI_POC_ALWAYS_CREATE_MTK_CONTACT__ */
- i = g_poc_cntx_p->update_grp_idx;
- #endif /* __MMI_POC_ALWAYS_CREATE_MTK_CONTACT__ */
- new_idx = g_poc_cntx_p->contact_list[i].no_entries;
- if (msgRsp->xdm_item & POC_XDM_GL_PRESENT)
- {
- memset(
- g_poc_cntx_p->contact_list[i].entries[new_idx].uri,
- 0,
- sizeof(g_poc_cntx_p->contact_list[i].entries[new_idx].uri));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[i].entries[new_idx].uri,
- (S8*) g_poc_cntx_p->contact_entry_disp.uri,
- (U32) POC_MAX_URI_LEN - 1);
- memset(
- g_poc_cntx_p->contact_list[i].entries[new_idx].display_name,
- 0,
- sizeof(g_poc_cntx_p->contact_list[i].entries[new_idx].display_name));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[i].entries[new_idx].display_name,
- (S8*) g_poc_cntx_p->contact_entry_disp.display_name,
- (U32) POC_MAX_DISP_LEN - 1);
- }
- if (msgRsp->xdm_item & POC_XDM_AL_PRESENT)
- {
- g_poc_cntx_p->contact_list[i].entries[new_idx].allow_invite =
- g_poc_cntx_p->contact_entry_disp.allow_invite;
- }
- if (msgRsp->xdm_item & POC_XDM_AR_PRESENT)
- {
- memcpy(
- &g_poc_cntx_p->contact_list[i].entries[new_idx].auth_rule,
- &g_poc_cntx_p->contact_entry_disp.auth_rule,
- sizeof(poc_pres_authrule_struct));
- }
- if (msgRsp->xdm_item & POC_XDM_RLS_PRESENT)
- {
- g_poc_cntx_p->contact_list[i].entries[new_idx].sub_pres = g_poc_cntx_p->contact_entry_disp.sub_pres;
- #ifdef __POC_NON_RLS__
- if (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE)
- {
- if (g_poc_cntx_p->contact_list[i].entries[new_idx].sub_pres == POC_SETTING_TRUE)
- {
- mmi_poc_entry_update_subscribe_req(
- POC_SUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[i].entries[new_idx].uri);
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_partial_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- #else /* __POC_NON_RLS__ */
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- #endif /* __POC_NON_RLS__ */
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == g_poc_cntx_p->session_xdm)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- g_poc_cntx_p->contact_list[i].no_entries++;
- }
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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_update_subscribe_success_rsp
- * DESCRIPTION
- * update subscribe success response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_update_subscribe_success_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_update_subscribe_partial_success_rsp
- * DESCRIPTION
- * update subscribe partial success response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_update_subscribe_partial_success_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_create_group_list_req
- * DESCRIPTION
- * create group list request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_create_group_list_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_create_group_list_req_struct *myMsgPtr;
- U8 new_idx, contact_idx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- myMsgPtr = (poc_create_group_list_req_struct*) OslConstructDataPtr(sizeof(poc_create_group_list_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_create_group_list_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- strncpy((char*)myMsgPtr->list_name, (char*)POC_MTK_DEFAULT_CONTACT, POC_MAX_DISP_LEN - 1);
- myMsgPtr->entry.xdm_item = 0x0F;
- myMsgPtr->entry.allow_invite = g_poc_cntx_p->contact_entry_disp.allow_invite;
- myMsgPtr->entry.sub_pres = g_poc_cntx_p->contact_entry_disp.sub_pres;
- if (g_poc_cntx_p->contact_entry_disp.auth_rule.sub_handling != POC_MMI_SUB_EMPTY)
- {
- myMsgPtr->entry.auth_rule.sub_handling = g_poc_cntx_p->contact_entry_disp.auth_rule.sub_handling - 1;
- }
- myMsgPtr->entry.auth_rule.pres_attr = g_poc_cntx_p->contact_entry_disp.auth_rule.pres_attr;
- UnicodeNToAnsii((S8*) myMsgPtr->entry.uri, (S8*) g_poc_cntx_p->contact_entry_disp.uri, POC_MAX_URI_LEN - 1);
- UnicodeNToAnsii(
- (S8*) myMsgPtr->entry.disp_name,
- (S8*) g_poc_cntx_p->contact_entry_disp.display_name,
- POC_MAX_DISP_LEN - 1);
- if (myMsgPtr->entry.uri[0] == 0 || !strstr((S8*) myMsgPtr->entry.uri, (S8*) "@"))
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_NULL_STR_ERR),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- SetProtocolEventHandler(mmi_poc_create_group_list_rsp, MSG_ID_POC_CREATE_GROUP_LIST_RSP);
- g_poc_cntx_p->progressing.contact = MMI_TRUE;
- mmi_poc_entry_progressing();
- DeleteUptoScrID(SCR_ID_POC_CONTACT);
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_CREATE_GROUP_LIST_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- else
- {
- kal_uint8 temp_uri[POC_MAX_URI_LEN];
- memset((S8*) temp_uri, 0, sizeof(temp_uri));
- UnicodeNToAnsii((S8*) temp_uri, (S8*) g_poc_cntx_p->contact_entry_disp.uri, POC_MAX_URI_LEN - 1);
- if (temp_uri[0] == 0 || !strstr((S8*) temp_uri, (S8*) "@"))
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_POC_NULL_STR_ERR),
- IMG_GLOBAL_UNFINISHED,
- 1,
- CS_NOTIFYDURATION,
- ERROR_TONE);
- return;
- }
- mmi_poc_entry_progressing();
- DeleteUptoScrID(SCR_ID_POC_CONTACT);
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT);
- for (contact_idx = 0; contact_idx < MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM; contact_idx++)
- {
- if (g_poc_cntx_p->contact_list[contact_idx].valid == MMI_FALSE)
- {
- break;
- }
- }
- g_poc_cntx_p->contact_list[contact_idx].valid = MMI_TRUE;
- strncpy(
- (S8*) g_poc_cntx_p->contact_list[contact_idx].list_name,
- (S8*) POC_MTK_DEFAULT_CONTACT,
- POC_MAX_DISP_LEN - 1);
- g_poc_cntx_p->contact_list[contact_idx].no_entries = 1;
- new_idx = 0;
- memset(
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri,
- 0,
- sizeof(g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri,
- (S8*) g_poc_cntx_p->contact_entry_disp.uri,
- (U32) POC_MAX_URI_LEN - 1);
- memset(
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].display_name,
- 0,
- sizeof(g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].display_name));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].display_name,
- (S8*) g_poc_cntx_p->contact_entry_disp.display_name,
- (U32) POC_MAX_DISP_LEN - 1);
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].allow_invite =
- g_poc_cntx_p->contact_entry_disp.allow_invite;
- memcpy(
- &g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].auth_rule,
- &g_poc_cntx_p->contact_entry_disp.auth_rule,
- sizeof(poc_pres_authrule_struct));
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].sub_pres = g_poc_cntx_p->contact_entry_disp.sub_pres;
- if ((g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].sub_pres == POC_SETTING_TRUE) &&
- (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE))
- {
- mmi_poc_entry_update_subscribe_req(
- POC_SUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri);
- SetProtocolEventHandler(mmi_poc_update_subscribe_success_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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->contact_local_updated = MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_create_group_list_rsp
- * DESCRIPTION
- * create group list response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_create_group_list_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_create_group_list_rsp_struct *msgRsp;
- U8 new_idx, contact_idx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_create_group_list_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_CREATE_GROUP_LIST_RSP);
- if (msgRsp->result == POC_OK)
- {
- #ifndef __POC_NON_RLS__
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == 0x0F)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- #endif /* __POC_NON_RLS__ */
- for (contact_idx = 0; contact_idx < MAX_POC_GROUP_FILE_NUM * MAX_POC_GROUPS_PER_FILE_NUM; contact_idx++)
- {
- if (g_poc_cntx_p->contact_list[contact_idx].valid == MMI_FALSE)
- {
- break;
- }
- }
- g_poc_cntx_p->contact_list[contact_idx].valid = MMI_TRUE;
- strncpy(
- (S8*) g_poc_cntx_p->contact_list[contact_idx].list_name,
- (S8*) POC_MTK_DEFAULT_CONTACT,
- POC_MAX_DISP_LEN - 1);
- g_poc_cntx_p->contact_list[contact_idx].no_entries = 1;
- new_idx = 0;
- if (msgRsp->xdm_item & POC_XDM_GL_PRESENT)
- {
- memset(
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri,
- 0,
- sizeof(g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri,
- (S8*) g_poc_cntx_p->contact_entry_disp.uri,
- (U32) POC_MAX_URI_LEN - 1);
- memset(
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].display_name,
- 0,
- sizeof(g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].display_name));
- UnicodeNToAnsii(
- (S8*) g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].display_name,
- (S8*) g_poc_cntx_p->contact_entry_disp.display_name,
- (U32) POC_MAX_DISP_LEN - 1);
- }
- if (msgRsp->xdm_item & POC_XDM_AL_PRESENT)
- {
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].allow_invite =
- g_poc_cntx_p->contact_entry_disp.allow_invite;
- }
- if (msgRsp->xdm_item & POC_XDM_AR_PRESENT)
- {
- memcpy(
- &g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].auth_rule,
- &g_poc_cntx_p->contact_entry_disp.auth_rule,
- sizeof(poc_pres_authrule_struct));
- }
- if (msgRsp->xdm_item & POC_XDM_RLS_PRESENT)
- {
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].sub_pres =
- g_poc_cntx_p->contact_entry_disp.sub_pres;
- #ifdef __POC_NON_RLS__
- if ((g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].sub_pres == POC_SETTING_TRUE) &&
- (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE))
- {
- mmi_poc_entry_update_subscribe_req(
- POC_SUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[contact_idx].entries[new_idx].uri);
- if (msgRsp->xdm_item == 0x0F)
- {
- SetProtocolEventHandler(mmi_poc_update_subscribe_success_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_partial_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == 0x0F)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- #endif /* __POC_NON_RLS__ */
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == 0x0F)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->cause == POC_GRP_CAUSE_MAX_NUM_REACHES)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_MAXIMUM_REACHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- else
- {
- 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_update_subscribe_req
- * DESCRIPTION
- * update subscribe request
- * PARAMETERS
- * op [IN]
- * uri [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_update_subscribe_req(U8 op, U8 *uri)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_subscribe_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_presence_subscribe_req_struct*) OslConstructDataPtr(sizeof(poc_presence_subscribe_req_struct));
- myMsgPtr->action = op;
- myMsgPtr->use_presence_list = MMI_FALSE;
- memcpy(myMsgPtr->uri, uri, POC_MAX_URI_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_SUBSCRIBE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_contact_opt_settings_delete_cfrm
- * DESCRIPTION
- * entry delete confirm screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_contact_opt_settings_delete_cfrm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_DELETE),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_poc_contact_send_delete, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_poc_go_back_contact_list, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_contact_send_delete
- * DESCRIPTION
- * send entry delete
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_contact_send_delete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_poc_entry_progressing();
- DeleteUptoScrID(SCR_ID_POC_CONTACT);
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT);
- mmi_poc_del_group_entry_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_del_group_entry_req
- * DESCRIPTION
- * entry delete request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_del_group_entry_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_del_group_entry_req_struct *myMsgPtr;
- mmi_poc_contact_list_disp *cont;
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->curr_use_xdm_mode == MMI_TRUE)
- {
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- g_poc_cntx_p->progressing.contact = MMI_TRUE;
- myMsgPtr = (poc_del_group_entry_req_struct*) OslConstructDataPtr(sizeof(poc_del_group_entry_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_del_group_entry_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- strncpy(
- (char*)myMsgPtr->list_name,
- (char*)g_poc_cntx_p->contact_list[cont->group_id].list_name,
- POC_MAX_DISP_LEN - 1);
- strncpy(
- (char*)myMsgPtr->uri,
- (char*)g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- POC_MAX_URI_LEN - 1);
- myMsgPtr->xdm_item = 0x0F;
- SetProtocolEventHandler(mmi_poc_del_group_entry_rsp, MSG_ID_POC_DEL_GROUP_ENTRY_RSP);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_DEL_GROUP_ENTRY_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- else
- {
- #ifndef __POC_NON_RLS__
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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);
- #endif /* __POC_NON_RLS__ */
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- #ifdef __POC_NON_RLS__
- if ((g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].sub_pres == POC_SETTING_TRUE) &&
- (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE))
- {
- mmi_poc_entry_update_subscribe_req(
- POC_UNSUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri);
- SetProtocolEventHandler(mmi_poc_update_subscribe_success_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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);
- }
- #endif /* __POC_NON_RLS__ */
- i = g_poc_cntx_p->contact_list[cont->group_id].no_entries - 1;
- memcpy(
- &g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id],
- &g_poc_cntx_p->contact_list[cont->group_id].entries[i],
- sizeof(mmi_poc_contact_entry_struct));
- memset(&g_poc_cntx_p->contact_list[cont->group_id].entries[i], 0, sizeof(mmi_poc_contact_entry_struct));
- if (g_poc_cntx_p->contact_list[cont->group_id].no_entries > 0)
- {
- g_poc_cntx_p->contact_list[cont->group_id].no_entries--;
- }
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_del_group_entry_rsp
- * DESCRIPTION
- * delete contact entry response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_del_group_entry_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_del_group_entry_rsp_struct *msgRsp;
- U8 i;
- mmi_poc_contact_list_disp *cont;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_del_group_entry_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_DEL_GROUP_ENTRY_RSP);
- if (msgRsp->result == POC_OK)
- {
- #ifndef __POC_NON_RLS__
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->xdm_item == 0x0F)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- #endif /* __POC_NON_RLS__ */
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- #ifdef __POC_NON_RLS__
- if ((g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].sub_pres == POC_SETTING_TRUE) &&
- (g_poc_cntx_p->curr_use_pres_mode == MMI_TRUE))
- {
- mmi_poc_entry_update_subscribe_req(
- POC_UNSUBSCRIBE_ACTION,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri);
- if (msgRsp->xdm_item == 0x0F)
- {
- SetProtocolEventHandler(mmi_poc_update_subscribe_success_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- else
- {
- SetProtocolEventHandler(
- mmi_poc_update_subscribe_partial_success_rsp,
- MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- if (msgRsp->xdm_item == 0x0F)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_REG_PARTIAL_SUCCESS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- #endif /* __POC_NON_RLS__ */
- i = g_poc_cntx_p->contact_list[cont->group_id].no_entries - 1;
- memcpy(
- &g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id],
- &g_poc_cntx_p->contact_list[cont->group_id].entries[i],
- sizeof(mmi_poc_contact_entry_struct));
- memset(&g_poc_cntx_p->contact_list[cont->group_id].entries[i], 0, sizeof(mmi_poc_contact_entry_struct));
- if (g_poc_cntx_p->contact_list[cont->group_id].no_entries > 0)
- {
- g_poc_cntx_p->contact_list[cont->group_id].no_entries--;
- }
- g_poc_cntx_p->contact_local_updated = MMI_FALSE;
- }
- else
- {
- g_poc_cntx_p->progressing.contact = MMI_FALSE;
- 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_contact_opt_settings_info
- * DESCRIPTION
- * entry settings info screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_contact_opt_settings_info(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nNumofItem;
- U8 *guiBuffer;
- U8 *PoCHint[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_CONTACT_ENTRY_INFO, NULL, mmi_poc_entry_contact_opt_settings_info, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_CONTACT_ENTRY_INFO);
- nNumofItem = GetNumOfChild(MENU_ID_POC_CONTACT_OPT_SETTINGS_INFO);
- GetSequenceStringIds(MENU_ID_POC_CONTACT_OPT_SETTINGS_INFO, nStrItemList);
- SetParentHandler(MENU_ID_POC_CONTACT_OPT_SETTINGS_INFO);
- ConstructHintsList(MENU_ID_POC_CONTACT_OPT_SETTINGS_INFO, PoCHint);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_ID_POC_MAIN,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- 0,
- 0,
- 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_hint_entry_activity
- * DESCRIPTION
- * hint handler of PoC menu
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_hint_entry_activity(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_poc_contact_list_disp *cont;
- mmi_poc_presence_struct *pres;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- pres = &g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].pres;
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (pres->person.activity_present == MMI_TRUE)
- {
- if (pres->person.activity <= POC_ACTIVITY_BUSY)
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString((U16) (STR_ID_POC_AWAY + pres->person.activity)));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT));
- }
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_EMPTY));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_hint_entry_mood
- * DESCRIPTION
- * hint handler of PoC menu
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_hint_entry_mood(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_poc_contact_list_disp *cont;
- mmi_poc_presence_struct *pres;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- pres = &g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].pres;
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (pres->person.mood_present == MMI_TRUE)
- {
- switch (pres->person.mood)
- {
- case POC_MOOD_HAPPY:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_ID_POC_HAPPY));
- break;
- case POC_MOOD_BORED:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_ID_POC_BORED));
- break;
- case POC_MOOD_DEPRESSED:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_ID_POC_DEPRESSED));
- break;
- default:
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT));
- break;
- }
- }
- else
- {
- pfnUnicodeStrcpy((S8*) hintData[index], (PS8) GetString(STR_GLOBAL_EMPTY));
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_contact_opt_send_alert
- * DESCRIPTION
- * send alert screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_contact_opt_send_alert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->progressing.alert == 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->curr_privacy_mode)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_TURN_OFF_PRIVACY_MODE),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- EntryNewScreen(SCR_ID_POC_CONTACT_ALERT, NULL, mmi_poc_entry_contact_opt_send_alert, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_CONTACT_ALERT);
- if (guiBuffer == NULL)
- {
- memset(g_poc_cntx_p->alert_text_buf, 0, sizeof(g_poc_cntx_p->alert_text_buf));
- }
- ShowCategory5Screen(
- STR_ID_POC_ALERT_TEXT,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES,
- (PU8) g_poc_cntx_p->alert_text_buf,
- MMI_POC_MAX_MSG_LEN,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_send_personal_alert_req, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_send_personal_alert_req
- * DESCRIPTION
- * send alert request
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_send_personal_alert_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_send_personal_alert_req_struct *myMsgPtr;
- mmi_poc_contact_list_disp *cont;
- U8 message_buf[MMI_POC_MAX_MSG_LEN];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_poc_entry_progressing();
- DeleteUptoScrID(SCR_ID_POC_MAIN);
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- g_poc_cntx_p->progressing.alert = MMI_TRUE;
- myMsgPtr = (poc_send_personal_alert_req_struct*) OslConstructDataPtr(sizeof(poc_send_personal_alert_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_send_personal_alert_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->request_id = POC_REQUEST_ID;
- myMsgPtr->num_addr = 1;
- memcpy(
- myMsgPtr->recipient[0].disp_name,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name,
- sizeof(U8) * POC_MAX_DISP_LEN);
- memcpy(
- myMsgPtr->recipient[0].uri,
- g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- sizeof(U8) * POC_MAX_URI_LEN);
- UnicodeToAnsii((S8*) myMsgPtr->content, (S8*) g_poc_cntx_p->alert_text_buf);
- myMsgPtr->content_length = strlen((S8*) myMsgPtr->content);
- SetProtocolEventHandler(mmi_poc_send_personal_alert_rsp, MSG_ID_POC_SEND_PERSONAL_ALERT_RSP);
- memset(message_buf, 0, sizeof(message_buf));
- strncpy((S8*) message_buf, (S8*) myMsgPtr->content, MMI_POC_MAX_MSG_LEN - 1);
- mmi_poc_history_add(
- POC_OUTGOING_ALERT,
- MMI_FALSE,
- (U8*) myMsgPtr->recipient[0].disp_name,
- (U8*) myMsgPtr->recipient[0].uri,
- message_buf);
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_SEND_PERSONAL_ALERT_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_send_personal_alert_rsp
- * DESCRIPTION
- * send alert response handler
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_send_personal_alert_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_send_personal_alert_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_send_personal_alert_rsp_struct*) info;
- ClearProtocolEventHandler(MSG_ID_POC_SEND_PERSONAL_ALERT_RSP);
- g_poc_cntx_p->progressing.alert = 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);
- }
- }
- 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_contact_opt_adhoc_talk
- * DESCRIPTION
- * adhoc talk screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_contact_opt_adhoc_talk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nNumofItem;
- U8 i = 0;
- U8 *guiBuffer;
- mmi_poc_contact_list_disp *cont;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_CONTACT_ADHOC_TALK, NULL, mmi_poc_entry_contact_opt_adhoc_talk, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_CONTACT_ADHOC_TALK);
- nNumofItem = g_poc_cntx_p->contact_num;
- if (nNumofItem > POC_MAX_CONTACT_DISPLAY_NUM)
- {
- nNumofItem = POC_MAX_CONTACT_DISPLAY_NUM;
- }
- for (i = 0; i < nNumofItem; i++)
- {
- cont = &g_poc_cntx_p->contact_list_disp[i];
- subMenuDataPtrs[i] = subMenuData[i];
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- if (strlen((S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].display_name))
- {
- AnsiiNToUnicodeString(
- (S8*) subMenuDataPtrs[i],
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id]. display_name,
- MAX_SUBMENU_CHARACTERS - 1);
- }
- else
- {
- AnsiiNToUnicodeString(
- (S8*) subMenuDataPtrs[i],
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- MAX_SUBMENU_CHARACTERS - 1);
- }
- }
- SetParentHandler(MENU_ID_POC_CONTACT_OPT_ADHOC_TALK);
- if (guiBuffer == NULL)
- {
- memset(g_poc_cntx_p->adhoc_sel_disp, 0, sizeof(U8) * POC_MAX_CONTACT_DISPLAY_NUM);
- }
- SetCheckboxToggleRightSoftkeyFunctions(mmi_poc_contact_call_adhoc_cfrm, GoBackHistory);
- ShowCategory140Screen(
- STR_ID_POC_CONTACTS,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- nNumofItem,
- (U8 **) subMenuDataPtrs,
- g_poc_cntx_p->adhoc_sel_disp,
- 0,
- guiBuffer);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_contact_call_adhoc_cfrm
- * DESCRIPTION
- * adhoc talk confirm screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_contact_call_adhoc_cfrm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_GLOBAL_DIAL),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- SetLeftSoftkeyFunction(mmi_poc_contact_call_adhoc, KEY_EVENT_UP);
- SetRightSoftkeyFunction(poc_go_back_entry_opt, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_contact_call_adhoc
- * DESCRIPTION
- * call adhoc talk
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_contact_call_adhoc(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_addr_struct callee[POC_MAX_ADDR_NUM];
- U8 i, total_adhoc_num = 0;
- mmi_poc_contact_list_disp *cont;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(callee, 0, sizeof(callee));
- for (i = 0; i < POC_MAX_CONTACT_DISPLAY_NUM; i++)
- {
- cont = &g_poc_cntx_p->contact_list_disp[i];
- if (g_poc_cntx_p->adhoc_sel_disp[i] == MMI_TRUE)
- {
- if (total_adhoc_num >= POC_MAX_ADDR_NUM)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_MAXIMUM_REACHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT_ADHOC_TALK);
- return;
- }
- memcpy(
- &callee[total_adhoc_num].uri,
- &g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- sizeof(U8) * POC_MAX_URI_LEN);
- total_adhoc_num++;
- }
- }
- if (total_adhoc_num < 2)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_INVALID),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT_ADHOC_TALK);
- return;
- }
- memset(g_poc_cntx_p->cm_talk_group_name, 0, sizeof(g_poc_cntx_p->cm_talk_group_name));
- memset(g_poc_cntx_p->cm_talk_list, 0, sizeof(g_poc_cntx_p->cm_talk_list));
- g_poc_cntx_p->cm_talk_list_num = 0;
- memset(&g_poc_cntx_p->calling_disp, 0, sizeof(g_poc_cntx_p->calling_disp));
- mmi_poc_entry_inviting();
- mmi_poc_talk_invite_req(POC_AD_HOC_GROUP_TALK, total_adhoc_num, callee, 0, 0, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * poc_go_back_entry_opt
- * DESCRIPTION
- * go back entry option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void poc_go_back_entry_opt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT_ADHOC_TALK);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_contact_send_refresh_status
- * DESCRIPTION
- * send refresh status
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_contact_send_refresh_status(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_poc_contact_list_disp *cont;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- if (g_poc_cntx_p->progressing.refresh == 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->curr_use_pres_mode == MMI_FALSE)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- mmi_poc_entry_progressing();
- DeleteScreenIfPresent(SCR_ID_POC_CONTACT_OPT);
- g_poc_cntx_p->progressing.refresh = MMI_TRUE;
- mmi_poc_oneshot_pres_subscribe_req(g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_oneshot_pres_subscribe_req
- * DESCRIPTION
- * oneshot presence subscribe request
- * PARAMETERS
- * uri [?]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_oneshot_pres_subscribe_req(U8 *uri)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- poc_presence_subscribe_req_struct *myMsgPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- myMsgPtr = (poc_presence_subscribe_req_struct*) OslConstructDataPtr(sizeof(poc_presence_subscribe_req_struct));
- memset(
- (U8*) myMsgPtr + sizeof(mmi_poc_dummy_req_struct),
- 0,
- sizeof(poc_presence_subscribe_req_struct) - sizeof(mmi_poc_dummy_req_struct));
- myMsgPtr->action = POC_ONESHOT_SUBSCRIBE_ACTION;
- myMsgPtr->use_presence_list = MMI_FALSE;
- memcpy(myMsgPtr->uri, uri, POC_MAX_URI_LEN * sizeof(U8));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_POC;
- Message.oslMsgId = MSG_ID_POC_PRESENCE_SUBSCRIBE_REQ;
- Message.oslDataPtr = (oslParaType*) myMsgPtr;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_poc_oneshot_pres_subscribe_rsp, MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_oneshot_pres_subscribe_rsp
- * DESCRIPTION
- * oneshot presence subscribe response
- * PARAMETERS
- * info [IN] Local parameters from protocol
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_oneshot_pres_subscribe_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- poc_presence_subscribe_rsp_struct *msgRsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- msgRsp = (poc_presence_subscribe_rsp_struct*) info;
- g_poc_cntx_p->progressing.refresh = MMI_FALSE;
- ClearProtocolEventHandler(MSG_ID_POC_PRESENCE_SUBSCRIBE_RSP);
- if (GetActiveScreenId() == SCR_ID_POC_GENERAL_PROGRESSING)
- {
- if (msgRsp->result == POC_OK)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- }
- DeleteScreenIfPresent(SCR_ID_POC_GENERAL_PROGRESSING);
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- // TALK GROUP Functions start
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_talk_groups
- * DESCRIPTION
- * Talk group entry screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_poc_cntx_p->progressing.contact == MMI_TRUE)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_PROCESSING),
- IMG_GLOBAL_WARNING,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) WARNING_TONE);
- return;
- }
- EntryNewScreen(SCR_ID_POC_TALK_GROUP, NULL, mmi_poc_entry_talk_groups, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP);
- if (g_poc_cntx_p->talk_group_local_updated == MMI_FALSE)
- {
- mmi_poc_sort_talk_group_by_name();
- g_poc_cntx_p->talk_group_local_updated = MMI_TRUE;
- }
- RegisterHighlightHandler(mmi_poc_talk_group_highlight_handler);
- for (i = 0; i < g_poc_cntx_p->talk_group_num; i++)
- {
- subMenuDataPtrs[i] = subMenuData[i];
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- if (strlen((S8*) g_poc_cntx_p->talk_group_list[i].display_name))
- {
- mmi_poc_util_copy_with_dot(
- (S8*) g_poc_cntx_p->talk_group_list[i].display_name,
- (S8*) subMenuDataPtrs[i],
- MAX_SUBMENU_CHARACTERS - 1);
- }
- else
- {
- mmi_poc_util_copy_with_dot(
- (S8*) (S8*) g_poc_cntx_p->talk_group_list[i].list_uri,
- (S8*) subMenuDataPtrs[i],
- MAX_SUBMENU_CHARACTERS - 1);
- }
- }
- if (g_poc_cntx_p->talk_group_num == 0)
- {
- subMenuDataPtrs[0] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
- ShowCategory6Screen(
- STR_ID_POC_TALK_GROUPS,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- 1,
- subMenuDataPtrs,
- 0,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_entry_talk_groups_opt_empty, KEY_EVENT_UP);
- }
- else
- {
- if (guiBuffer != NULL)
- {
- memset((void*)guiBuffer, 0, 2);
- if (g_poc_cntx_p->talk_group_selected >= g_poc_cntx_p->talk_group_num)
- {
- g_poc_cntx_p->talk_group_selected = g_poc_cntx_p->talk_group_num - 1;
- }
- }
- else
- {
- g_poc_cntx_p->talk_group_selected = 0;
- }
- ShowCategory84Screen(
- STR_ID_POC_TALK_GROUPS,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- g_poc_cntx_p->talk_group_num,
- subMenuDataPtrs,
- (U16*) gIndexIconsImageList,
- 1,
- (S32) g_poc_cntx_p->talk_group_selected,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_entry_talk_groups_entry, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_entry_talk_groups_entry, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- if (g_poc_cntx_p->talk_group_num > 0)
- {
- SetKeyHandler(mmi_poc_talk_group_invite, KEY_SEND, KEY_EVENT_DOWN);
- }
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_highlight_handler
- * DESCRIPTION
- * Talk group highlight handler
- * PARAMETERS
- * index [IN] Current selected index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->talk_group_selected = (U8) index;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_sort_talk_group_by_name
- * DESCRIPTION
- * sort talk group by name
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_sort_talk_group_by_name(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i, j, k;
- poc_talk_group_struct temp_group;
- poc_talk_group_entry_struct temp_group_entry;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->talk_group_num = 0;
- for (i = 0; i < MAX_POC_TALK_GROUP_FILE_NUM * MAX_POC_TALK_GROUPS_PER_FILE_NUM; i++)
- {
- if (g_poc_cntx_p->talk_group_list[i].valid == MMI_TRUE)
- {
- g_poc_cntx_p->talk_group_num++;
- }
- }
- for (i = 0; i < g_poc_cntx_p->talk_group_num; i++)
- {
- for (j = i + 1; j < g_poc_cntx_p->talk_group_num; j++)
- {
- if (strcmp(
- (S8*) g_poc_cntx_p->talk_group_list[i].display_name,
- (S8*) g_poc_cntx_p->talk_group_list[j].display_name) > 0)
- {
- memcpy(&temp_group, &g_poc_cntx_p->talk_group_list[i], sizeof(poc_talk_group_struct));
- memcpy(
- &g_poc_cntx_p->talk_group_list[i],
- &g_poc_cntx_p->talk_group_list[j],
- sizeof(poc_talk_group_struct));
- memcpy(&g_poc_cntx_p->talk_group_list[j], &temp_group, sizeof(poc_talk_group_struct));
- }
- }
- }
- for (i = 0; i < g_poc_cntx_p->talk_group_num; i++)
- {
- for (j = 0; j < g_poc_cntx_p->talk_group_list[i].no_entries; j++)
- {
- for (k = j + 1; k < g_poc_cntx_p->talk_group_list[i].no_entries; k++)
- {
- if (strcmp(
- (S8*) g_poc_cntx_p->talk_group_list[i].entries[j].uri,
- (S8*) g_poc_cntx_p->talk_group_list[i].entries[k].uri) > 0)
- {
- memcpy(
- &temp_group_entry,
- &g_poc_cntx_p->talk_group_list[i].entries[j],
- sizeof(poc_talk_group_entry_struct));
- memcpy(
- &g_poc_cntx_p->talk_group_list[i].entries[j],
- &g_poc_cntx_p->talk_group_list[i].entries[k],
- sizeof(poc_talk_group_entry_struct));
- memcpy(
- &g_poc_cntx_p->talk_group_list[i].entries[k],
- &temp_group_entry,
- sizeof(poc_talk_group_entry_struct));
- }
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_talk_groups_opt_empty
- * DESCRIPTION
- * option for empty talk group
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_opt_empty(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 */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_TALK_GROUP_OPT_EMPTY, NULL, mmi_poc_entry_talk_groups_opt_empty, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_OPT_EMPTY);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_OPT_EMPTY);
- menuId = MENU_ID_POC_TALK_GROUPS_OPT_EMPTY;
- nNumofItem = GetNumOfChild(menuId);
- GetSequenceStringIds(menuId, nStrItemList);
- SetParentHandler(menuId);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_GLOBAL_OPTIONS,
- 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_entry_talk_groups_entry
- * DESCRIPTION
- * talk entry screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_entry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- S8 *icon_list[POC_TALK_GROUP_LOCAL_MAX_ENTRIES_NUM];
- U8 i;
- U8 curr_grp = g_poc_cntx_p->talk_group_selected;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_TALK_GROUP_ENTRY, NULL, mmi_poc_entry_talk_groups_entry, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_ENTRY);
- RegisterHighlightHandler(mmi_poc_talk_group_entry_highlight_handler);
- memset(g_poc_cntx_p->cm_disp, 0, sizeof(g_poc_cntx_p->cm_disp));
- if (strlen((S8*) g_poc_cntx_p->talk_group_list[curr_grp].display_name))
- {
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->cm_disp,
- (S8*) g_poc_cntx_p->talk_group_list[curr_grp].display_name,
- POC_MAX_DISP_LEN - 1);
- }
- else
- {
- mmi_poc_util_copy_with_dot(
- (S8*) g_poc_cntx_p->talk_group_list[curr_grp].list_uri,
- (S8*) g_poc_cntx_p->cm_disp,
- POC_MAX_DISP_LEN - 1);
- }
- for (i = 0; i < g_poc_cntx_p->talk_group_list[curr_grp].no_entries; i++)
- {
- subMenuDataPtrs[i] = subMenuData[i];
- memset((S8*) subMenuDataPtrs[i], 0, MAX_SUB_MENU_SIZE);
- mmi_poc_util_copy_with_dot(
- (S8*) g_poc_cntx_p->talk_group_list[curr_grp].entries[i].uri,
- (S8*) subMenuDataPtrs[i],
- MAX_SUBMENU_CHARACTERS - 1);
- }
- if (g_poc_cntx_p->talk_group_list[curr_grp].no_entries == 0)
- {
- subMenuDataPtrs[0] = (U8*) GetString(STR_GLOBAL_EMPTY_LIST);
- ShowCategory6Screen(
- STR_ID_POC_CONTACTS,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_OPTIONS,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- 1,
- subMenuDataPtrs,
- NULL,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_entry_talk_groups_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_entry_talk_groups_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- else
- {
- if (guiBuffer != NULL)
- {
- memset((void*)guiBuffer, 0, 2);
- if (g_poc_cntx_p->talk_entry_selected >= g_poc_cntx_p->talk_group_list[curr_grp].no_entries)
- {
- g_poc_cntx_p->talk_entry_selected = g_poc_cntx_p->talk_group_list[curr_grp].no_entries - 1;
- }
- }
- else
- {
- g_poc_cntx_p->talk_entry_selected = 0;
- }
- for (i = 0; i < g_poc_cntx_p->talk_group_list[curr_grp].no_entries; i++)
- {
- icon_list[i] = GetImage(gIndexIconsImageList[i]);
- }
- ShowCategory174Screen(
- g_poc_cntx_p->cm_disp,
- (PU8) GetImage(GetRootTitleIcon(MENU_ID_POC_MAIN)),
- (PU8) GetString(STR_GLOBAL_OPTIONS),
- (PU8) GetImage(IMG_GLOBAL_OK),
- (PU8) GetString(STR_GLOBAL_BACK),
- (PU8) GetImage(IMG_GLOBAL_BACK),
- g_poc_cntx_p->talk_group_list[curr_grp].no_entries,
- subMenuDataPtrs,
- (PU8*) icon_list,
- 0,
- 0,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_poc_entry_talk_groups_opt, KEY_EVENT_UP);
- SetKeyHandler(mmi_poc_entry_talk_groups_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_entry_highlight_handler
- * DESCRIPTION
- * highlight handler of talk group entry
- * PARAMETERS
- * index [IN]
- * indes(?) [IN] Current selected index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_entry_highlight_handler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->talk_entry_selected = (U8) index;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_talk_groups_opt
- * DESCRIPTION
- * talk group option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_opt(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 */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_TALK_GROUP_OPT, NULL, mmi_poc_entry_talk_groups_opt, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_OPT);
- menuId = MENU_ID_POC_TALK_GROUPS_OPT;
- nNumofItem = GetNumOfChild(menuId);
- GetSequenceStringIds(menuId, nStrItemList);
- SetParentHandler(menuId);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_GLOBAL_OPTIONS,
- 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_entry_talk_groups_opt_entry_settings
- * DESCRIPTION
- * setting screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_opt_entry_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nNumofItem;
- U8 *guiBuffer;
- U16 menuId;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_TALK_GROUP_ENTRY_SETTINGS, NULL, mmi_poc_entry_talk_groups_opt_entry_settings, NULL);
- if (g_poc_cntx_p->talk_group_list[g_poc_cntx_p->talk_group_selected].no_entries == 0)
- {
- menuId = MENU_ID_POC_TALK_GROUPS_OPT_ENTRY_SETTINGS_NO_ENTRY;
- }
- else
- {
- menuId = MENU_ID_POC_TALK_GROUPS_OPT_ENTRY_SETTINGS;
- }
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_ENTRY_SETTINGS);
- nNumofItem = GetNumOfChild(menuId);
- GetSequenceStringIds(menuId, nStrItemList);
- SetParentHandler(menuId);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory15Screen(
- STR_ID_POC_ENTRY_SETTINGS,
- 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_entry_talk_groups_opt_entry_settings_add
- * DESCRIPTION
- * add new entry
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_opt_entry_settings_add(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_poc_cntx_p->talk_entry_info_source = POC_TALK_ENTRY_NEW;
- mmi_poc_entry_talk_groups_opt_entry_settings_add_general();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_talk_groups_opt_entry_settings_add_general
- * DESCRIPTION
- * add screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_opt_entry_settings_add_general(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i, ImageLocation = 0;
- U8 *inputBuffer;
- U8 *guiBuffer;
- U16 inputBufferSize;
- U16 IconList[POC_TALK_GROUP_ENTRY_INLINE_NUM];
- U8 curr_grp = g_poc_cntx_p->talk_group_selected;
- mmi_poc_contact_list_disp *cont;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cont = &g_poc_cntx_p->contact_list_disp[g_poc_cntx_p->contact_selected];
- if (g_poc_cntx_p->talk_group_list[curr_grp].no_entries >= POC_TALK_GROUP_LOCAL_MAX_ENTRIES_NUM)
- {
- DisplayPopup(
- (U8*) GetString(STR_ID_POC_ERR_MAXIMUM_REACHED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- return;
- }
- EntryNewScreen(
- SCR_ID_POC_TALK_GROUP_ENTRY_ADD,
- mmi_poc_exit_talk_groups_opt_entry_settings_add_general,
- NULL,
- NULL);
- InitializeCategory57Screen();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_ENTRY_ADD);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_POC_TALK_GROUP_ENTRY_ADD, &inputBufferSize);
- SetParentHandler(MENU_ID_POC_TALK_GROUPS_OPT_ENTRY_SETTINGS_ADD);
- mmi_poc_talk_entry_fill_inline_struct(XDM_PUT_ADD);
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, POC_TALK_GROUP_ENTRY_INLINE_NUM, inputBuffer);
- }
- else
- {
- if (g_poc_cntx_p->talk_entry_info_source == POC_TALK_ENTRY_FROM_CONTACT)
- {
- memset(&g_poc_cntx_p->talk_entry_disp, 0, sizeof(poc_talk_group_entry_disp_struct));
- memset(&g_poc_cntx_p->talk_entry_disp.group_rule, POC_SETTING_TRUE, sizeof(poc_group_param_struct));
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->talk_entry_disp.uri,
- (S8*) g_poc_cntx_p->contact_list[cont->group_id].entries[cont->entry_id].uri,
- POC_MAX_URI_LEN - 1);
- set_wgui_inline_list_menu_changed();
- }
- else
- {
- memset(&g_poc_cntx_p->talk_entry_disp, 0, sizeof(poc_talk_group_entry_disp_struct));
- memset(&g_poc_cntx_p->talk_entry_disp.group_rule, POC_SETTING_TRUE, sizeof(poc_group_param_struct));
- AnsiiNToUnicodeString(
- (S8*) g_poc_cntx_p->talk_entry_disp.uri,
- (S8*) POC_MMI_SIP_PREFIX,
- POC_MAX_URI_LEN - 1);
- }
- }
- 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_TALK_GROUP_ENTRY_INLINE_NUM; i++)
- {
- if (i % 2)
- {
- IconList[i] = IMG_ID_POC_NOIMAGE;
- }
- else
- {
- IconList[i] = IMG_ID_POC_CONTACT_URI + ImageLocation;
- ImageLocation++;
- }
- }
- ShowCategory57Screen(
- STR_ID_POC_ENTRY_INFO,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- POC_TALK_GROUP_ENTRY_INLINE_NUM,
- IconList,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_poc_entry_talk_group_opt_settings_add_cfrm, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_exit_talk_groups_opt_entry_settings_add_general
- * DESCRIPTION
- * exit function for add general screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_exit_talk_groups_opt_entry_settings_add_general(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_leading_zero(TRUE);
- GenericExitInlineScreen(SCR_ID_POC_TALK_GROUP_ENTRY_ADD, mmi_poc_entry_talk_groups_opt_entry_settings_add_general);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_entry_fill_inline_struct
- * DESCRIPTION
- * fill inline structure
- * PARAMETERS
- * op [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_entry_fill_inline_struct(U8 op)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 BufferSize = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetInlineItemActivation((wgui_inline_items + POC_TALK_GROUP_ENTRY_URI), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation((wgui_inline_items + POC_TALK_GROUP_ENTRY_ATTR), KEY_LSK, KEY_EVENT_UP);
- SetInlineItemCaption((wgui_inline_items + POC_TALK_GROUP_ENTRY_URI_STR), (U8*) GetString(STR_ID_POC_URI));
- SetInlineItemCaption((wgui_inline_items + POC_TALK_GROUP_ENTRY_ATTR_STR), (U8*) GetString(STR_ID_POC_ATTRIBUTES));
- if (op == XDM_PUT_ADD)
- {
- BufferSize = POC_MAX_URI_LEN - 1;
- SetInlineItemFullScreenEdit_ext(
- (wgui_inline_items + POC_TALK_GROUP_ENTRY_URI),
- STR_ID_POC_URI,
- GetRootTitleIcon(MENU_ID_POC_MAIN),
- (U8*) (g_poc_cntx_p->talk_entry_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_TALK_GROUP_ENTRY_URI,
- mmi_poc_entry_full_line_edit);
- }
- else
- {
- SetInlineItemDisplayOnly(
- (wgui_inline_items + POC_TALK_GROUP_ENTRY_URI),
- (U8*) (g_poc_cntx_p->talk_entry_disp.uri));
- }
- SetInlineItemImageText(
- (wgui_inline_items + POC_TALK_GROUP_ENTRY_ATTR),
- (U8*) GetString(STR_ID_POC_SET_ATTR),
- 0,
- 0,
- 0,
- POC_MAX_DISP_LEN,
- 0,
- 0,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunctionImageText(
- (wgui_inline_items + POC_TALK_GROUP_ENTRY_ATTR),
- mmi_poc_entry_talk_groups_opt_entry_attr);
- ShowAsControl(wgui_inline_items + POC_TALK_GROUP_ENTRY_ATTR);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_entry_talk_groups_opt_entry_attr
- * DESCRIPTION
- * entry attribute screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_entry_talk_groups_opt_entry_attr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS];
- U16 nNumofItem;
- U8 *guiBuffer;
- U16 menuId;
- U8 *PoCHint[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_POC_TALK_GROUP_ENTRY_ATTR, NULL, mmi_poc_entry_talk_groups_opt_entry_attr, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_POC_TALK_GROUP_ENTRY_ATTR);
- menuId = MENU_ID_POC_TALK_GROUPS_OPT_ENTRY_SETTINGS_ENTRY_ATTRIBUTES;
- nNumofItem = GetNumOfChild(menuId);
- GetSequenceStringIds(menuId, nStrItemList);
- SetParentHandler(menuId);
- ConstructHintsList(menuId, PoCHint);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory52Screen(
- STR_ID_POC_ATTRIBUTES,
- 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_talk_group_set_conf_state
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_conf_state(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_entry_disp.group_rule.allow_conference_state)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_conference_state = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_conference_state = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_conference_state = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_invite_user_dyna
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_invite_user_dyna(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_entry_disp.group_rule.allow_invite_user_dynamically)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_invite_user_dynamically = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_invite_user_dynamically = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_invite_user_dynamically = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_join_handling
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_join_handling(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_entry_disp.group_rule.join_handling)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_entry_disp.group_rule.join_handling = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_entry_disp.group_rule.join_handling = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_entry_disp.group_rule.join_handling = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_init_conf
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_init_conf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_entry_disp.group_rule.allow_initiate_conference)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_initiate_conference = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_initiate_conference = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_initiate_conference = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_anonymity
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_anonymity(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_entry_disp.group_rule.allow_anonymity)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_anonymity = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_anonymity = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_entry_disp.group_rule.allow_anonymity = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_default_conf_state
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_default_conf_state(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_group_disp.default_rule.allow_conference_state)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_conference_state = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_conference_state = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_conference_state = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_default_invite_user_dyna
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_default_invite_user_dyna(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_group_disp.default_rule.allow_invite_user_dynamically)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_invite_user_dynamically = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_invite_user_dynamically = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_invite_user_dynamically = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_default_join_handling
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_default_join_handling(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_group_disp.default_rule.join_handling)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_group_disp.default_rule.join_handling = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_group_disp.default_rule.join_handling = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_group_disp.default_rule.join_handling = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_default_init_conf
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_default_init_conf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (g_poc_cntx_p->talk_group_disp.default_rule.allow_initiate_conference)
- {
- case POC_SETTING_TRUE:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_initiate_conference = POC_SETTING_FALSE;
- break;
- case POC_SETTING_FALSE:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_initiate_conference = POC_SETTING_TRUE;
- break;
- default:
- g_poc_cntx_p->talk_group_disp.default_rule.allow_initiate_conference = POC_SETTING_TRUE;
- break;
- }
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- g_poc_cntx_p->inline_item_changed = MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_poc_talk_group_set_default_anonymity
- * DESCRIPTION
- * change settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_poc_talk_group_set_default_anonymity(void)