📄 mmismssend.c
字号:
{
mmi_dialog_information_screen(win,TxtNotImplemented, "NOT ALLOWED", (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_NOT_ALLOWED);
}
else
{
if (!smsidle_get_ready_state())
{
// SMS init processing not ready to access SIM to store the SMS
mmi_dialog_information_screen(win,TxtPleaseWait, "NOT READY", (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_SC_NOT_READY);
// Recreate the editor on dialog callback
}
else
{
//END TB
// First check if the SMS center is specified
SmsSend_get_config_data(&sms_parameter);
if(sms_parameter.sc_addr[0] EQ '\0')
{
memset(data->edt_data.CentreBuffer,0,NUMBER_LENGTH);
}
else
{
strncpy((char *)data->edt_data.CentreBuffer, (char *)sms_parameter.sc_addr, NUMBER_LENGTH);
}
}
}
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
AUI_edit_SetDefault(&editor_data);
AUI_edit_SetDisplay(&editor_data, CENTRE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
AUI_edit_SetEvents(&editor_data, 0, FALSE, FOREVER, (T_AUI_EDIT_CB)SmsSend_SCNBEDIT_edit_cb);
AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtServiceCentre, NULL);
AUI_edit_SetAltTextStr(&editor_data, 1, TxtNames, TRUE, TxtSoftBack);
AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE);
AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, data->edt_data.CentreBuffer, NUMBER_LENGTH);
data->number_editor = AUI_edit_Start(data->win, &editor_data);
#else /* NEW_EDITOR */
SmsSend_loadEditDefault(&editor_data);
bookSetEditAttributes( CENTRE_EDITOR, COLOUR_EDITOR_XX,0,edtCurBar1, 0,
(char *) data->edt_data.CentreBuffer, NUMBER_LENGTH, &editor_data.editor_attr);
editor_data.TextId = TxtServiceCentre;
editor_data.editor_attr.text = (char *)data->edt_data.CentreBuffer;
editor_data.editor_attr.size = NUMBER_LENGTH;
editor_data.LeftSoftKey = TxtSoftOK;
editor_data.AlternateLeftSoftKey = TxtNames;
editor_data.RightSoftKey = TxtDelete;
editor_data.Identifier = NULL;
editor_data.Callback = (T_EDIT_CB)SmsSend_SCNBEDIT_edit_cb;
editor_data.mode = E_EDIT_DIGITS_MODE;
editor_data.destroyEditor = FALSE;
data->number_editor = editor_start(data->win,&editor_data);
#endif /* NEW_EDITOR */
/* start the editor */
break;
default:
TRACE_EVENT("Err: Default");
break;
}
}
/*******************************************************************************
$Function: SmsSend_CENTREEDIT_exec_cb
$Description: Callback handler for events sent by the CENTREEDIT editor
$Returns: none
$Arguments: win - current window
event - event id
parameter - optional data.
*******************************************************************************/
static void SmsSend_CENTREEDIT_exec_cb(T_MFW_HND win, USHORT event, void *parameter)
{
T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
T_SEND * data = (T_SEND *)win_data->user;
#ifdef NEW_EDITOR
T_AUI_EDITOR_DATA editor_data; /* SPR#1428 - SH - New Editor data */
#else
T_EDITOR_DATA editor_data;
#endif
TRACE_FUNCTION ("SmsSend_CENTREEDIT_exec_cb()");
switch (event)
{
case E_INIT:
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
AUI_edit_SetDefault(&editor_data);
AUI_edit_SetDisplay(&editor_data, CENTRE_EDITOR, COLOUR_EDITOR_XX, EDITOR_FONT);
AUI_edit_SetEvents(&editor_data, *(USHORT*)parameter, TRUE, FOREVER, (T_AUI_EDIT_CB)SmsSend_CENTREEDIT_edit_cb);
AUI_edit_SetTextStr(&editor_data, TxtSoftOK, TxtDelete, TxtServiceCentre, NULL);
AUI_edit_SetAltTextStr(&editor_data, 1, TxtNull, TRUE, TxtSoftBack);
AUI_edit_SetMode(&editor_data, 0, ED_CURSOR_UNDERLINE);
AUI_edit_SetBuffer(&editor_data, ATB_DCS_ASCII, data->edt_data.CentreBuffer, PHB_MAX_LEN);
data->sc_number_editor = AUI_edit_Start(data->win, &editor_data);
#else /* NEW_EDITOR */
SmsSend_loadEditDefault(&editor_data);
bookSetEditAttributes( CENTRE_EDITOR, COLOUR_EDITOR_XX, 0, edtCurBar1, 0,
(char *) data->edt_data.CentreBuffer, NUMBER_LENGTH, &editor_data.editor_attr);
editor_data.TextId = TxtServiceCentre;
editor_data.editor_attr.text = (char *)data->edt_data.CentreBuffer;
editor_data.editor_attr.size = PHB_MAX_LEN;
editor_data.LeftSoftKey = TxtSoftOK;
editor_data.RightSoftKey = TxtDelete;
editor_data.Identifier = *(USHORT*)parameter;
editor_data.Callback = (T_EDIT_CB)SmsSend_CENTREEDIT_edit_cb;
editor_data.mode = E_EDIT_DIGITS_MODE;
editor_data.destroyEditor = TRUE ;
data->sc_number_editor = editor_start(data->win,&editor_data);
/* start the Service Centre Number editor */
#endif /* NEW_EDITOR */
break;
case E_RETURN:
break;
default:
TRACE_EVENT("Err: Default");
return;
}
}
/*******************************************************************************
$Function: SmsSend_TEXTEDIT_edit_cb
$Description: Callback function for the text editor
$Returns: none
$Arguments: win - current window
Identifier - unique id
reason - event cause
*******************************************************************************/
static void SmsSend_TEXTEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
{
T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
T_SEND * data = (T_SEND *)win_data->user;
TRACE_FUNCTION ("SmsSend_TEXTEDIT_edit_cb()");
switch (reason)
{
case INFO_KCD_ALTERNATELEFT:
case INFO_KCD_LEFT:
data->options_win = SmsSend_OPT_start(win,(MfwMnuAttr*)&SmsSend_R_OPTAttrib);
/* Create number editor:
-the editor min length is 1
*/
break;
case INFO_KCD_RIGHT:
case INFO_KCD_HUP:
// Commit suicide so come back to previous menu
#if defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED)
if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
chinese_input_destroy(data->text_editor);
else
#endif
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
AUI_edit_Destroy(data->text_editor);
#else /* NEW_EDITOR */
editor_destroy(data->text_editor);
#endif /* NEW_EDITOR */
data->text_editor = 0;
SmsSend_SEND_destroy(data->win);
break;
default:
TRACE_EVENT("Err: Default");
break;
}
}
/*******************************************************************************
$Function: SmsSend_NBEDIT_edit_cb
$Description: Callback function for the number editor
$Returns: none
$Arguments: win - current window
Identifier - unique id
reason - event cause
*******************************************************************************/
static void SmsSend_NBEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
{
T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
T_SEND * data = (T_SEND *)win_data->user;
T_MFW_SMS_INFO sms_parameter;
USHORT parameter;
TRACE_FUNCTION ("SmsSend_NBEDIT_edit_cb()");
switch (reason)
{
case INFO_KCD_LEFT:
// Check if we can go to the next stage
if ((phb_get_mode() EQ PHB_RESTRICTED)
&& (phb_check_number(data->edt_data.NumberBuffer) EQ MFW_PHB_FAIL))
{
mmi_dialog_information_screen(win,TxtNotImplemented, "NOT ALLOWED", (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_NOT_ALLOWED);
}
else
{
if (!smsidle_get_ready_state())
{
// SMS init processing not ready to access SIM to store the SMS
mmi_dialog_information_screen(win,TxtPleaseWait, "NOT READY", (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_SC_NOT_READY);
// Recreate the editor on dialog callback
}
else
{
//END TB
// First check if the SMS center is specified
SmsSend_get_config_data(&sms_parameter);
if(sms_parameter.sc_addr[0] EQ '\0')
{
//setup identifier value.
parameter = SMSSEND_ID_CENTREEDIT;
SmsSend_CENTREEDIT_exec_cb(win, E_INIT,(void*)¶meter);
}
else
{
/*NM FTA 34.2.8*/
if (data->edt_data.called_from_reply_item EQ FALSE)
{
TRACE_EVENT("take the own serviceCenternum");
strcpy((char *)data->edt_data.CentreBuffer, (char *)sms_parameter.sc_addr);
{
char buf[30];
sprintf(buf,"serviceNr:%s",data->edt_data.CentreBuffer);
TRACE_EVENT(buf);
}
}
else
{
TRACE_EVENT("from the caller, reply");
/* in case of reply the sms, we took already the
the service center number from the caller !!!*/
{
char buf[30];
sprintf(buf,"serviceNr:%s",data->edt_data.CentreBuffer);
TRACE_EVENT(buf);
}
}
/*NM FTA 34.2.8*/
SmsSend_send_to_mfw(win);
}
}
}
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
AUI_edit_Destroy(data->number_editor);
#else /* NEW_EDITOR */
editor_destroy(data->number_editor);
#endif /* NEW_EDITOR */
data->number_editor = 0;
SmsSend_R_OPT_destroy(data->options_win);
break;
case INFO_KCD_ALTERNATELEFT:
bookPhonebookStart(win, PhbkFromSms);
break;
case INFO_KCD_RIGHT:
case INFO_KCD_HUP:
/* SPR#1428 - SH - New Editor changes */
#ifdef NEW_EDITOR
AUI_edit_Destroy(data->number_editor);
#else /* NEW_EDITOR */
editor_destroy(data->number_editor);
#endif /* NEW_EDITOR */
data->number_editor = 0;
break;
default:
TRACE_EVENT("Err: Default");
break;
}
}
/*******************************************************************************
$Function: SmsSend_CENTREEDIT_edit_cb
$Description: Callback function for the center number editor
$Returns: none
$Arguments: win - current window
Identifier - unique id
reason - event cause
*******************************************************************************/
static void SmsSend_CENTREEDIT_edit_cb (T_MFW_HND win, USHORT Identifier, SHORT reason)
{
T_MFW_WIN * win_data = ((T_MFW_HDR *) win)->data;
T_SEND * data = (T_SEND *)win_data->user;
TRACE_FUNCTION ("SmsSend_CENTREEDIT_edit_cb()");
switch (reason)
{
case INFO_KCD_LEFT:
TRACE_EVENT("SmsSend_CENTREEDIT_edit_cb,INFO_KCD_LEFT ");
if (Identifier==SMSSEND_ID_CENTREEDIT)
{
TRACE_EVENT("SmsSend_CENTREEDIT_edit_cb,INFO_KCD_LEFT Send to mfw ");
//Submit the SMS message to the service centre.
SmsSend_send_to_mfw(win);
}
break;
case INFO_KCD_RIGHT:
case INFO_KCD_HUP:
/* send an event that will lead to the display of the number edition window */
SEND_EVENT (win, E_RETURN, SMSSEND_ID_CENTREEDIT, NULL);
break;
default:
break;
}
}
/*******************************************************************************
$Function: SmsSend_SEND_mfw_cb
$Description: Callback functyion for handling SMS events from the MFW.
$Returns: execution status
$Arguments: event - window event id
info - optional info
reason - event cause
*******************************************************************************/
static int SmsSend_SEND_mfw_cb (MfwEvt event, void *info)
{
/* get the top window*/
T_MFW_HND win = mfw_parent(mfw_header());
T_MFW_WIN * win_data = ((T_MFW_HDR *)win)->data;
T_SEND * data = (T_SEND *)win_data->user;
TRACE_FUNCTION ("SmsSend_SEND_mfw_cb()");
switch (event)
{
case E_SMS_MO_AVAIL:
TRACE_EVENT ("Sent was successful -> ok");
/* Sent was successful */
/* abort the current Dialog "Please wait" */
if (data->child_dialog != NULL)
{
SEND_EVENT (data->child_dialog, DIALOG_DESTROY, 0, NULL);
data->child_dialog = NULL;
}
//GW Display sent not send
mmi_dialog_information_screen(win,TxtSent, "SENT", (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_SENT);
data->id = SMSSEND_ID_SENT;
break;
case E_SMS_ERR:
// Waiting dialog is destroyed
if (data->child_dialog != NULL)
{
SEND_EVENT (data->child_dialog, DIALOG_DESTROY, 0, NULL);
data->child_dialog = NULL;
}
// and the status dialog is displayed during 3 secs.
mmi_dialog_information_screen(win,TxtNotSent, "NOT SENT", (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_NOT_SENT);
data->id = SMSSEND_ID_NOT_SENT; //TB3
break;
default:
TRACE_EVENT("Err: default");
return 0;
}
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -