MessagesMiscell.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:281k
源码类别:
MTK
开发平台:
C/C++
- }
- #endif /* __MMI_MESSAGES_TEMPLATE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_check_interrupt
- * DESCRIPTION
- * check if there is an interrupt (incoming call ringing or alarm playing).
- * PARAMETERS
- * void
- * RETURNS
- * 1: interrupt existed, 0: interrupt not existed
- *****************************************************************************/
- U8 mmi_msg_check_interrupt(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isIncomingCall() || AlmIsTonePlaying())
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*-------[MessagesMiscell.c] mmi_msg_check_interrupt return TRUE -------*n"));
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_check_ascii_number
- * DESCRIPTION
- * check if the encoding of number string is ascii or not
- * PARAMETERS
- * number_string [?]
- * length [IN]
- * RETURNS
- * KAL_TRUE: ascii encoding, KAL_FALSE: Otherwise
- *****************************************************************************/
- kal_bool mmi_msg_check_ascii_number(U8 *number_string, U16 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *number = number_string;
- U16 len = length;
- int i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < len; i++)
- {
- if (number[i] == 0)
- {
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*-------[MessagesMiscell.c] mmi_msg_check_ascii_number return FALSE -------*n"));
- return KAL_FALSE;
- }
- }
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*-------[MessagesMiscell.c] mmi_msg_check_ascii_number return TRUE -------*n"));
- return KAL_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_clear_action_queue
- * DESCRIPTION
- * check if the action queue is needed to be cleared to avoid the case that the screen
- * is back to idle from input number editor without clearing the action queue.
- * PARAMETERS
- * void
- * RETURNS
- * 1: cleared required, 0: cleared not required
- *****************************************************************************/
- U8 mmi_msg_need_clear_action_queue(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_msg_cntx.msg_status != MSG_STATUS_IDLE)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_new_msg_ind
- * DESCRIPTION
- * check if new msg indication is required
- * PARAMETERS
- * void
- * RETURNS
- * 1: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_new_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Return false if the new msg is deleted by AT */
- if (mmi_frm_sms_msg_box[g_msg_cntx.msg_ind_index].startindex == MMI_FRM_SMS_INVALID_INDEX)
- {
- g_msg_cntx.msg_ind_in_idle = FALSE;
- g_msg_cntx.msg_ind_after_call = FALSE;
- return KAL_FALSE;
- }
- else
- {
- return g_msg_cntx.msg_ind_in_idle;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_new_msg_ind_call_end
- * DESCRIPTION
- * Check if new msg indication after call end is required
- * PARAMETERS
- * void
- * RETURNS
- * 1: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_new_msg_ind_call_end(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_msg_cntx.msg_ind_after_call;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_reset_new_msg_ind_call_end
- * DESCRIPTION
- * Reset new msg indication after call end
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_reset_new_msg_ind_call_end(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_ind_after_call = FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_class0_msg_ind
- * DESCRIPTION
- * Check if class 0 message indication is required
- * PARAMETERS
- * void
- * RETURNS
- * 1: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_class0_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_msg_cntx.msg_class0_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_mem_full_ind
- * DESCRIPTION
- * Check if msg full indication is required
- * PARAMETERS
- * void
- * RETURNS
- * 1: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_mem_full_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_msg_cntx.msg_full_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_mem_exceed_ind
- * DESCRIPTION
- * Check if msg exceed indication is required
- * PARAMETERS
- * void
- * RETURNS
- * 1: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_mem_exceed_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_msg_cntx.msg_exceed_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_delivery_report_ind
- * DESCRIPTION
- * Check if delivery report indication is required
- * PARAMETERS
- * void
- * RETURNS
- * non-0: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_delivery_report_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_msg_cntx.msg_deliver_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_waiting_ind
- * DESCRIPTION
- * Check if msg waiting indication is required
- * PARAMETERS
- * void
- * RETURNS
- * non-0: indication required, 0: indication not required
- *****************************************************************************/
- U8 mmi_msg_need_waiting_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_msg_cntx.msg_waiting_ind;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_msg_waiting_ind
- * DESCRIPTION
- * Indicate msg waiting
- * PARAMETERS
- * type [IN]
- * a(?) [IN] Waiting msg type
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_msg_waiting_ind(U8 type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_waiting_ind = type + 1;
- TurnOnBacklight(1);
- if (IsMMIInIdleState() || (GetMessagesCurrScrnID() == SCR_ID_MSG_MSG_WAITING_IND))
- {
- PlayMessageArrivalTone();
- ClearKeyEvents();
- if (IsKeyPadLockState())
- {
- EntryIdleScreen();
- }
- else
- {
- mmi_msg_entry_msg_waiting_ind();
- }
- }
- else
- {
- /* do not interrupt a call, otherwise, incoming call's video and sound may be interrupted */
- if (!isInCall() && !AlmIsTonePlaying())
- {
- mmi_msg_entry_new_msg_popup(g_msg_cntx.msg_waiting_ind);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_msg_waiting_ind
- * DESCRIPTION
- * Reset msg waiting ind before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_msg_waiting_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_waiting_ind = 0;
- if (strBuff != NULL)
- {
- OslMfree(strBuff);
- strBuff = NULL;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_msg_waiting_ind
- * DESCRIPTION
- * Reset msg waiting ind before go to idle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_msg_waiting_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_waiting_ind = 0;
- if (strBuff != NULL)
- {
- OslMfree(strBuff);
- strBuff = NULL;
- }
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_msg_waiting_msg
- * DESCRIPTION
- * Get msg waiting msg
- * PARAMETERS
- * void
- * RETURNS
- * string for msg waiting indication
- *****************************************************************************/
- U8 *mmi_msg_get_msg_waiting_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *tempStr = NULL;
- U8 ascii_num[16];
- U16 num = g_msg_cntx.msg_waiting_info[g_msg_cntx.msg_waiting_line_number].number[g_msg_cntx.msg_waiting_ind - 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (strBuff != NULL)
- {
- OslMfree(strBuff);
- strBuff = NULL;
- }
- strBuff = OslMalloc(64);
- if (num > 0)
- {
- memset(ascii_num, 0, 16);
- sprintf((S8*) ascii_num, "%d ", num);
- AnsiiToUnicodeString((S8*) strBuff, (S8*) ascii_num);
- switch (g_msg_cntx.msg_waiting_ind)
- {
- case MSG_NEW_VOICEMAIL:
- tempStr = (U8*) GetString((U16) STR_VOICEMAIL_NUM_IND);
- break;
- case MSG_NEW_FAX:
- tempStr = (U8*) GetString((U16) STR_FAX_NUM_IND);
- break;
- case MSG_NEW_EMAIL:
- tempStr = (U8*) GetString((U16) STR_EMAIL_NUM_IND);
- break;
- default:
- tempStr = (U8*) GetString((U16) STR_VOICEMAIL_NUM_IND);
- break;
- }
- pfnUnicodeStrcat((S8*) strBuff, (S8*) tempStr);
- }
- else
- {
- switch (g_msg_cntx.msg_waiting_ind)
- {
- case MSG_NEW_VOICEMAIL:
- tempStr = (U8*) GetString((U16) STR_VOICEMAIL_IND);
- break;
- case MSG_NEW_FAX:
- tempStr = (U8*) GetString((U16) STR_FAX_IND);
- break;
- case MSG_NEW_EMAIL:
- tempStr = (U8*) GetString((U16) STR_EMAIL_IND);
- break;
- default:
- tempStr = (U8*) GetString((U16) STR_VOICEMAIL_IND);
- break;
- }
- pfnUnicodeStrcpy((S8*) strBuff, (S8*) tempStr);
- }
- return strBuff;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_msg_waiting_ind
- * DESCRIPTION
- * Entry msg waiting indication screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_msg_waiting_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *tempstr = mmi_msg_get_msg_waiting_msg();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_MSG_WAITING_IND, mmi_msg_stop_msg_sub_anm, NULL, NULL);
- SetMessagesCurrScrnID(SCR_ID_MSG_MSG_WAITING_IND);
- ForceSubLCDScreen(mmi_msg_start_msg_sub_anm);
- if (IsKeyPadLockState() == 0)
- {
- GetCurrEndKeyDownHandler();
- ShowCategory141Screen(
- 0,
- 0,
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) tempstr,
- IMG_NEW_VOICEMAIL_NOTIFICATION_MSG,
- NULL);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_msg_waiting_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_msg_waiting_ind, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- ShowCategory141Screen(
- 0,
- 0,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- (U8*) tempstr,
- IMG_NEW_VOICEMAIL_NOTIFICATION_MSG,
- NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_deliver_report_ind
- * DESCRIPTION
- * Indicate delivery report
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_deliver_report_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_deliver_ind++;
- TurnOnBacklight(1);
- if (IsMMIInIdleState() || (GetMessagesCurrScrnID() == SCR_ID_MSG_DELIVER_REPORT))
- {
- PlayMessageArrivalTone();
- ClearKeyEvents();
- if (IsKeyPadLockState())
- {
- EntryIdleScreen();
- }
- else
- {
- mmi_msg_entry_deliver_report_ind();
- }
- }
- else
- {
- /* do not interrupt a call, otherwise, incoming call's video and sound may be interrupted */
- if (!isInCall() && !AlmIsTonePlaying())
- {
- mmi_msg_entry_new_msg_popup(MSG_NEW_DELIVERY_REPORT);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_deliver_report_ind
- * DESCRIPTION
- * Free delivery report before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_deliver_report_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_msg_cntx.msg_deliver_ind != 0)
- {
- g_msg_cntx.msg_deliver_ind--;
- }
- if (g_msg_cntx.msg_deliver_report[g_msg_cntx.msg_deliver_ind] != NULL)
- {
- OslMfree(g_msg_cntx.msg_deliver_report[g_msg_cntx.msg_deliver_ind]);
- g_msg_cntx.msg_deliver_report[g_msg_cntx.msg_deliver_ind] = NULL;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_deliver_report_ind
- * DESCRIPTION
- * Free delivery report before go to idle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_deliver_report_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_msg_cntx.msg_deliver_ind != 0)
- {
- g_msg_cntx.msg_deliver_ind--;
- }
- if (g_msg_cntx.msg_deliver_report[g_msg_cntx.msg_deliver_ind] != NULL)
- {
- OslMfree(g_msg_cntx.msg_deliver_report[g_msg_cntx.msg_deliver_ind]);
- g_msg_cntx.msg_deliver_report[g_msg_cntx.msg_deliver_ind] = NULL;
- }
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_deliver_report_status
- * DESCRIPTION
- * Get delivery report status
- * PARAMETERS
- * status [?]
- * imgID [?]
- * strID [?]
- * a(?) [IN/OUT] Status
- * c(?) [IN/OUT] String ID
- * b(?) [IN/OUT] Image ID
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_get_deliver_report_status(U32 *status, U16 *imgID, U16 *strID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_msg_cntx.msg_deliver_report[(g_msg_cntx.msg_deliver_ind - 1)]->delivered == ST_COMP_MSG_RECV_BY_SME)
- {
- *status = 1;
- *imgID = IMG_MESSAGE_SENT;
- *strID = STR_SUCCESS_CAPTION;
- }
- else
- {
- *status = 0;
- *imgID = IMG_MESSAGE_UNSENT;
- *strID = STR_FAILURE_CAPTION;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_deliver_report_msg
- * DESCRIPTION
- * Get delivery report msg
- * PARAMETERS
- * void
- * RETURNS
- * string for delivery report indication
- *****************************************************************************/
- U8 *mmi_msg_get_deliver_report_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S8 buffer[120 * ENCODING_LENGTH];
- S8 buf2[10];
- S8 temp[MAX_DIGITS * ENCODING_LENGTH];
- S8 *name;
- S8 ts_date[(MAX_TIMESTAMP_SIZE + 1) * ENCODING_LENGTH];
- S8 ts_time[(MAX_TIMESTAMP_SIZE + 1) * ENCODING_LENGTH];
- U8 type = g_msg_cntx.msg_deliver_report[(g_msg_cntx.msg_deliver_ind - 1)]->type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AnsiiToUnicodeString(buf2, "n");
- memset(temp, 0, MAX_DIGITS * ENCODING_LENGTH);
- if (type)
- {
- AnsiiToUnicodeString(temp, "+");
- }
- AnsiiNToUnicodeString(
- (temp + type * ENCODING_LENGTH),
- (S8*) g_msg_cntx.msg_deliver_report[(g_msg_cntx.msg_deliver_ind - 1)]->number,
- MSG_NUM_LEN);
- name = lookUpNumber(temp);
- if (pfnUnicodeStrlen(name))
- {
- pfnUnicodeStrcpy(buffer, name);
- }
- else
- {
- pfnUnicodeStrcpy(buffer, temp);
- }
- mmi_msg_get_msg_date_time(
- ts_date,
- ts_time,
- g_msg_cntx.msg_deliver_report[(g_msg_cntx.msg_deliver_ind - 1)]->timestamp);
- pfnUnicodeStrcat(buffer, buf2);
- pfnUnicodeStrcat(buffer, ts_date);
- pfnUnicodeStrcat(buffer, buf2);
- pfnUnicodeStrcat(buffer, ts_time);
- pfnUnicodeStrcat(buffer, buf2);
- return (U8*) buffer;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_deliver_report_ind
- * DESCRIPTION
- * Entry delivery report indication screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_deliver_report_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 drStatusIconID = 0;
- U16 drStatusStrID = 0;
- U32 drStatus = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_DELIVER_REPORT, mmi_msg_exit_generic, NULL, NULL);
- SetMessagesCurrScrnID(SCR_ID_MSG_DELIVER_REPORT);
- if (IsKeyPadLockState() == 0)
- {
- mmi_msg_get_deliver_report_status(&drStatus, &drStatusIconID, &drStatusStrID);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_DELIVER_REPORT);
- GetCurrEndKeyDownHandler();
- ShowCategory145Screen(
- ((U8*) GetString(STR_STATUS_REPORT_MESSAGE_DELIVERD_MSG)),
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- drStatusIconID,
- ((U8*) GetString(drStatusStrID)),
- mmi_msg_get_deliver_report_msg(),
- drStatus,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_msg_go_back_from_deliver_report_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_deliver_report_ind, KEY_END, KEY_EVENT_DOWN);
- }
- else /* keypad is locked */
- {
- mmi_msg_get_deliver_report_status(&drStatus, &drStatusIconID, &drStatusStrID);
- ShowCategory145Screen(
- ((PU8) GetString(STR_STATUS_REPORT_MESSAGE_DELIVERD_MSG)),
- IMG_SMS_ENTRY_SCRN_CAPTION,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- drStatusIconID,
- ((PU8) GetString(drStatusStrID)),
- mmi_msg_get_deliver_report_msg(),
- drStatus,
- NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_mem_exceed_ind
- * DESCRIPTION
- * Indicate memory exceed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_mem_exceed_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_exceed_ind = TRUE;
- TurnOnBacklight(1);
- if (IsMMIInIdleState())
- {
- ClearKeyEvents();
- if (IsKeyPadLockState())
- {
- EntryIdleScreen();
- }
- else
- {
- mmi_msg_entry_mem_exceed_ind();
- }
- }
- #ifdef __MMI_MESSAGES_CHAT__
- else
- {
- EntrySmsMemoryFullIndInChatApp();
- }
- #endif /* __MMI_MESSAGES_CHAT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_mem_exceed_ind
- * DESCRIPTION
- * Reset msg exceed flag before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_mem_exceed_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_exceed_ind = FALSE;
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_mem_exceed_ind
- * DESCRIPTION
- * Reset msg exceed flag before go to idle
- * PARAMETERS
- * void
- * nnoe(?)
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_mem_exceed_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_exceed_ind = FALSE;
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_mem_exceed_ind
- * DESCRIPTION
- * Entry memory exceed indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_mem_exceed_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 str_id = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_msg_cntx.msg_exceed_type == SMSAL_MEM_EXCEED_NORMAL)
- {
- str_id = STR_SMS_MEMORY_EXCEEDED;
- }
- else if (g_msg_cntx.msg_exceed_type == SMSAL_SM_EXCEED_WITH_CLASS2)
- {
- str_id = STR_SMS_SIM_MEMORY_EXCEEDED;
- }
- EntryNewScreen(SCR_ID_MSG_EXCEED_IND, NULL, NULL, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
- "*-------[MessagesIdleApp.c] EntryDisplaySmsMemoryExceededIndication -------*n"));
- if (IsKeyPadLockState() == 0)
- {
- GetCurrEndKeyDownHandler();
- ShowCategory2Screen(
- STR_SCR6042_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- 0,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- str_id,
- NULL);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_mem_exceed_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_go_back_from_mem_exceed_ind, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_end_key_from_mem_exceed_ind, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- ShowCategory2Screen(
- STR_SCR6042_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- str_id,
- NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_class0_msg_ind
- * DESCRIPTION
- * Indicate class 0 message
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_class0_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_class0_ind = TRUE;
- TurnOnBacklight(1);
- if (IsMMIInIdleState() || GetMessagesCurrScrnID() == SCR_ID_MSG_CLASS0_MSG)
- {
- PlayMessageArrivalTone();
- ClearKeyEvents();
- if (IsKeyPadLockState())
- {
- EntryIdleScreen();
- }
- else
- {
- mmi_msg_entry_class0_msg_ind();
- }
- }
- else
- {
- /* do not interrupt a call, otherwise, incoming call's video and sound may be interrupted */
- if (!isInCall() && !AlmIsTonePlaying())
- {
- mmi_msg_entry_new_msg_popup(MSG_NEW_MSG_CLASS0);
- }
- /* In option, use number, or any other screen after class 0 messages screens*/
- if (IsScreenPresent(SCR_ID_MSG_CLASS0_MSG))
- {
- DeleteScreenIfPresent(SCR_ID_MSG_CLASS0_MSG);
- DeleteScreenIfPresent(SCR_ID_MSG_CLASS0_OPTION);
- DeleteScreenIfPresent(SCR_ID_MSG_CLASS0_OPTION_USE_NUMBER_LIST);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_class0_msg
- * DESCRIPTION
- * Get class 0 message
- * PARAMETERS
- * void
- * RETURNS
- * EMSData bufForDisplay
- *****************************************************************************/
- EMSData *mmi_msg_get_class0_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EMSData *pEms;
- U16 textLen = g_msg_cntx.msg_class0_p->length;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- textLen = (textLen / 2);
- GetEMSDataForView(&pEms, 1);
- AddString(pEms, g_msg_cntx.msg_class0_p->data, textLen, NULL);
- GetEMSDataForView(&pEms, 0);
- return pEms;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_class0_header
- * DESCRIPTION
- * Get class 0 message header
- * PARAMETERS
- * void
- * RETURNS
- * class 0 message header
- *****************************************************************************/
- U8 *mmi_msg_get_class0_header(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S8 buffer[120 * ENCODING_LENGTH];
- S8 buf2[10];
- S8 temp[MAX_DIGITS * ENCODING_LENGTH];
- S8 *name;
- S8 ts_date[(MAX_TIMESTAMP_SIZE + 1) * ENCODING_LENGTH];
- S8 ts_time[(MAX_TIMESTAMP_SIZE + 1) * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AnsiiToUnicodeString(buf2, "n");
- pfnUnicodeStrcpy(buffer, GetString(STR_CLASS0_MESSAGE_CAPTION));
- pfnUnicodeStrcat(buffer, buf2);
- pfnUnicodeStrcpy(temp, (S8*) g_msg_cntx.msg_class0_p->number);
- name = lookUpNumber(temp);
- if (pfnUnicodeStrlen(name))
- {
- pfnUnicodeStrcat(buffer, name);
- }
- else
- {
- pfnUnicodeStrcat(buffer, temp);
- }
- mmi_msg_get_msg_date_time(ts_date, ts_time, g_msg_cntx.msg_class0_p->timestamp);
- pfnUnicodeStrcat(buffer, buf2);
- pfnUnicodeStrcat(buffer, ts_date);
- pfnUnicodeStrcat(buffer, buf2);
- pfnUnicodeStrcat(buffer, ts_time);
- pfnUnicodeStrcat(buffer, buf2);
- return (U8*) buffer;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_class0_msg_ind
- * DESCRIPTION
- * Reset class 0 message before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_class0_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_class0_ind = FALSE;
- if (g_msg_cntx.msg_class0_p != NULL)
- {
- if (g_msg_cntx.msg_class0_p->data != NULL)
- {
- OslMfree(g_msg_cntx.msg_class0_p->data);
- g_msg_cntx.msg_class0_p->data = NULL;
- }
- OslMfree(g_msg_cntx.msg_class0_p);
- g_msg_cntx.msg_class0_p = NULL;
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_class0_msg_ind
- * DESCRIPTION
- * Reset class 0 message before go to idle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_class0_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_class0_ind = FALSE;
- if (g_msg_cntx.msg_class0_p != NULL)
- {
- if (g_msg_cntx.msg_class0_p->data != NULL)
- {
- OslMfree(g_msg_cntx.msg_class0_p->data);
- g_msg_cntx.msg_class0_p->data = NULL;
- }
- OslMfree(g_msg_cntx.msg_class0_p);
- g_msg_cntx.msg_class0_p = NULL;
- }
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_class0_msg_option
- * DESCRIPTION
- * Entry class 0 msg option screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_class0_msg_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CLASS0_OPTION, mmi_msg_exit_generic, mmi_msg_entry_class0_msg_option, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[MessagesMiscell.c] mmi_msg_entry_class0_msg_option *n"));
- GetCurrEndKeyDownHandler();
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CLASS0_OPTION);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CLASS0_OPTION);
- numItems = GetNumOfChild_Ext(SMS_CLSASS0_OPT_MENUID);
- GetSequenceStringIds_Ext(SMS_CLSASS0_OPT_MENUID, nStrItemList);
- SetParentHandler(SMS_CLSASS0_OPT_MENUID);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- SetMessagesCurrScrnID(SCR_ID_MSG_CLASS0_OPTION);
- ShowCategory52Screen(
- STR_SCR6028_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetKeyHandler(mmi_msg_end_key_from_class0_msg_ind, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_class0_msg_option
- * DESCRIPTION
- * Pre entry class 0 option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_class0_msg_option(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_ID_MSG_CLASS0_MSG;
- h.entryFuncPtr = mmi_msg_entry_class0_msg_ind;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- mmi_msg_entry_class0_msg_option();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_class_0_opt_use_number
- * DESCRIPTION
- * Entry function for class 0 use number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_class_0_opt_use_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 numbersCount = 0;
- U8 *guiBuffer = NULL;
- S8 number[MAX_DIGITS_SMS * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[MessagesMiscell.c] mmi_msg_entry_class_0_opt_use_number *n"));
- memset((S8*) number, 0, sizeof(number));
- numbersCount = ObtainNumbersFromMessageText((S8*) g_msg_cntx.msg_class0_p->number,
- g_msg_cntx.msg_class0_p->data,
- (U16) g_msg_cntx.msg_class0_p->length,
- 0);
- if (numbersCount > 0)
- {
- EntryNewScreen(SCR_ID_MSG_CLASS0_OPTION_USE_NUMBER_LIST, mmi_msg_exit_generic, mmi_msg_entry_class_0_opt_use_number, NULL);
- GetCurrEndKeyDownHandler();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CLASS0_OPTION_USE_NUMBER_LIST);
- RegisterHighlightHandler(GetHiliteIndex);
- SetMessagesCurrScrnID(SCR_ID_MSG_CLASS0_OPTION_USE_NUMBER_LIST);
- ShowCategory53Screen(
- STR_USE_NUMBER_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_DIAL,
- IMG_SMS_COMMON_NOIMAGE,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numbersCount,
- (U8 **) g_msg_cntx.numbersList,
- (U16*) gIndexIconsImageList,
- NULL,
- 0,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_msg_dial_use_number, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_dial_use_number, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_dial_use_number, KEY_SEND, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_end_key_from_class0_msg_ind, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_NONUMBER_NOTIFICATION),
- IMG_GLOBAL_EMPTY,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) EMPTY_LIST_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_class0_opt_use_number
- * DESCRIPTION
- * Highlight class 0 use number handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_class0_opt_use_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_entry_class_0_opt_use_number,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_class0_msg_ind
- * DESCRIPTION
- * Entry class 0 message indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_class0_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CLASS0_MSG, mmi_msg_stop_msg_sub_anm, NULL, NULL);
- SetMessagesCurrScrnID(SCR_ID_MSG_CLASS0_MSG);
- ForceSubLCDScreen(mmi_msg_start_msg_sub_anm);
- if (IsKeyPadLockState() == 0)
- {
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CLASS0_MSG);
- GetCurrEndKeyDownHandler();
- ShowCategory39Screen(
- STR_CLASS0_MESSAGE_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OPTIONS,
- IMG_SMS_COMMON_NOIMAGE,
- STR_GLOBAL_BACK,
- IMG_SMS_COMMON_NOIMAGE,
- mmi_msg_get_class0_msg(),
- mmi_msg_get_class0_header(),
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_msg_pre_entry_class0_msg_option, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_class0_msg_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_class0_msg_ind, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- ShowCategory39Screen(
- STR_CLASS0_MESSAGE_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- mmi_msg_get_class0_msg(),
- mmi_msg_get_class0_header(),
- NULL);
- /* prevent category scrolling */
- SetKeyHandler(NULL, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_new_msg_ind
- * DESCRIPTION
- * Indicate new message
- * PARAMETERS
- * index [IN]
- * a(?) [IN] L4 index of new message
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_new_msg_ind(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_ind_index = index; /* it should be sms frm index, not l4 index */
- g_msg_cntx.msg_ind_in_idle = TRUE;
- if (isInCall())
- {
- g_msg_cntx.msg_ind_after_call = TRUE;
- }
- TurnOnBacklight(1);
- mmi_msg_set_msg_icon(FALSE, FALSE);
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (IsMMIInIdleState() || GetExitScrnID() == SCR_ID_UM_NEW_MSG_IND)
- #else /* __MMI_UNIFIED_MESSAGE__ */
- if (IsMMIInIdleState() || GetMessagesCurrScrnID() == SCR_ID_MSG_NEW_MSG_IND)
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- {
- #ifndef __MMI_UNIFIED_MESSAGE__
- PlayMessageArrivalTone();
- StartLEDPatternMessageIn();
- StartTimer(MESSAGES_SUBLCD_TIMER_ID, MESSAGES_SUBLCD_TIME_OUT, mmi_msg_callback_msg_sub_anm);
- ClearKeyEvents();
- if (IsKeyPadLockState())
- {
- EntryIdleScreen();
- }
- else
- {
- mmi_msg_entry_new_msg_ind();
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- else
- {
- #ifndef __MMI_UNIFIED_MESSAGE__
- /* it is in the inbox list or the inbox list screen is in the history */
- if (GetMessagesCurrScrnID() == SCR_ID_MSG_INBOX_LIST || IsScreenPresent(SCR_ID_MSG_INBOX_LIST))
- #else /* __MMI_UNIFIED_MESSAGE__ */
- #ifdef __UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__
- if (GetExitScrnID() == SCR_ID_MSG_INBOX_LIST_OPTION || IsScreenPresent(SCR_ID_MSG_INBOX_LIST_OPTION))
- #else /* __UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__ */
- if (GetExitScrnID() == SCR_ID_MSG_INBOX_MSG || IsScreenPresent(SCR_ID_MSG_INBOX_MSG))
- #endif /* __UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__ */
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- {
- U8 type;
- U16 list_index;
- mmi_frm_sms_get_list_index(&type, &list_index, g_msg_cntx.msg_ind_index);
- /* highlighter will be moved one position down only when the new message lists in front of the current highlighter and the new message does not make any incomplete message complete in inbox */
- if (type == MMI_FRM_SMS_APP_INBOX && list_index <= g_msg_cntx.currBoxIndex &&
- msgbox_info.totalinbox < mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_APP_INBOX))
- {
- g_msg_cntx.currBoxIndex++;
- /* Update msgbox_info.totalinbox immediately. */
- msgbox_info.totalinbox = mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_APP_INBOX);
- }
- }
- /* do not interrupt a call, otherwise, incoming call's video and sound may be interrupted */
- if (isInCall())
- {
- /* in case it is in the sms main menu from the in-call option */
- if (mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) != MMI_FRM_SMS_INVALID_INDEX)
- {
- msgbox_info.totalinbox = mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_APP_INBOX);
- msgbox_info.totaloutbox = mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_APP_OUTBOX);
- msgbox_info.totaldraftbox = mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_APP_DRAFTS);
- mmi_msg_set_msg_num_hint(msgbox_info.totalinbox, msgbox_info.totaloutbox, msgbox_info.totaldraftbox);
- RefreshMessagesMenuList();
- }
- /* If current screen is inbox list, refresh the inbox list */
- if (GetExitScrnID() == SCR_ID_MSG_INBOX_LIST)
- {
- mmi_msg_entry_inbox_list();
- DeleteScreenIfPresent(SCR_ID_MSG_INBOX_LIST);
- }
- playRequestedTone(SMS_IN_CALL_TONE);
- }
- else if (!AlmIsTonePlaying())
- {
- #if defined (__MMI_SMART_MESSAGE_MT__) || (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__))
- switch (g_msg_cntx.dest_port)
- {
- case 0x1581:
- mmi_msg_entry_new_msg_popup(MSG_NEW_MSG_RINGTONE);
- break;
- case 0x158A:
- mmi_msg_entry_new_msg_popup(MSG_NEW_MSG_PICTURE);
- break;
- default:
- mmi_msg_entry_new_msg_popup(MSG_NEW_MSG_NORMAL);
- break;
- }
- #else /* defined (__MMI_SMART_MESSAGE_MT__) || (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) */
- mmi_msg_entry_new_msg_popup(MSG_NEW_MSG_NORMAL);
- #endif /* defined (__MMI_SMART_MESSAGE_MT__) || (defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)) */
- #ifdef __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__
- mmi_msg_refresh_memory_status();
- #endif
- }
- }
- #ifdef __MMI_UNIFIED_MESSAGE__
- {
- U8 type;
- U16 list_index;
- U8 *timestamp = NULL;
- UI_time datetime;
- U32 converted_timestamp = 0;
- mmi_frm_sms_get_list_index(&type, &list_index, index);
- timestamp = mmi_frm_sms_get_timestamp(MMI_FRM_SMS_INBOX, list_index);
- datetime.nYear = timestamp[0] + 2000;
- if (datetime.nYear > 2090)
- {
- datetime.nYear = datetime.nYear - 100;
- }
- datetime.nMonth = timestamp[1];
- datetime.nDay = timestamp[2];
- datetime.nHour = timestamp[3];
- datetime.nMin = timestamp[4];
- datetime.nSec = timestamp[5];
- #ifdef MMI_ON_HARDWARE_P
- converted_timestamp = mmi_dt_mytime_2_utc_sec((MYTIME*) & datetime, MMI_TRUE);
- #endif
- mmi_msg_send_new_msg_ind(UM_MSG_BOX_TYPE_INBOX, list_index, converted_timestamp);
- }
- mmi_msg_send_refresh_ind(UM_MSG_BOX_TYPE_INBOX);
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_new_msg_ind_string
- * DESCRIPTION
- * Get new msg indication string
- * PARAMETERS
- * void
- * RETURNS
- * new msg indication string
- *****************************************************************************/
- U8 *mmi_msg_get_new_msg_ind_string(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static S8 buffer[120 * ENCODING_LENGTH];
- S8 temp[MAX_DIGITS * ENCODING_LENGTH];
- S8 *name;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(buffer, 0, 120 * ENCODING_LENGTH);
- memset(temp, 0, MAX_DIGITS * ENCODING_LENGTH);
- AnsiiToUnicodeString(temp, (S8*) mmi_frm_sms_get_address(MMI_FRM_SMS_APP_NOBOX, g_msg_cntx.msg_ind_index));
- name = lookUpNumber(temp);
- if (pfnUnicodeStrlen(name))
- {
- pfnUnicodeStrcpy(buffer, name);
- }
- else
- {
- pfnUnicodeStrcpy(buffer, temp);
- }
- return (U8*) buffer;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_new_msg_ind
- * DESCRIPTION
- * Reset new msg indication before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_new_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_ind_in_idle = FALSE;
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_new_msg_ind
- * DESCRIPTION
- * Reset new msg indication before go to idle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_new_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.msg_ind_in_idle = FALSE;
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_new_msg_ind
- * DESCRIPTION
- * Entry new message indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_new_msg_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_NEW_MSG_IND, mmi_msg_stop_msg_sub_anm, NULL, NULL);
- SetMessagesCurrScrnID(SCR_ID_MSG_NEW_MSG_IND);
- ForceSubLCDScreen(mmi_msg_start_msg_sub_anm);
- GetCurrEndKeyDownHandler();
- g_msg_cntx.msg_ind_after_call = FALSE;
- if (IsKeyPadLockState() == 0)
- {
- ShowCategory154Screen(
- 0,
- 0,
- STR_SCR6035_LSK,
- IMG_SMS_COMMON_NOIMAGE,
- STR_GLOBAL_BACK,
- IMG_SMS_COMMON_NOIMAGE,
- (PU8) GetString(STR_NEW_MESSAGE_FROM_ID),
- (PU8) mmi_msg_get_new_msg_ind_string(),
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_new_msg_ind, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_msg_get_msg_new, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_new_msg_ind, KEY_END, KEY_EVENT_DOWN);
- }
- else /* keypad is locked */
- {
- ShowCategory154Screen(
- 0,
- 0,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- (PU8) GetString(STR_NEW_MESSAGE_FROM_ID),
- (PU8) mmi_msg_get_new_msg_ind_string(),
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- //KP Jerry add for changing the style of message tone list on 2007-4-10 start
- #ifdef __MMI_TONE_LIST_STYLE_CHANGED__
- gui_start_timer(10000, StopExtMSTone);
- #endif
- //KP Jerry add for changing the style of message tone list on 2007-4-10 end
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_start_msg_sub_anm
- * DESCRIPTION
- * Start sub-LCD msg animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_start_msg_sub_anm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!isInCall())
- {
- ExecSubLCDCurrExitHandler();
- if (GetMessagesCurrScrnID() == SCR_ID_MSG_MSG_WAITING_IND)
- {
- ShowCategory304Screen(IMG_NEW_VOICEMAIL_PIC_SUBLCD_MSG, NULL);
- }
- else
- {
- ShowCategory304Screen(IMG_NEW_SMS_PIC_SUBLCD_MSG, NULL);
- }
- SetSubLCDExitHandler(mmi_msg_callback_msg_sub_anm);
- // StartLEDPatternMessageIn ();
- // StartTimer(MESSAGES_SUBLCD_TIMER_ID, MESSAGES_SUBLCD_TIME_OUT, mmi_msg_callback_msg_sub_anm);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_stop_msg_sub_anm
- * DESCRIPTION
- * Stop sub-LCD msg animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_stop_msg_sub_anm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetMessagesCurrScrnID(0); /* messagesCurrScrnID */
- mmi_msg_callback_msg_sub_anm();
- GoBackSubLCDHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_callback_msg_sub_anm
- * DESCRIPTION
- * Call back sub-LCD msg animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_callback_msg_sub_anm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopLEDPatternMessageIn();
- StopTimer(MESSAGES_SUBLCD_TIMER_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_exit_inbox_list_dummy
- * DESCRIPTION
- * Dummy exit inbox list, for new message indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_exit_inbox_list_dummy(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&currHistory, 0, sizeof(currHistory));
- currHistory.scrnID = SCR_ID_MSG_INBOX_LIST;
- SetMessagesCurrScrnID(0);
- g_msg_cntx.MessagesScrnIdToDelHistoryNodes = SCR_ID_MSG_INBOX_LIST;
- g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes = SCR_ID_MSG_INBOX_LIST;
- currHistory.entryFuncPtr = mmi_msg_entry_inbox_list;
- memset((S8*) currHistory.inputBuffer, 0, ENCODING_LENGTH);
- AddHistory(currHistory);
- }
- #ifdef __MMI_MESSAGES_CLUB__
- #include "ProfileGprots.h"
- #include "Wgui_categories_inputs.h"
- #ifndef NVRAM_MSG_CLUB_RECORD_SIZE
- #define NVRAM_MSG_CLUB_RECORD_SIZE 10
- #endif
- #ifndef NVRAM_MSG_CLUB_RECORD_TOTAL
- #define NVRAM_MSG_CLUB_RECORD_TOTAL 1
- #endif
- #ifndef NVRAM_MSG_CLUB_NUM_RECORD_SIZE
- #define NVRAM_MSG_CLUB_NUM_RECORD_SIZE 5
- #endif
- #ifndef NVRAM_MSG_CLUB_NUM_RECORD_TOTAL
- #define NVRAM_MSG_CLUB_NUM_RECORD_TOTAL 1
- #endif
- #define MSG_CLUB_SCREEN_NUM 6
- #define MSG_CLUB_MENUITEM_NUM 25
- #define MSG_CLUB_INPUT_BUFF_LEN 50
- #define MSG_CLUB_INPUT_DA_LEN 15
- #define MSG_CLUB_INPUT_NAME_LEN 30
- #define MSG_CLUB_INPUT_SMS_LEN 120
- #define MSG_CLUB_INPUT_PWD_LEN 16
- #define MSG_CLUB_INPUT_SEPEATE "#"
- U8 msg_club_level_1_index = 0;
- U8 msg_club_level_2_index = 0;
- U8 msg_club_level_3_index = 0;
- static msg_club_entry_menu_struct MSGClubScreen[MSG_CLUB_SCREEN_NUM];
- static msg_club_entry_menu_struct MSGClubMenuItem[MSG_CLUB_MENUITEM_NUM];
- static msg_club_entry_dy_db_zf_struct MSGClubSMSItem;
- static msg_club_code_enum MSGClubInputType;
- static msg_club_network_enum MSGClubNetwork;
- static S8 *MSGClubInputBuff;
- static S8 *MSGClubInputBuff2;
- static U8 MSGClubInputLen;
- static U8 MSGClubInputLen2;
- static U16 MSGClubTitle;
- static U16 MSGClubTitle2;
- static U8 MSGClubCount = 0;
- extern S8 gHomePLMNNum[];
- extern const msg_club_entry_menu_struct MenuMSGClub[];
- extern const msg_club_entry_menu_struct MenuVoice[];
- extern const msg_club_service_num_struct NumService[];
- extern const msg_club_entry_dy_db_zf_struct MenuExtra[];
- extern const U16 InputString[];
- extern UI_string_type get_string_lang(MMI_ID_TYPE i, S8 *ssc_str);
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_make_call
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_make_call(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MakeCall(g_msg_cntx.smsPhoneNumber);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_exit_make_call
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_exit_make_call(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_entry_make_call
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_entry_make_call(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 textbuf[MSG_CLUB_CODE_LENGTH];
- S8 textbufucs2[MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH];
- S16 error;
- msg_club_entry_voice_struct *itemInfo = (msg_club_entry_voice_struct*) MSGClubScreen[MSGClubCount].childEntry;
- U16 numType = itemInfo[msg_club_level_2_index].codeType;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CONFIRMATION, mmi_msg_club_exit_make_call, NULL, NULL);
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- memset(g_msg_cntx.smsPhoneNumber, 0, (MAX_DIGITS + 1) * ENCODING_LENGTH);
- AnsiiToUnicodeString(textbufucs2, (S8*) itemInfo[msg_club_level_2_index].codeVoice.codeNum);
- pfnUnicodeStrcpy(g_msg_cntx.smsPhoneNumber, textbufucs2);
- if ((numType & NUMBER_END) == NUMBER_END)
- {
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- ReadRecord(NVRAM_EF_MSG_CLUB_NUM_LID, 1, textbuf, NVRAM_MSG_CLUB_NUM_RECORD_SIZE, &error);
- AnsiiToUnicodeString(textbufucs2, textbuf);
- pfnUnicodeStrcat(g_msg_cntx.smsPhoneNumber, textbufucs2);
- }
- ShowCategory154Screen(
- 0,
- 0,
- STR_GLOBAL_YES,
- IMG_SMS_COMMON_NOIMAGE,
- STR_GLOBAL_NO,
- IMG_SMS_COMMON_NOIMAGE,
- (PU8) get_string_lang(STR_GLOBAL_DIAL, SSC_SCHINESE),
- (PU8) g_msg_cntx.smsPhoneNumber,
- IMG_GLOBAL_QUESTION,
- NULL);
- /*
- * ShowCategory164Screen(STR_GLOBAL_YES, IMG_GLOBAL_YES,
- * STR_GLOBAL_NO, IMG_GLOBAL_NO,
- * STR_GLOBAL_DIAL, IMG_GLOBAL_QUESTION, NULL);
- */
- SetLeftSoftkeyFunction(mmi_msg_club_make_call, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- playRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_send_msg_rsp
- * DESCRIPTION
- *
- * PARAMETERS
- * number [?]
- * mod [IN]
- * result [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_send_msg_rsp(void *number, module_type mod, U16 result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (result)
- {
- case MMI_FRM_SMS_OK:
- DisplayPopup(
- (PU8) GetString(STR_SMS_SEND_SUCCESS),
- IMG_SEND_SUCCESS_PIC_MSG,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- mmi_frm_sms_delete_screen_history();
- AlmEnableSPOF();
- break;
- case MMI_FRM_SMS_ABORT:
- DisplayPopup(
- (PU8) GetString(STR_ABORT_SENDING_SMS),
- IMG_GLOBAL_ACTIVATED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- mmi_frm_sms_delete_screen_history();
- AlmEnableSPOF();
- break;
- case MMI_FRM_SMS_NOTREADY:
- DisplayPopup(
- (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- AlmEnableSPOF();
- break;
- case MMI_FRM_SMS_RETURN:
- case MMI_FRM_SMS_END:
- break;
- default:
- DisplayPopup(
- (PU8) GetString(STR_SMS_SEND_FAILED),
- IMG_SEND_FAIL_PIC_MSG,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- mmi_frm_sms_delete_screen_history();
- AlmEnableSPOF();
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_send_msg_req
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_send_msg_req(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 textbuf[MSG_CLUB_CODE_LENGTH];
- S8 textbufucs2[MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH];
- S8 codebufucs2[(MSG_CLUB_CODE_LENGTH + MSG_CLUB_INPUT_BUFF_LEN) * ENCODING_LENGTH];
- EMSData *pEMS;
- S16 error;
- U8 result;
- history temphistory;
- U8 service = msg_club_level_3_index;
- U8 serviceNum[MSG_CLUB_LONG_CODE_LENGTH + 1];
- U16 serviceType;
- U8 codeNum[MSG_CLUB_LONG_CODE_LENGTH];
- U16 codeType;
- U8 serviceCode[MSG_CLUB_SHORT_CODE_LENGTH * ENCODING_LENGTH];
- U8 servicePrefix = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /****************phone number********************/
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- memset(g_msg_cntx.smsPhoneNumber, 0, (MAX_DIGITS + 1) * ENCODING_LENGTH);
- memset(serviceNum, 0, MSG_CLUB_LONG_CODE_LENGTH + 1);
- if ((MSGClubNetwork == MSG_CLUB_CU) && ((MSGClubSMSItem.strInput_codeCU & 0x0f) > 1))
- {
- memcpy(
- (S8*) & MSGClubSMSItem,
- (S8*) & MenuExtra[(MSGClubSMSItem.strInput_codeCU & 0x0f)],
- sizeof(msg_club_entry_dy_db_zf_struct));
- }
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "service=%d*n", service));
- switch (service)
- {
- case MSG_CLUB_SERVICE_SUBSCRIBE:
- memcpy(
- serviceNum,
- NumService[MSGClubSMSItem.serverType].serverDY[MSGClubNetwork].codeNum,
- MSG_CLUB_LONG_CODE_LENGTH);
- serviceType = NumService[MSGClubSMSItem.serverType].serverDY[MSGClubNetwork].codeType;
- break;
- case MSG_CLUB_SERVICE_ORDER:
- memcpy(
- serviceNum,
- NumService[MSGClubSMSItem.serverType].serverDB[MSGClubNetwork].codeNum,
- MSG_CLUB_LONG_CODE_LENGTH);
- serviceType = NumService[MSGClubSMSItem.serverType].serverDB[MSGClubNetwork].codeType;
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "serviceType=%d*n", serviceType));
- break;
- case MSG_CLUB_SERVICE_EXPLAIN:
- memcpy(
- serviceNum,
- NumService[MSGClubSMSItem.serverType].serverZF[MSGClubNetwork].codeNum,
- MSG_CLUB_LONG_CODE_LENGTH);
- serviceType = NumService[MSGClubSMSItem.serverType].serverZF[MSGClubNetwork].codeType;
- break;
- case MSG_CLUB_SERVICE_CANCEL:
- memcpy(
- serviceNum,
- NumService[MSGClubSMSItem.serverType].serverTD[MSGClubNetwork].codeNum,
- MSG_CLUB_LONG_CODE_LENGTH);
- serviceType = NumService[MSGClubSMSItem.serverType].serverTD[MSGClubNetwork].codeType;
- break;
- }
- /* service number */
- AnsiiToUnicodeString((S8*) textbufucs2, (S8*) serviceNum);
- pfnUnicodeStrcat(g_msg_cntx.smsPhoneNumber, textbufucs2);
- if ((serviceType & NUMBER_END) == NUMBER_END)
- {
- /* handset number */
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- ReadRecord(NVRAM_EF_MSG_CLUB_NUM_LID, 1, textbuf, NVRAM_MSG_CLUB_NUM_RECORD_SIZE, &error);
- AnsiiToUnicodeString(textbufucs2, textbuf);
- pfnUnicodeStrcat(g_msg_cntx.smsPhoneNumber, textbufucs2);
- }
- if ((serviceType & CODE_END) == CODE_END)
- {
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- AnsiiToUnicodeString(textbufucs2, mmi_msg_club_get_number_end());
- pfnUnicodeStrcat(g_msg_cntx.smsPhoneNumber, textbufucs2);
- }
- /* product code */
- ReleaseEMSEditBuffer();
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- memset(codebufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- memset(serviceCode, 0, MSG_CLUB_SHORT_CODE_LENGTH * ENCODING_LENGTH);
- memset(codeNum, 0, MSG_CLUB_LONG_CODE_LENGTH - 1);
- switch (service)
- {
- case MSG_CLUB_SERVICE_SUBSCRIBE:
- memcpy(codeNum, MSGClubSMSItem.codeDY.codeNum, MSG_CLUB_LONG_CODE_LENGTH - 1);
- AnsiiToUnicodeString((S8*) serviceCode, mmi_msg_club_get_code_subscribe());
- codeType = MSGClubSMSItem.codeDY.codeType;
- break;
- case MSG_CLUB_SERVICE_ORDER:
- memcpy(codeNum, MSGClubSMSItem.codeDB.codeNum, MSG_CLUB_LONG_CODE_LENGTH - 1);
- AnsiiToUnicodeString((S8*) serviceCode, mmi_msg_club_get_code_order());
- codeType = MSGClubSMSItem.codeDB.codeType;
- break;
- case MSG_CLUB_SERVICE_EXPLAIN:
- memcpy(codeNum, MSGClubSMSItem.codeZF.codeNum, MSG_CLUB_LONG_CODE_LENGTH - 1);
- AnsiiToUnicodeString((S8*) serviceCode, mmi_msg_club_get_code_explain());
- codeType = MSGClubSMSItem.codeZF.codeType;
- break;
- case MSG_CLUB_SERVICE_CANCEL:
- memcpy(codeNum, MSGClubSMSItem.codeTD.codeNum, MSG_CLUB_SHORT_CODE_LENGTH);
- codeType = 0;
- break;
- }
- if ((codeType & PHONE_PRE) == PHONE_PRE)
- {
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- memset(codebufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- ReadRecord(NVRAM_EF_MSG_CLUB_LID, 1, textbuf, NVRAM_MSG_CLUB_RECORD_SIZE, &error);
- AnsiiToUnicodeString(codebufucs2, textbuf);
- servicePrefix = 1;
- }
- if ((codeType & NUMBER_PRE) == NUMBER_PRE)
- {
- memset(textbuf, 0, MSG_CLUB_CODE_LENGTH);
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- ReadRecord(NVRAM_EF_MSG_CLUB_NUM_LID, 1, textbuf, NVRAM_MSG_CLUB_NUM_RECORD_SIZE, &error);
- AnsiiToUnicodeString(textbufucs2, textbuf);
- pfnUnicodeStrcat(codebufucs2, textbufucs2);
- servicePrefix = 1;
- }
- if (servicePrefix == 1)
- {
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- AnsiiToUnicodeString(textbufucs2, mmi_msg_club_get_code_sms());
- pfnUnicodeStrcat(codebufucs2, textbufucs2);
- }
- if ((codeType & CODE_PRE) == CODE_PRE)
- {
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- AnsiiToUnicodeString(textbufucs2, mmi_msg_club_get_code_dummy());
- pfnUnicodeStrcat(codebufucs2, textbufucs2);
- }
- if (servicePrefix == 1)
- {
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- AnsiiToUnicodeString(textbufucs2, mmi_msg_club_get_code_devide());
- pfnUnicodeStrcat(codebufucs2, textbufucs2);
- }
- if ((codeType & SERVICE_PRE) == SERVICE_PRE)
- {
- pfnUnicodeStrcat(codebufucs2, (S8*) serviceCode);
- }
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- AnsiiToUnicodeString(textbufucs2, (S8*) codeNum);
- pfnUnicodeStrcat(codebufucs2, textbufucs2);
- if ((codeType & SER_END) == SER_END)
- {
- pfnUnicodeStrcat(codebufucs2, (S8*) serviceCode);
- }
- if ((MSGClubInputType & INPUT_CODE) == INPUT_CODE)
- {
- pfnUnicodeStrcat(codebufucs2, MSGClubInputBuff);
- }
- if (MSGClubInputLen2)
- {
- memset(textbufucs2, 0, MSG_CLUB_CODE_LENGTH * ENCODING_LENGTH);
- AnsiiToUnicodeString((S8*) textbufucs2, MSG_CLUB_INPUT_SEPEATE);
- pfnUnicodeStrcat(codebufucs2, textbufucs2);
- pfnUnicodeStrcat(codebufucs2, MSGClubInputBuff2);
- }
- memset(&temphistory, 0, sizeof(temphistory));
- GetHistory(SCR_ID_MSG_WRITE, &temphistory);
- pEMS = GetEMSDataForEdit(0, 0);
- /* NOTE: change function name to a general one!!!! */
- if ((MSGClubInputType & INPUT_CHI) == INPUT_CHI)
- {
- result = AppendEMSString(
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- pEMS,
- (U8*) codebufucs2,
- SMSAL_UCS2_DCS,
- temphistory.guiBuffer);
- }
- else
- {
- result = AppendEMSString(
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- pEMS,
- (U8*) codebufucs2,
- SMSAL_DEFAULT_DCS,
- temphistory.guiBuffer);
- }
- if (result)
- {
- mmi_frm_sms_send_struct *sendData = OslMalloc(sizeof(mmi_frm_sms_send_struct));
- memset((S8*) sendData, 0, sizeof(mmi_frm_sms_send_struct));
- memset(sendData->number, 0, MAX_DIGITS_SMS);
- if (pfnUnicodeStrlen((S8*) smsPhoneNumber))
- {
- UnicodeToAnsii((S8*) sendData->number, (S8*) smsPhoneNumber);
- }
- mmi_frm_sms_send_sms(mmi_msg_club_send_msg_rsp, MOD_MMI, sendData);
- OslMfree(sendData);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_SMS_DOES_NOT_SUPPORT),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_entry_input_sms
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_entry_input_sms(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CLUB_SMS_INPUT, NULL, mmi_msg_club_entry_input_sms, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CLUB_SMS_INPUT);
- if ((MSGClubInputType & INPUT_PWD) == INPUT_PWD)
- {
- ShowCategory5Screen(
- MSGClubTitle2,
- IMG_MESSAGE_CLUB_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_PHONE_NUMBER,
- (U8*) MSGClubInputBuff2,
- MSGClubInputLen2 + 1,
- guiBuffer);
- }
- else
- {
- ShowCategory5Screen(
- MSGClubTitle2,
- IMG_MESSAGE_CLUB_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*) MSGClubInputBuff2,
- MSGClubInputLen2 + 1,
- guiBuffer);
- }
- SetLeftSoftkeyFunction(mmi_msg_club_send_msg, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_club_send_msg, KEY_SEND, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_entry_input_done
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_entry_input_done(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MSGClubInputLen2)
- {
- mmi_msg_club_entry_input_sms();
- }
- else
- {
- mmi_msg_club_send_msg();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_entry_input
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_entry_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CLUB_NUM_INPUT, NULL, mmi_msg_club_entry_input, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CLUB_NUM_INPUT);
- if (((MSGClubInputType & INPUT_NUM) == INPUT_NUM) || ((MSGClubInputType & INPUT_DA) == INPUT_DA))
- {
- ShowCategory5Screen(
- MSGClubTitle,
- IMG_MESSAGE_CLUB_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_PHONE_NUMBER,
- (U8*) MSGClubInputBuff,
- MSGClubInputLen + 1,
- guiBuffer);
- }
- else
- {
- ShowCategory5Screen(
- MSGClubTitle,
- IMG_MESSAGE_CLUB_ID,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
- (U8*) MSGClubInputBuff,
- MSGClubInputLen + 1,
- guiBuffer);
- }
- SetLeftSoftkeyFunction(mmi_msg_club_entry_input_done, KEY_EVENT_UP);
- SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_club_entry_input_done, KEY_SEND, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_pre_entry_send_msg
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_pre_entry_send_msg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MSGClubInputType = 0;
- if (MSGClubInputBuff != NULL)
- {
- OslMfree(MSGClubInputBuff);
- MSGClubInputBuff = NULL;
- }
- if (MSGClubInputBuff2 != NULL)
- {
- OslMfree(MSGClubInputBuff2);
- MSGClubInputBuff2 = NULL;
- }
- if ((msg_club_level_3_index == MSG_CLUB_SERVICE_SUBSCRIBE)
- && ((MSGClubSMSItem.codeDY.codeType & INPUT_CODE) == INPUT_CODE))
- {
- MSGClubInputType = MSGClubSMSItem.codeDY.codeType;
- }
- if ((msg_club_level_3_index == MSG_CLUB_SERVICE_ORDER)
- && ((MSGClubSMSItem.codeDB.codeType & INPUT_CODE) == INPUT_CODE))
- {
- MSGClubInputType = MSGClubSMSItem.codeDB.codeType;
- }
- if ((msg_club_level_3_index == MSG_CLUB_SERVICE_EXPLAIN)
- && ((MSGClubSMSItem.codeZF.codeType & INPUT_CODE) == INPUT_CODE))
- {
- MSGClubInputType = MSGClubSMSItem.codeZF.codeType;
- }
- if (MSGClubInputType)
- {
- if ((MSGClubInputType & INPUT_DA) == INPUT_DA)
- {
- MSGClubInputLen = MSG_CLUB_INPUT_DA_LEN;
- MSGClubTitle = STR_MSG_CLUB_ENTER_QQ;
- }
- else if ((MSGClubInputType & INPUT_NAME) == INPUT_NAME)
- {
- MSGClubInputLen = MSG_CLUB_INPUT_NAME_LEN;
- MSGClubTitle = STR_MSG_CLUB_ENTER_NICKNAME;
- }
- else
- {
- MSGClubInputLen = MSG_CLUB_INPUT_BUFF_LEN;
- if ((MSGClubInputType & INPUT_NUM) == INPUT_NUM)
- {
- MSGClubTitle = STR_MSG_CLUB_ENTER_NUMBER;
- }
- else
- {
- MSGClubTitle = STR_MSG_CLUB_ENTER_NAME;
- }
- }
- MSGClubInputBuff = OslMalloc((MSGClubInputLen + 1) * ENCODING_LENGTH);
- memset(MSGClubInputBuff, 0, (MSGClubInputLen + 1) * ENCODING_LENGTH);
- if ((MSGClubInputType & INPUT_SMS) == INPUT_SMS)
- {
- MSGClubInputLen2 = MSG_CLUB_INPUT_SMS_LEN;
- MSGClubTitle2 = STR_MSG_CLUB_ENTER_MSG;
- }
- else if ((MSGClubInputType & INPUT_PWD) == INPUT_PWD)
- {
- MSGClubInputLen2 = MSG_CLUB_INPUT_PWD_LEN;
- MSGClubTitle2 = STR_MSG_CLUB_ENTER_PWD;
- }
- else
- {
- MSGClubInputLen2 = 0;
- }
- if (MSGClubInputLen2)
- {
- MSGClubInputBuff2 = OslMalloc((MSGClubInputLen2 + 1) * ENCODING_LENGTH);
- memset(MSGClubInputBuff2, 0, (MSGClubInputLen2 + 1) * ENCODING_LENGTH);
- }
- if ((MSGClubSMSItem.strInput_codeCU & 0xf0) > 0)
- {
- mmi_msg_club_pre_entry_input();
- }
- else
- {
- mmi_msg_club_entry_input();
- }
- }
- else
- {
- mmi_msg_club_send_msg();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_highlight_subscribe
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_highlight_subscribe(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_club_pre_entry_send_msg,
- GoBackHistory);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- msg_club_level_3_index = MSG_CLUB_SERVICE_SUBSCRIBE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_highlight_order
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_highlight_order(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_club_pre_entry_send_msg,
- GoBackHistory);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- msg_club_level_3_index = MSG_CLUB_SERVICE_ORDER;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_highlight_explain
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_highlight_explain(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_club_pre_entry_send_msg,
- GoBackHistory);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- msg_club_level_3_index = MSG_CLUB_SERVICE_EXPLAIN;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_club_highlight_quit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_club_highlight_quit(void)