CellBroadcast.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:177k
源码类别:
MTK
开发平台:
C/C++
- else if (GetMessagesCurrScrnID() == SCR_ID_MSG_CB_MESSAGE_LIST)
- {
- mmi_msg_entry_cb_read_message();
- DeleteScreenIfPresent(SCR_ID_MSG_CB_MESSAGE_LIST);
- }
- WriteCBMessageInfoToNvram(); /* ->no need!!! only write when shut down: check if ok */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_delete_new_cb_message
- * DESCRIPTION
- * Delete new CB message
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_delete_new_cb_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteCBMessage((S32) cbMsgIndex.currCBIndex);
- cb_display.unread[cbMsgIndex.currCBIndex] = FALSE;
- if (cbMsgIndex.currCBIndex < cbMsgIndex.currCBTotal)
- {
- S8 i = 0;
- for (i = cbMsgIndex.currCBIndex; i < cbMsgIndex.currCBTotal; i++)
- {
- cb_display.unread[i] = cb_display.unread[i + 1];
- }
- cb_display.unread[i] = FALSE;
- }
- WriteCBMessageInfoToNvram();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_new_cb_ind
- * DESCRIPTION
- * Reset CB unread index before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_new_cb_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_display.unread[cbMsgIndex.currCBIndex] = FALSE;
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_new_cb_ind
- * DESCRIPTION
- * Reset CB unread index before go to idle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_new_cb_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(&cb_display.unread, 0, MAX_STORE_CB_MSG);
- ExecCurrEndKeyDownHandler();
- }
- #ifdef __MMI_MESSAGES_TWO_CB_MODES_DISPLAY__
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_get_new_cb_ind_string
- * DESCRIPTION
- * Get new msg indication string
- * PARAMETERS
- * void
- * RETURNS
- * new msg indication string
- *****************************************************************************/
- U8 *mmi_msg_get_new_cb_ind_string(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0;
- U8 number[(MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1) * ENCODING_LENGTH];
- static S8 temp[(MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1) * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(number, 0, MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1);
- for (i = 0; i < cb_info.totalmi; i++)
- {
- if ((cb_info.cbchnlentry[i].mi == cbMsgInfo.MsgMI[cbMsgIndex.currCBIndex]) &&
- (strlen((S8*) cb_info.cbchnlentry[i].name) > 0))
- {
- break;
- }
- }
- if (i < cb_info.totalmi)
- {
- if (cb_info.cbchnlentry[i].dcs == PHB_ASCII)
- {
- AnsiiToUnicodeString(temp, (S8*) cb_info.cbchnlentry[i].name);
- }
- else
- {
- pfnUnicodeStrcpy(temp, (S8*) cb_info.cbchnlentry[i].name);
- }
- }
- else
- {
- sprintf((PS8) number, "%d", cbMsgInfo.MsgMI[cbMsgIndex.currCBIndex]);
- AnsiiToUnicodeString(temp, (S8*) number);
- }
- return (U8*) temp;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_new_cb_immediate_ind
- * DESCRIPTION
- * Entry new CB indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_new_cb_immediate_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 page = (U16) cbMsgInfo.MsgPage[cbMsgIndex.currCBIndex] * NVRAM_SMS_CB_SMS_PAGE_SIZE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_MESSAGE_IDLE, mmi_msg_exit_generic, NULL, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*---[CellBroadcast.c] EntryScrCBMessageBodyWhenIdle ---*n"));
- GetCurrEndKeyDownHandler();
- ReadCBMessageContent(
- (PU32) & dispCBLength,
- cbMsgIndex.pCBMsgContent[cbMsgIndex.currCBIndex],
- page,
- cbMsgInfo.MsgDCS[cbMsgIndex.currCBIndex]);
- if (!IsKeyPadLockState()) /* keypad is unlocked */
- {
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_MESSAGE_IDLE);
- GetCurrEndKeyDownHandler();
- ShowCategory74Screen(
- STR_CB_MSG_IND_INFORMATION_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_DELETE,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (PU8) dispCBMessage,
- (S32) dispCBLength,
- NULL);
- SetLeftSoftkeyFunction(mmi_msg_delete_new_cb_message, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_new_cb_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_new_cb_ind, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_pre_entry_cb_idle_use_number, KEY_SEND, KEY_EVENT_UP);
- }
- else /* keypad is locked */
- {
- ShowCategory74Screen(
- STR_CB_MSG_IND_INFORMATION_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- (PU8) dispCBMessage,
- (S32) dispCBLength,
- NULL);
- /* prevent category scrolling */
- SetKeyHandler(NULL, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_new_cb_normal_ind
- * DESCRIPTION
- * Entry new CB indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_new_cb_normal_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_MESSAGE_IND, mmi_msg_exit_generic, NULL, NULL);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_MESSAGE_IND);
- GetCurrEndKeyDownHandler();
- if (!IsKeyPadLockState()) /* keypad is unlocked */
- {
- 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_cb_ind_string(),
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_new_cb_ind, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_msg_entry_new_cb_immediate_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_new_cb_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_cb_ind_string(),
- IMG_NEW_MESSAGE_NOTIFICATION_MSG,
- NULL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_new_cb_ind
- * DESCRIPTION
- * Entry new CB indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_new_cb_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cb_display.immediate[cbMsgIndex.currCBIndex] == TRUE)
- {
- mmi_msg_entry_new_cb_immediate_ind();
- }
- else if (GetMessagesCurrScrnID() != SCR_ID_MSG_CB_MESSAGE_IDLE)
- {
- mmi_msg_entry_new_cb_normal_ind();
- }
- }
- #else /* __MMI_MESSAGES_TWO_CB_MODES_DISPLAY__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_new_cb_ind
- * DESCRIPTION
- * Entry new CB indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_new_cb_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 page = (U16) cbMsgInfo.MsgPage[cbMsgIndex.currCBIndex] * NVRAM_SMS_CB_SMS_PAGE_SIZE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsKeyPadLockState() == 0)
- {
- EntryNewScreen(SCR_ID_MSG_CB_MESSAGE_IDLE, mmi_msg_exit_generic, NULL, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*---[CellBroadcast.c] EntryScrCBMessageBodyWhenIdle ---*n"));
- ReadCBMessageContent(
- (PU32) & dispCBLength,
- cbMsgIndex.pCBMsgContent[cbMsgIndex.currCBIndex],
- page,
- cbMsgInfo.MsgDCS[cbMsgIndex.currCBIndex]);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_MESSAGE_IDLE);
- GetCurrEndKeyDownHandler();
- ShowCategory74Screen(
- STR_CB_MSG_IND_INFORMATION_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_DELETE,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (PU8) dispCBMessage,
- (S32) dispCBLength,
- NULL);
- SetLeftSoftkeyFunction(mmi_msg_delete_new_cb_message, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_new_cb_ind, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_end_key_from_new_cb_ind, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_pre_entry_cb_idle_use_number, KEY_SEND, KEY_EVENT_UP);
- }
- else
- {
- ReadCBMessageContent(
- (PU32) & dispCBLength,
- cbMsgIndex.pCBMsgContent[cbMsgIndex.currCBIndex],
- page,
- cbMsgInfo.MsgDCS[cbMsgIndex.currCBIndex]);
- ShowCategory74Screen(
- STR_CB_MSG_IND_INFORMATION_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- (PU8) dispCBMessage,
- (S32) dispCBLength,
- 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);
- }
- }
- #endif /* __MMI_MESSAGES_TWO_CB_MODES_DISPLAY__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_need_new_cb_ind
- * DESCRIPTION
- * Check if new CB indication is needed
- * PARAMETERS
- * void
- * RETURNS
- * TRUE: indication needed, FALSE: indication not needed
- *****************************************************************************/
- U8 mmi_msg_need_new_cb_ind(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cbMsgIndex.currCBTotal == 0)
- {
- return FALSE;
- }
- for (i = (cbMsgIndex.currCBTotal - 1);; i--)
- {
- if (cb_display.unread[i] == TRUE)
- {
- cbMsgIndex.currCBIndex = i;
- return TRUE;
- }
- if (i == 0)
- {
- break;
- }
- }
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_restore_cb
- * DESCRIPTION
- * Restore CB settings
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_restore_cb(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_DEFAULT_SETTINGS_MODE_STATE;
- SetProtocolEventHandler(mmi_msg_subscribe_cb_rsp, PRT_MSG_ID_MMI_CB_SUBSCRIBE_RSP);
- mmi_msg_subscribe_cb_req(FALSE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_subscribe_cb
- * DESCRIPTION
- * Subscribe CB
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_subscribe_cb(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 mode = !cb_info.mode;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifndef MMI_ON_HARDWARE_P
- cb_info.mode = mode;
- if (cb_info.mode == TRUE)
- {
- pfnUnicodeStrcpy((S8*) cb_display.mode, (S8*) GetString((U16) STR_GLOBAL_ON));
- }
- else
- {
- pfnUnicodeStrcpy((S8*) cb_display.mode, (S8*) GetString((U16) STR_GLOBAL_OFF));
- }
- mmi_msg_refresh_cb_main_menu();
- #else /* MMI_ON_HARDWARE_P */
- ClearKeyHandler(KEY_LSK, KEY_EVENT_UP);
- SetProtocolEventHandler(mmi_msg_subscribe_cb_rsp, PRT_MSG_ID_MMI_CB_SUBSCRIBE_RSP);
- mmi_msg_subscribe_cb_req(mode);
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_save_cb_channel
- * DESCRIPTION
- * Save CB channel info
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_save_cb_channel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 mi = 0;
- U8 number[(MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1) * ENCODING_LENGTH] = {0, 0};
- U16 length;
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((pfnUnicodeStrlen((S8*) cb_display.mi)) == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_SMS_NUM_CANNOT_BE_EMPTY),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- memset(&number, 0, (MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1) * ENCODING_LENGTH);
- length = UnicodeNToAnsii(
- (S8*) number,
- (S8*) cb_display.mi,
- (pfnUnicodeStrlen((S8*) cb_display.mi)) * ENCODING_LENGTH);
- number[length] = ' ';
- mi = atoi((S8*) number);
- if (mi > MAX_CB_CHNL_NUMBER)
- {
- DisplayPopup(
- (PU8) GetString(STR_CB_CHNL_NUMBER_LEN_EXCEEDED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- for (i = 0; i < cb_info.totalmi; i++)
- {
- if ((cb_state == SMS_CB_CHNL_EDIT_STATE) && (i == g_msg_cntx.currHiliteIndex))
- {
- continue;
- }
- if (cb_info.cbchnlentry[i].mi == (U16) mi)
- {
- DisplayPopup(
- (PU8) GetString(STR_CB_CHNL_DUPLICATE_NUMBER_NOT_ALLOWED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- }
- if (cb_state == SMS_CB_CHNL_ADD_STATE)
- {
- mmi_msg_add_cb_channel((U16) mi);
- }
- else
- {
- mmi_msg_edit_cb_channel((U16) mi);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_save_cb_channel
- * DESCRIPTION
- * Save CB channel info
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_save_cb_channel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_save_cb_channel, Messages2GoBackHistory);
- mmi_msg_entry_confirm_generic();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_select_cb_channel
- * DESCRIPTION
- * Select CB channel
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_select_cb_channel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < cb_info.totalmi; i++)
- {
- cb_info.cbchnlentry[i].mask = cb_display.mask[i + 1];
- }
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(mmi_msg_set_cb_mode_rsp, PRT_MSG_ID_MMI_SMS_SET_CB_MODE_RSP);
- mmi_msg_set_cb_mode_req(SMSAL_CB_MI_MASK);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_add_cb_channel
- * DESCRIPTION
- * Add CB channel
- * PARAMETERS
- * mi [IN] Mi to be added
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_add_cb_channel(U16 mi)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_info.cbchnlentry[cb_info.totalmi].index = cb_display.addindex;
- cb_info.cbchnlentry[cb_info.totalmi].mask = 1;
- cb_info.cbchnlentry[cb_info.totalmi].mi = mi;
- memset(cb_info.cbchnlentry[cb_info.totalmi].name, 0, ENCODING_LENGTH);
- if (GetUCS2Flag((PS8) cb_display.name))
- {
- cb_display.dcs = PHB_UCS2;
- }
- else
- {
- cb_display.dcs = PHB_ASCII;
- }
- if (cb_display.dcs == PHB_ASCII)
- {
- UnicodeToAnsii((S8*) cb_info.cbchnlentry[cb_info.totalmi].name, (S8*) cb_display.name);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) cb_info.cbchnlentry[cb_info.totalmi].name, (S8*) cb_display.name);
- }
- cb_info.cbchnlentry[cb_info.totalmi].dcs = cb_display.dcs;
- /* delete if apply new interface */
- memset(cbNvramStruct.chnlNames[cb_info.totalmi].name, 0, MAX_CB_CHNL_NAME_LENGTH + 1);
- memcpy(
- cbNvramStruct.chnlNames[cb_info.totalmi].name,
- (S8*) cb_info.cbchnlentry[cb_info.totalmi].name,
- MAX_CB_CHNL_NAME_LENGTH);
- cbNvramStruct.chnlNames[cb_info.totalmi].name_dcs = cb_display.dcs;
- cbNvramStruct.l4MidIndex[cb_info.totalmi] = cb_display.addindex;
- WriteCbChnlInfoToNvram();
- /* end */
- cb_info.totalmi++;
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(mmi_msg_set_cb_mode_rsp, PRT_MSG_ID_MMI_SMS_SET_CB_MODE_RSP);
- mmi_msg_set_cb_mode_req(SMSAL_CB_MI | SMSAL_CB_MI_MASK);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_edit_cb_channel
- * DESCRIPTION
- * Edit CB channel
- * PARAMETERS
- * mi [IN] Mi to be modified
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_edit_cb_channel(U16 mi)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].mi = mi;
- memset(cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].name, 0, MAX_CB_CHNL_NAME_LENGTH + 1);
- if (GetUCS2Flag((PS8) cb_display.name))
- {
- cb_display.dcs = PHB_UCS2;
- }
- else
- {
- cb_display.dcs = PHB_ASCII;
- }
- if (cb_display.dcs == PHB_ASCII)
- {
- UnicodeNToAnsii(
- (S8*) cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].name,
- (S8*) cb_display.name,
- MAX_CB_CHNL_NAME_LENGTH * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].name, (S8*) cb_display.name);
- }
- cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].dcs = cb_display.dcs;
- /* delete if apply new interface */
- memset(cbNvramStruct.chnlNames[g_msg_cntx.currHiliteIndex].name, 0, MAX_CB_CHNL_NAME_LENGTH + 1);
- memcpy(
- cbNvramStruct.chnlNames[g_msg_cntx.currHiliteIndex].name,
- (S8*) cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].name,
- MAX_CB_CHNL_NAME_LENGTH);
- cbNvramStruct.chnlNames[g_msg_cntx.currHiliteIndex].name_dcs = cb_display.dcs;
- WriteCbChnlInfoToNvram();
- /* end */
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(mmi_msg_set_cb_mode_rsp, PRT_MSG_ID_MMI_SMS_SET_CB_MODE_RSP);
- mmi_msg_set_cb_mode_req(SMSAL_CB_MI);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_delete_cb_channel
- * DESCRIPTION
- * Delete CB channel
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_delete_cb_channel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = (g_msg_cntx.currHiliteIndex + 1); i < cb_info.totalmi; i++)
- {
- memcpy(&cb_info.cbchnlentry[i - 1], &cb_info.cbchnlentry[i], sizeof(msg_cb_channel_struct));
- }
- cb_info.totalmi--;
- cb_info.cbchnlentry[cb_info.totalmi].mi = SMSAL_CB_UNUSED_CBMI;
- cb_info.cbchnlentry[cb_info.totalmi].mask = 0;
- memset(cb_info.cbchnlentry[cb_info.totalmi].name, 0, MAX_CB_CHNL_NAME_LENGTH);
- memset(&cbNvramStruct, 0xff, sizeof(msg_cb_channel_nvram_struct));
- for (i = 0; i < cb_info.totalmi; i++)
- {
- cbNvramStruct.l4MidIndex[i] = cb_info.cbchnlentry[i].index;
- cbNvramStruct.chnlNames[i].name_dcs = cb_info.cbchnlentry[i].dcs;
- memcpy((S8*) cbNvramStruct.chnlNames[i].name, (S8*) cb_info.cbchnlentry[i].name, MAX_CB_CHNL_NAME_LENGTH + 1);
- }
- WriteCbChnlInfoToNvram();
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(mmi_msg_set_cb_mode_rsp, PRT_MSG_ID_MMI_SMS_SET_CB_MODE_RSP);
- mmi_msg_set_cb_mode_req(SMSAL_CB_MI | SMSAL_CB_MI_MASK);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_select_cb_language
- * DESCRIPTION
- * Select CB language
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_select_cb_language(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < cb_info.totaldcs; i++)
- {
- cb_info.cblanentry[i].mask = cb_display.mask[i + 1];
- }
- cb_info.dcsall = cb_display.mask[0];
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(mmi_msg_set_cb_mode_rsp, PRT_MSG_ID_MMI_SMS_SET_CB_MODE_RSP);
- mmi_msg_set_cb_mode_req(SMSAL_CB_DCS_MASK | SMSAL_CB_ALL_LANG);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_refresh_cb_main_menu
- * DESCRIPTION
- * Refresh CB main menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_refresh_cb_main_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetExitScrnID() == SCR_ID_MSG_CB_MAIN_MENU)
- {
- S32 index = GetChildMenuIDIndexByParentMenuID(MESSAGES_MENU_CB_MENUID, MITEM102_CB_SERVICE);;
- if (index != -1)
- {
- Category52ChangeItemDescription(index, cb_display.mode);
- }
- if (cb_info.mode == TRUE)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
- }
- SetLeftSoftkeyFunction(mmi_msg_subscribe_cb, KEY_EVENT_UP);
- RedrawCategoryFunction();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_main_menu
- * DESCRIPTION
- * Entry CB main menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_main_menu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- U8 *popUpList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_MAIN_MENU, mmi_msg_exit_generic, mmi_msg_entry_cb_main_menu, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsMoMtGuiInterface.c] mmi_msg_entry_cb_main_menu -------*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_MAIN_MENU);
- numItems = GetNumOfChild(MESSAGES_MENU_CB_MENUID);
- GetSequenceStringIds(MESSAGES_MENU_CB_MENUID, nStrItemList);
- SetParentHandler(MESSAGES_MENU_CB_MENUID);
- ConstructHintsList(MESSAGES_MENU_CB_MENUID, popUpList);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_MAIN_MENU);
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_MAIN_MENU);
- ShowCategory52Screen(
- STR_CB_MENUENTRY,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- numItems,
- nStrItemList,
- (U16*) gIndexIconsImageList,
- popUpList,
- 0,
- 0,
- guiBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_main_menu
- * DESCRIPTION
- * Get CB mode request before entry CB main menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_main_menu(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX)
- {
- DisplayPopup(
- (PU8) GetString(STR_CB_NOT_READY_YET),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- /* disallow re-entering SMS application when there is a pending SMS job running in the background */
- else if (mmi_frm_sms_check_action_pending())
- {
- DisplayPopup(
- (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- #endif /* MMI_ON_HARDWARE_P */
- cb_state = SMS_CB_SERVICE_MODE_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_active, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_channel_settings
- * DESCRIPTION
- * Entry CB channel settings screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_channel_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 numItems = 0;
- U16 nStrItemList[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_CHANNEL_SETTINGS, mmi_msg_exit_generic, mmi_msg_entry_cb_channel_settings, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsMoMtGuiInterface.c] mmi_msg_entry_option_other -------*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_CHANNEL_SETTINGS);
- numItems = GetNumOfChild(MITEM103_CB_CHANNEL_ENBL_OPTIONS);
- GetSequenceStringIds(MITEM103_CB_CHANNEL_ENBL_OPTIONS, nStrItemList);
- SetParentHandler(MITEM103_CB_CHANNEL_ENBL_OPTIONS);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_CHANNEL_SETTINGS);
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_CHANNEL_SETTINGS);
- ShowCategory52Screen(
- STR102_SCR103_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);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_channel_bootup
- * DESCRIPTION
- * Get CB mode request in bootup procedure.
- * This is for filling up cb_info to display channel name when getting a CB message.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_channel_bootup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_BOOT_UP_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_display, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_channel_select
- * DESCRIPTION
- * Entry CB channel select screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_channel_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 numItems;
- U8 i = 0;
- U8 selectall = TRUE;
- U8 number[MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_CHANNEL_LIST, mmi_msg_exit_generic, mmi_msg_entry_cb_channel_select, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[CellBroadcast.c] mmi_msg_entry_cb_channel_select -------*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_CHANNEL_LIST);
- pfnUnicodeStrncpy(
- (S8*) subMenuDataPtrs[0],
- (S8*) GetString((U16) STR_CB_ALL_CHANNELS_FOR_SELECT),
- MAX_CB_CHNL_NAME_LENGTH * ENCODING_LENGTH);
- for (i = 0; i < cb_info.totalmi; i++)
- {
- if (strlen((S8*) cb_info.cbchnlentry[i].name) == 0)
- {
- memset(number, 0, sizeof(number));
- sprintf((PS8) number, "%d", cb_info.cbchnlentry[i].mi);
- AnsiiToUnicodeString((S8*) subMenuDataPtrs[i + 1], (S8*) number);
- }
- else
- {
- if (cb_info.cbchnlentry[i].dcs == PHB_ASCII)
- {
- AnsiiToUnicodeString((S8*) subMenuDataPtrs[i + 1], (S8*) cb_info.cbchnlentry[i].name);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) subMenuDataPtrs[i + 1], (S8*) cb_info.cbchnlentry[i].name);
- }
- }
- cb_display.mask[i + 1] = cb_info.cbchnlentry[i].mask;
- if (cb_display.mask[i + 1] == 0)
- {
- selectall = FALSE;
- }
- }
- cb_display.mask[0] = selectall;
- numItems = cb_info.totalmi + 1;
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_CHANNEL_LIST);
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_CHANNEL_LIST);
- mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_select_cb_channel, Messages2GoBackHistory);
- SetCheckboxToggleRightSoftkeyFunctions(mmi_msg_entry_confirm_generic, GoBackHistory);
- ShowCategory140Screen(
- STR_CB_SELECT_CHNL,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- numItems,
- (U8 **) subMenuDataPtrs,
- (U8*) cb_display.mask,
- 0,
- guiBuffer);
- SetLeftSoftkeyFunction(special_check_list_handle_left_softkey_up, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_channel_select
- * DESCRIPTION
- * Get CB mode request before enter CB channel select
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_channel_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_CHNL_SELECT_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_display, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_channel_list
- * DESCRIPTION
- * Entry CB channel list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_channel_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- S32 hiliteitem = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_CHANNEL_LIST, mmi_msg_exit_generic, mmi_msg_entry_cb_channel_list, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[CellBroadcast.c] mmi_msg_entry_cb_channel_list -------*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_CHANNEL_LIST);
- if (guiBuffer != NULL)
- {
- hiliteitem = (g_msg_cntx.currHiliteIndex < cb_info.totalmi) ? g_msg_cntx.currHiliteIndex : 0;
- }
- RegisterHighlightHandler(GetHiliteIndex);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_CHANNEL_LIST);
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_CHANNEL_LIST);
- ShowCategory184Screen(
- STR_CB_CHNL_LIST,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- cb_info.totalmi,
- mmi_msg_cb_channel_list_get_item,
- mmi_msg_cb_channel_list_get_hint,
- hiliteitem,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- if (cb_state == SMS_CB_CHNL_EDIT_STATE)
- {
- SetLeftSoftkeyFunction(mmi_msg_pre_entry_cb_channel_edit, KEY_EVENT_UP);
- }
- else
- {
- mmi_msg_set_confirm_screen(STR_GLOBAL_DELETE, mmi_msg_delete_cb_channel, GoBackHistory);
- SetLeftSoftkeyFunction(mmi_msg_entry_confirm_generic, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_cb_channel_list_get_item
- * DESCRIPTION
- * Get CB channel list item
- * PARAMETERS
- * item_index [IN]
- * str_buff [IN]
- * img_buff_p [?]
- * str_img_mask [IN]
- * a(?) [IN] Item index
- * d(?) [IN/OUT] String image mask
- * c(?) [IN/OUT] Image buffer
- * b(?) [IN/OUT] String buffer
- * RETURNS
- * TRUE
- *****************************************************************************/
- pBOOL mmi_msg_cb_channel_list_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 number[MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item_index < 0) || (item_index >= cb_info.totalmi))
- {
- return FALSE;
- }
- if (cb_info.cbchnlentry[item_index].dcs == PHB_ASCII)
- {
- if (strlen((S8*) cb_info.cbchnlentry[item_index].name) == 0)
- {
- memset(number, 0, MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1);
- sprintf((PS8) number, "%d", cb_info.cbchnlentry[item_index].mi);
- AnsiiToUnicodeString((S8*) str_buff, (S8*) number);
- }
- else
- {
- AnsiiToUnicodeString((S8*) str_buff, (S8*) cb_info.cbchnlentry[item_index].name);
- }
- }
- else
- {
- if (pfnUnicodeStrlen((S8*) cb_info.cbchnlentry[item_index].name) == 0)
- {
- memset(number, 0, MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1);
- sprintf((PS8) number, "%d", cb_info.cbchnlentry[item_index].mi);
- AnsiiToUnicodeString((S8*) str_buff, (S8*) number);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) str_buff, (S8*) cb_info.cbchnlentry[item_index].name);
- }
- }
- *img_buff_p = get_image(IMG_CB_CHNL_TITLE);
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_cb_channel_list_get_hint
- * DESCRIPTION
- * Get CB channel list hint
- * PARAMETERS
- * item_index [IN]
- * hint_array [?]
- * a(?) [IN] Item index
- * b(?) [IN/OUT] Hint array
- * RETURNS
- * TRUE: display hint, FALSE: not display hint
- *****************************************************************************/
- S32 mmi_msg_cb_channel_list_get_hint(S32 item_index, UI_string_type *hint_array)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 number[MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (strlen((S8*) cb_info.cbchnlentry[item_index].name) == 0)
- {
- return 0;
- }
- memset(number, 0, MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1);
- sprintf((PS8) number, "%d", cb_info.cbchnlentry[item_index].mi);
- AnsiiNToUnicodeString((S8*) hint_array[0], (S8*) number, MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1);
- return 1;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_channel_add
- * DESCRIPTION
- * Before add CB channel, check if unused CBMI available
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_channel_add(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_CHNL_ADD_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_display, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_channel_list_edit
- * DESCRIPTION
- * Before enter CB channel edit, get chennel list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_channel_list_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_CHNL_EDIT_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_display, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_channel_list_delete
- * DESCRIPTION
- * Before enter CB channel delete, get chennel list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_channel_list_delete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_CHNL_DELETE_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_display, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_set_cb_channel_inline_item
- * DESCRIPTION
- * Set CB channel inline item for channel edit screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_set_cb_channel_inline_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetInlineItemActivation(&wgui_inline_items[0], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation(&wgui_inline_items[1], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation(&wgui_inline_items[2], KEY_LSK, KEY_EVENT_UP);
- SetInlineItemActivation(&wgui_inline_items[3], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
- SetInlineItemCaption(&wgui_inline_items[0], (U8*) GetString(STR_CB_CHNL_TITLE));
- SetInlineItemFullScreenEdit(
- &wgui_inline_items[1],
- STR_CB_CHNL_TITLE_FULL_EDIT,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- (U8*) cb_display.name,
- MAX_CB_CHNL_NAME_LENGTH + 1,
- INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ONE_LESS_CHARACTER | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
- SetInlineFullScreenEditCustomFunction(&wgui_inline_items[1], mmi_msg_inline_generic_custom_function);
- SetInlineItemCaption(&wgui_inline_items[2], (U8*) GetString(STR_CB_CHNL_NUMBER));
- SetInlineItemTextEdit(
- &wgui_inline_items[3],
- (U8*) cb_display.mi,
- MAX_CB_CHNL_NUMBER_LENGTH + 1,
- INPUT_TYPE_NUMERIC);
- DisableInlineItemHighlight(&wgui_inline_items[3]);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_channel_edit
- * DESCRIPTION
- * Entry CB channel edit screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_channel_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 guiBuffer = NULL;
- PU8 inputBuffer = NULL;
- U16 inputBufferSize = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_CHANNEL_EDIT, mmi_msg_exit_cb_channel_edit, NULL, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*---[CellBroadcast.c] EntryScrCBChannelEditor ---*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_CHANNEL_EDIT);
- inputBuffer = GetCurrNInputBuffer(SCR_ID_MSG_CB_CHANNEL_EDIT, &inputBufferSize);
- InitializeCategory57Screen();
- mmi_msg_set_cb_channel_inline_item();
- if (inputBuffer != NULL)
- {
- SetCategory57Data(wgui_inline_items, MAX_CB_CHNL_INLINE_ITEM, inputBuffer);
- }
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_CHANNEL_EDIT);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_CHANNEL_EDIT);
- ShowCategory57Screen(
- STR_CB_CHNL_EDITOR,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_EDIT,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- MAX_CB_CHNL_INLINE_ITEM,
- cbChnlEditorIcons,
- wgui_inline_items,
- 0,
- guiBuffer);
- SetCategory57RightSoftkeyFunctions(mmi_msg_pre_save_cb_channel, GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_exit_cb_channel_edit
- * DESCRIPTION
- * Exit CB channel inline edit screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_exit_cb_channel_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history currHistory;
- U16 inputBufferSize = 0;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes = SCR_ID_MSG_CB_CHANNEL_EDIT;
- SetMessagesCurrScrnID(0);
- currHistory.scrnID = SCR_ID_MSG_CB_CHANNEL_EDIT;
- CloseCategory57Screen();
- currHistory.entryFuncPtr = mmi_msg_entry_cb_channel_edit;
- pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
- GetCategory57History(currHistory.guiBuffer);
- inputBufferSize = (U16) GetCategory57DataSize();
- GetCategory57Data((U8*) currHistory.inputBuffer);
- AddNHistory(currHistory, inputBufferSize);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_channel_edit
- * DESCRIPTION
- * Before edit CB channel, set the item for edit
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_channel_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 number[(MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1) * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].mi > MAX_CB_CHNL_NUMBER_TO_EDIT)
- {
- DisplayPopup(
- (PU8) GetString(STR_CB_CHNL_NUMBER_LEN_EXCEEDED),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- return;
- }
- cb_display.dcs = cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].dcs;
- if (cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].dcs == PHB_ASCII)
- {
- AnsiiToUnicodeString((S8*) cb_display.name, (S8*) cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].name);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) cb_display.name, (S8*) cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].name);
- }
- memset(number, 0, sizeof(number));
- sprintf((S8*) number, "%d", cb_info.cbchnlentry[g_msg_cntx.currHiliteIndex].mi);
- memset(cb_display.mi, 0, sizeof(cb_display.mi));
- AnsiiNToUnicodeString((S8*) cb_display.mi, (S8*) number, strlen((S8*) number));
- mmi_msg_entry_cb_channel_edit();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_language
- * DESCRIPTION
- * Entry CB language list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_language(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U16 numItems;
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_LANGUAGE, mmi_msg_exit_generic, mmi_msg_entry_cb_language, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[CellBroadcast.c] mmi_msg_entry_cb_channel_select -------*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_LANGUAGE);
- pfnUnicodeStrncpy(
- (S8*) subMenuDataPtrs[0],
- (S8*) GetString((U16) STR_CB_ALL_LANGUAGES_FOR_SELECT),
- MAX_CB_CHNL_NAME_LENGTH * ENCODING_LENGTH);
- for (i = 0; i < cb_info.totaldcs; i++)
- {
- pfnUnicodeStrcpy(
- (S8*) subMenuDataPtrs[i + 1],
- (PS8) GetString((U16) LangEnumAndStrID[cb_info.cblanentry[i].dcs][1]));
- cb_display.mask[i + 1] = cb_info.cblanentry[i].mask;
- }
- cb_display.mask[0] = cb_info.dcsall;
- numItems = cb_info.totaldcs + 1;
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_LANGUAGE);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_LANGUAGE);
- mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_select_cb_language, Messages2GoBackHistory);
- SetCheckboxToggleRightSoftkeyFunctions(mmi_msg_entry_confirm_generic, GoBackHistory);
- ShowCategory140Screen(
- STR103_SCR101_CAPTION,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- numItems,
- (U8 **) subMenuDataPtrs,
- (U8*) cb_display.mask,
- 0,
- guiBuffer);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_language
- * DESCRIPTION
- * Before enter CB language screen, get language list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_language(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_state = SMS_CB_LANGUAGE_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_language, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_read_message
- * DESCRIPTION
- * Entry CB message list screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_read_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- S32 hiliteitem = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_MESSAGE_LIST, mmi_msg_exit_generic, mmi_msg_pre_entry_cb_read_message, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[CellBroadcast.c] mmi_msg_entry_cb_channel_list -------*n"));
- memset(&cb_display.unread, 0, MAX_STORE_CB_MSG);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_MESSAGE_LIST);
- if ((guiBuffer != NULL) || (g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes == SCR_ID_MSG_CB_MESSAGE_LIST)
- || (g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes == SCR_ID_MSG_CB_MESSAGE))
- {
- hiliteitem = (g_msg_cntx.currBoxIndex < cbMsgIndex.currCBTotal) ? g_msg_cntx.currBoxIndex : 0;
- }
- RegisterHighlightHandler(GetMsgIndex);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_MESSAGE_LIST);
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_MESSAGE_LIST);
- ShowCategory184Screen(
- STR101_MITEM102_CB_READ_MESSAGE,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- cbMsgIndex.currCBTotal,
- mmi_msg_cb_read_message_get_item,
- NULL,
- hiliteitem,
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_msg_entry_cb_message, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_entry_cb_message, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_read_message
- * DESCRIPTION
- * Before entering CB message list screen, get channel info for display
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_read_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cbMsgIndex.currCBTotal == 0)
- {
- DisplayPopup(
- (PU8) GetString(STR_GLOBAL_EMPTY),
- IMG_GLOBAL_EMPTY,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) EMPTY_LIST_TONE);
- }
- else
- {
- cb_state = SMS_CB_READ_MESSAGE_STATE;
- SetProtocolEventHandler(mmi_msg_get_cb_mode_rsp_display, PRT_MSG_ID_MMI_SMS_GET_CB_MODE_RSP);
- mmi_msg_get_cb_mode_req();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_cb_read_message_get_item
- * DESCRIPTION
- * Get CB message list item
- * PARAMETERS
- * item_index [IN]
- * str_buff [IN]
- * img_buff_p [?]
- * str_img_mask [IN]
- * a(?) [IN] Item index
- * d(?) [IN/OUT] String image mask
- * c(?) [IN/OUT] Image buffer
- * b(?) [IN/OUT] String buffer
- * RETURNS
- * TRUE
- *****************************************************************************/
- pBOOL mmi_msg_cb_read_message_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 number[(MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1) * ENCODING_LENGTH];
- U8 i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item_index < 0) || (item_index >= cbMsgIndex.currCBTotal))
- {
- return FALSE;
- }
- for (i = 0; i < cb_info.totalmi; i++)
- {
- if ((cb_info.cbchnlentry[i].mi == cbMsgInfo.MsgMI[item_index]) &&
- (strlen((S8*) cb_info.cbchnlentry[i].name) > 0))
- {
- break;
- }
- }
- if (i < cb_info.totalmi)
- {
- if (cb_info.cbchnlentry[i].dcs == PHB_ASCII)
- {
- AnsiiToUnicodeString((S8*) str_buff, (S8*) cb_info.cbchnlentry[i].name);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) str_buff, (S8*) cb_info.cbchnlentry[i].name);
- }
- }
- else
- {
- memset(number, 0, MAX_CB_CHNL_NUMBER_DISPLAY_LENGTH + 1);
- sprintf((PS8) number, "%d", cbMsgInfo.MsgMI[item_index]);
- AnsiiToUnicodeString((S8*) str_buff, (S8*) number);
- }
- *img_buff_p = get_image(gIndexIconsImageList[item_index]);
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_go_back_from_cb_message
- * DESCRIPTION
- * Reset current display index before go back screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_go_back_from_cb_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cb_display.currindex = MAX_STORE_CB_MSG;
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_end_key_from_cb_message
- * DESCRIPTION
- * Reset current display index before go to idle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_end_key_from_cb_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall() == FALSE)
- {
- cb_display.currindex = MAX_STORE_CB_MSG;
- }
- ExecCurrEndKeyDownHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_message
- * DESCRIPTION
- * Entry CB message screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer = NULL;
- U16 page;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_MSG_CB_MESSAGE, mmi_msg_exit_generic, mmi_msg_entry_cb_message, NULL);
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*---[CellBroadcast.c] EntryScrCBMessageBody ---*n"));
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_MESSAGE);
- if (guiBuffer == NULL)
- {
- cb_display.currindex = (U8) g_msg_cntx.currBoxIndex;
- }
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_MESSAGE);
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_MESSAGE);
- page = (U16) cbMsgInfo.MsgPage[cb_display.currindex] * NVRAM_SMS_CB_SMS_PAGE_SIZE;
- ReadCBMessageContent(
- (PU32) & dispCBLength,
- cbMsgIndex.pCBMsgContent[cb_display.currindex],
- page,
- cbMsgInfo.MsgDCS[cb_display.currindex]);
- mmi_msg_set_confirm_screen(STR_GLOBAL_DELETE, mmi_msg_delete_cb_message, GoBackHistory);
- GetCurrEndKeyDownHandler();
- ShowCategory74Screen(
- STR_CB_MESSAGE_BODY,
- IMG_SMS_ENTRY_SCRN_CAPTION,
- STR_GLOBAL_DELETE,
- IMG_SMS_COMMON_NOIMAGE,
- STR_GLOBAL_BACK,
- IMG_SMS_COMMON_NOIMAGE,
- (PU8) dispCBMessage,
- (S32) (cbMsgInfo.MsgPage[cb_display.currindex] * NVRAM_SMS_CB_SMS_PAGE_SIZE * ENCODING_LENGTH),
- guiBuffer);
- SetLeftSoftkeyFunction(mmi_msg_entry_confirm_generic, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_msg_go_back_from_cb_message, KEY_EVENT_UP);
- SetKeyHandler(mmi_msg_go_back_from_cb_message, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_end_key_from_cb_message, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(mmi_msg_entry_cb_use_number, KEY_SEND, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_delete_cb_message
- * DESCRIPTION
- * Delete CB message
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_delete_cb_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*---[CellBroadcast.c] mmi_msg_delete_cb_message ---*n"));
- SetMessagesScrnIdDelUpToHistoryNodes(SCR_ID_MSG_CB_MESSAGE);
- if (cbMsgIndex.pCBMsgContent[cb_display.currindex])
- {
- DeleteCBMessage(cb_display.currindex);
- WriteCBMessageInfoToNvram();
- if (cbMsgIndex.currCBTotal == 0)
- {
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_MESSAGE_LIST);
- }
- else
- {
- if (g_msg_cntx.currBoxIndex == (S32) cbMsgIndex.currCBTotal)
- {
- g_msg_cntx.currBoxIndex--;
- }
- else if (g_msg_cntx.currBoxIndex > (S32) cbMsgIndex.currCBTotal)
- {
- g_msg_cntx.currBoxIndex = 0;
- }
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_MESSAGE);
- }
- DisplayPopup(
- (PU8) GetString(STR_MESSAGES_DELETED_ID),
- IMG_GLOBAL_ACTIVATED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) SUCCESS_TONE);
- cb_display.currindex = MAX_STORE_CB_MSG;
- DeleteMessagesHistoryNodes();
- }
- else
- {
- SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_CB_MESSAGE_LIST);
- DisplayPopup(
- (PU8) GetString(STR_CB_ERROR_MESSAGE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- MESSAGES_POPUP_TIME_OUT,
- (U8) ERROR_TONE);
- DeleteMessagesHistoryNodes();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_mode
- * DESCRIPTION
- * Highlight CB mode handler, check current CB mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_subscribe_cb,
- GoBackHistory);
- if (cb_info.mode == TRUE)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, IMG_GLOBAL_OK);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, IMG_GLOBAL_OK);
- }
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_hint_cb_mode
- * DESCRIPTION
- * Hint CB mode handler
- * PARAMETERS
- * index [IN] Current menu index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_hint_cb_mode(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[index], 0, sizeof(hintData[index]));
- pfnUnicodeStrcpy((S8*) hintData[index], (S8*) cb_display.mode);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_read_message
- * DESCRIPTION
- * Highlight CB read message handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_read_message(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_pre_entry_cb_read_message,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_language
- * DESCRIPTION
- * Highlight CB language handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_language(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_pre_entry_cb_language,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_channel_settings
- * DESCRIPTION
- * Highlight CB channel settings handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_channel_settings(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_entry_cb_channel_settings,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_channel_select
- * DESCRIPTION
- * Highlight CB channel select handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_channel_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_pre_entry_cb_channel_select,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_channel_add
- * DESCRIPTION
- * Highlight CB channel add handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_channel_add(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_pre_entry_cb_channel_add,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_channel_edit
- * DESCRIPTION
- * Highlight CB channel edit handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_channel_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_pre_entry_cb_channel_list_edit,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_highlight_cb_channel_delete
- * DESCRIPTION
- * Highlight CB channel delete handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_highlight_cb_channel_delete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_msg_highlight_generic(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- mmi_msg_pre_entry_cb_channel_list_delete,
- GoBackHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_pre_entry_cb_idle_use_number
- * DESCRIPTION
- * Pre -Entry function for CB use number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_pre_entry_cb_idle_use_number(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history h;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- h.scrnID = SCR_ID_MSG_CB_MESSAGE_IDLE;
- #ifdef __MMI_MESSAGES_TWO_CB_MODES_DISPLAY__
- h.entryFuncPtr = mmi_msg_entry_new_cb_immediate_ind;
- #else
- h.entryFuncPtr = mmi_msg_entry_new_cb_ind;
- #endif
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- mmi_msg_entry_cb_use_number();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_msg_entry_cb_use_number
- * DESCRIPTION
- * Entry function for CB use number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_msg_entry_cb_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, "*[CellBroadcast.c] mmi_msg_entry_cb_use_number *n"));
- memset((S8*) number, 0, sizeof(number));
- numbersCount = ObtainNumbersFromMessageText((S8*) number, dispCBMessage, (U16) dispCBLength, 0);
- if (numbersCount > 0)
- {
- EntryNewScreen(SCR_ID_MSG_CB_USE_NUMBER_LIST, mmi_msg_exit_generic, mmi_msg_entry_cb_use_number, NULL);
- GetCurrEndKeyDownHandler();
- guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_CB_USE_NUMBER_LIST);
- RegisterHighlightHandler(GetHiliteIndex);
- SetMessagesCurrScrnID(SCR_ID_MSG_CB_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_new_cb_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
- * InitCellBroadcastProtocolEventHanler
- * DESCRIPTION
- * Init CB protocol event handler
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitCellBroadcastProtocolEventHanler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(mmi_msg_handle_new_cb_ind, PRT_MSG_ID_MMI_CB_MSG_IND);
- }
- /*****************************************************************************
- * FUNCTION
- * InitCBNVRAMData
- * DESCRIPTION
- * Init CB NVRAMData
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitCBNVRAMData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsCBMessageReadOperRequired)
- {
- IsCBMessageReadOperRequired = FALSE;
- #ifdef MMI_ON_WIN32
- cbMsgStart = (U8*) cbMsgContent[0];
- cbMsgIndex.pCBMsgTail = (U8*) cbMsgContent[0];
- #else /* MMI_ON_WIN32 */
- ReadCBMessageInfoFromNvram();
- #endif /* MMI_ON_WIN32 */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * InitCellBroadcastApp
- * DESCRIPTION
- * Init CB application: highlight handler, data structure
- * PARAMETERS
- * void
- * RETURNS
- * the description of return value, if any.(?)
- *****************************************************************************/
- void InitCellBroadcastApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[CellBroadcast.c] InitCellBroadcastApp*n"));
- /* Set Hilite Handlers */
- SetHiliteHandler(MITEM102_CB_SERVICE, mmi_msg_highlight_cb_mode);
- SetHintHandler(MITEM102_CB_SERVICE, mmi_msg_hint_cb_mode);
- SetHiliteHandler(MITEM102_CB_READ_MESSAGE, mmi_msg_highlight_cb_read_message);
- SetHiliteHandler(MITEM102_CB_LANGUAGE, mmi_msg_highlight_cb_language);
- SetHiliteHandler(MITEM102_CB_CHANNELS, mmi_msg_highlight_cb_channel_settings);
- SetHiliteHandler(MITEM104_CB_CHANNEL_ADD, mmi_msg_highlight_cb_channel_add);
- SetHiliteHandler(MITEM104_CB_CHANNEL_EDIT, mmi_msg_highlight_cb_channel_edit);
- SetHiliteHandler(MITEM104_CB_CHANNEL_DELETE, mmi_msg_highlight_cb_channel_delete);
- SetHiliteHandler(MITEM104_CB_CHANNEL_SELECT, mmi_msg_highlight_cb_channel_select);
- }
- /*****************************************************************************
- * FUNCTION
- * ResetCBInfoStructs
- * DESCRIPTION
- * Reset Cb info structures
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResetCBInfoStructs(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[CellBroadcast.c] ResetCBInfoStructs*n"));
- memset(&cbNvramStruct, 0, sizeof(msg_cb_channel_nvram_struct));
- memset(&cbMsgInfo, 0, sizeof(msg_cb_msg_info_struct));
- memset(&cbMsgContent, 0, sizeof(msg_cb_msg_content_struct) * MAX_CB_MSG_TOTAL_PAGE * NVRAM_SMS_CB_SMS_PAGE_SIZE);
- memset(&cbMsgIndex, 0, sizeof(msg_cb_msg_index_struct));
- #ifndef MMI_ON_HARDWARE_P
- cb_info.mode = TRUE;
- pfnUnicodeStrcpy((S8*) cb_display.mode, (S8*) GetString((U16) STR_GLOBAL_ON));
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * DeInitCellBroadcastApp
- * DESCRIPTION
- * Deinit Cb applications: reset data structures, write CB message to NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DeInitCellBroadcastApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*---[CellBroadcast.c] DeInitCellBroadcastApp ---*n"));
- WriteCBMessageInfoToNvram();
- memset(&cbNvramStruct, 0, sizeof(msg_cb_channel_nvram_struct));
- memset(&cbMsgIndex, 0, sizeof(msg_cb_msg_info_struct));
- memset(&cbMsgContent, 0, sizeof(msg_cb_msg_content_struct) * MAX_CB_MSG_TOTAL_PAGE * NVRAM_SMS_CB_SMS_PAGE_SIZE);
- memset(&cbMsgIndex, 0, sizeof(msg_cb_msg_index_struct));
- }
- #endif /* __MOD_SMSAL__ */
- ////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////