📄 mmiqq.c
字号:
tBookStandard *data = (tBookStandard *)win_Data->user;
T_MFW_HND win;
UBYTE* pstrinfo;
char info[20];
USHORT outLen;
T_MFW_SMS_INFO sms_parameter;
char sc_addr[MAX_LEN]; /* service centre address */
MmiTrace("Ask_QQ_number");
if( strlen(QQSernumber)==0 )
{//no network
QQShowInformation( win, TxtNoNetwork,0, NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
if( !smsidle_get_ready_state() )
{
QQShowInformation( parent_window,TxtNotReady, TxtSim,NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
SmsSend_get_config_data(&sms_parameter);
wstrcpy(sc_addr, (char *)sms_parameter.sc_addr);
wstrcpy(info,"8801");
pstrinfo = mmi_Sys_Sim((char *)info, &outLen,&(sms_parameter.dcs));
SmsSend_set_dcs_number (&sms_parameter);
QQsend.QQsendmsg=ask_QQ_num;
sms_submit(MFW_SMS_SUBMIT,QQSernumber,(UBYTE *)pstrinfo,outLen,sc_addr);
QQsend.sendingwin=QQShowInformation( win, 0, TxtSending,QQSernumber,FOREVER,SMS_SENDING_MSG,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
int Cancel_QQ_Bind(MfwMnu* m, MfwMnuItem* i)
{
T_MFW_HND parent_window = mfw_parent(mfw_header());
T_MFW_WIN * win_Data = ((T_MFW_HDR *)parent_window)->data;
tBookStandard *data = (tBookStandard *)win_Data->user;
T_MFW_HND win;
UBYTE* pstrinfo;
char info[20];
USHORT outLen;
T_MFW_SMS_INFO sms_parameter;
char sc_addr[MAX_LEN]; /* service centre address */
MmiTrace("Cancel_QQ_Bind");
if( strlen(QQSernumber)==0 )
{//no network
QQShowInformation( win, TxtNoNetwork,0, NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
if( !smsidle_get_ready_state() )
{
QQShowInformation( parent_window,TxtNotReady ,TxtSim,NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
SmsSend_get_config_data(&sms_parameter);
wstrcpy(sc_addr, (char *)sms_parameter.sc_addr);
wstrcpy(info,"QXBD");
pstrinfo = mmi_Sys_Sim((char *)info, &outLen,&(sms_parameter.dcs));
SmsSend_set_dcs_number (&sms_parameter);
QQsend.QQsendmsg=ask_QQ_num;
sms_submit(MFW_SMS_SUBMIT,QQSernumber,(UBYTE *)pstrinfo,outLen,sc_addr);
QQsend.sendingwin=QQShowInformation( win, 0, TxtSending,QQSernumber,FOREVER,SMS_SENDING_MSG,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
int Set_QQ_Bind(MfwMnu* m, MfwMnuItem* i)
{
T_MFW_HND parent_window = mfw_parent(mfw_header());
//T_MFW_WIN * win_Data = ((T_MFW_HDR *)parent_window)->data;
//tBookStandard *data = (tBookStandard *)win_Data->user;
T_MFW_HND win;
U16 memoryleft;
MmiTrace("Set_QQ_Bind");
MmiTrace("mem");
memoryleft=mfwCheckMemoryLeft();
MmiTraceInt(memoryleft);
if( strlen(QQSernumber)==0 )
{//no network
QQShowInformation( parent_window, TxtNoNetwork,0,NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
return MFW_EVENT_CONSUMED;
}
/* allocate window, and if successful initialise it
*/
if( ( win = SetQQBind_create( parent_window) ) != NULL )
SEND_EVENT( win, INPUT_NUMBER, 0, 0 );
return MFW_EVENT_CONSUMED;
}
/*******************************************************************************
$Function: SetQQBind_create
$Description:
$Returns:
$Arguments:
*******************************************************************************/
static T_MFW_HND SetQQBind_create (T_MFW_HND parent_window)
{
T_MFW_WIN *win_data;
tQQStandard *data;
T_QQ *QQ;
MmiTrace("SetQQBind_create");
/* allocate memory for our control block
*/
if( (QQ = (T_QQ*) ALLOC_MEMORY( sizeof( T_QQ ) ) ) == NULL )
return NULL;
if( ( data = (tQQStandard *) ALLOC_MEMORY( sizeof( tQQStandard ) ) ) == NULL )
{
FREE_MEMORY( (void *)QQ, sizeof( T_QQ ) );
return NULL;
}
/* Create the window if we can
*/
if( ( data->win = win_create( parent_window, 0, E_WIN_VISIBLE, (T_MFW_CB) SetQQBind_win_cb ) ) == NULL )
{
FREE_MEMORY( (void *)QQ, sizeof( T_QQ ) );
FREE_MEMORY( (void *)data, sizeof( tQQStandard ) );
return NULL;
}
/* Okay, we have created the control block and the window, so
we now need to configure the dialog and data pointers
*/
data->mmi_control.dialog = (T_DIALOG_FUNC) SetQQBind_dialog;
data->mmi_control.data = data;
win_data = ((T_MFW_HDR *)data->win)->data;
win_data->user = (void *) data;
data->QQ =QQ;
data->parent_win = parent_window;
//data->kbd = kbdCreate( data->win, KEY_ALL , (MfwCb) SetQQBind_kbd_cb );
memset( data->QQ->edt_buf_number, 0, MAX_QQ_NUMBER+3 );
memset( data->QQ->edt_buf_password, 0,MAX_QQ_PW+3);
/* And return the handle of the newly created window
*/
MmiTrace("creat_SetQQBind_win");
MmiTraceInt(data->win);
return data->win;
}
/*******************************************************************************
$Function: SetQQBind_destroy
$Description:
$Returns:
$Arguments:
*******************************************************************************/
static void SetQQBind_destroy (T_MFW_HND own_window)
{
T_MFW_WIN *win = ((T_MFW_HDR *) own_window)->data;
tQQStandard *data = (tQQStandard *) win->user;
U16 memoryleft;
MmiTrace("SetQQBind_destroy");
ReadbtnShow=0;
if( data )
{
winDelete ( data->win );
if( data->QQ!=NULL )
FREE_MEMORY( (void *)data->QQ, sizeof( T_QQ ) );
if( data!=NULL )
FREE_MEMORY( (void *)data, sizeof( tQQStandard ) );
}
MmiTrace("mem");
memoryleft=mfwCheckMemoryLeft();
MmiTraceInt(memoryleft);
}
/*******************************************************************************
$Function: E2CInput_win_cb
$Description:
$Returns:
$Arguments:
*******************************************************************************/
static int SetQQBind_win_cb (T_MFW_EVENT event, T_MFW_WIN * win)
{
tQQStandard *data = (tQQStandard *) win->user;
MmiTrace("SetQQBind_win_cb");
/* Handle the visible event, otherwise return MFW_EVENT_PASSED
*/
switch( event )
{
case MfwWinVisible:
{
}
break;
default:
{
/* unabel to handle event, pass handling of event back up tree
*/
return MFW_EVENT_PASSED;
}
}
/* if we get here, we have handled the event
*/
return MFW_EVENT_CONSUMED;
}
//get the phone friend list to show
static void SetQQBind_dialog(T_MFW_HND win, USHORT event, SHORT value, void *parameter)
{
T_MFW_WIN *win_data = ((T_MFW_HDR *) win)->data;
tQQStandard *data = (tQQStandard *) win_data->user;
int i=0;
MmiTrace("SetQQBind_dialog");
switch( event )
{
case QQ_INIT:
case INPUT_NUMBER:
{
CanReadQQ=1;
data->QQ->EditMODE=EditNUMBER;
editor_attr_init_only(&data->editor_data.editor_attr,2,40,118,35,TITLE_TOP,TxtBindQQ,NULL,MAX_QQ_NUMBER+3,edtCurBar1,0);
data->editor_data.hide = FALSE;
data->editor_data.edtInPbk = 1;
data->editor_data.min_enter = MAX_QQ_NUMBER+3;
data->editor_data.Identifier = 0xFFFF;
data->editor_data.timeout = FOREVER;
data->editor_data.destroyEditor = FALSE;
data->editor_data.editor_attr.text = (char *)data->QQ->edt_buf_number;
data->editor_data.TextId = TxtPhbkNumber;
data->editor_data.AlternateLeftSoftKey = TxtNull;
data->editor_data.LeftSoftKey = TxtNull;
data->editor_data.RightSoftKey = TxtDelete;
data->editor_data.mode = PHONENUMONLY_MODE;
data->editor_data.Callback = (T_EDIT_CB)SetQQBind_CB;
data->QQ->editorNumberwin= editor_start(win, &data->editor_data); /* start the editor */
}
break;
case INPUT_PW:
{
CanReadQQ=1;
data->QQ->EditMODE=EditPW;
editor_attr_init_only(&data->editor_data.editor_attr,2,102,118,35,TITLE_TOP,TxtBindQQ,NULL,MAX_QQ_PW+3,edtCurBar1,0);
data->editor_data.hide = FALSE;
data->editor_data.min_enter = MAX_QQ_PW+3;
data->editor_data.Identifier = 0xFFFF;
data->editor_data.edtInPbk = 1;
data->editor_data.timeout = FOREVER;
data->editor_data.destroyEditor = FALSE;
data->editor_data.editor_attr.text = (char *)data->QQ->edt_buf_password;
data->editor_data.TextId = TxtPassword;
data->editor_data.AlternateLeftSoftKey = TxtNull;
data->editor_data.LeftSoftKey = TxtNull;
data->editor_data.RightSoftKey = TxtDelete;
data->editor_data.mode = TEXTINPUT_MODE; /* 2003/12/04 sunsj modify */
data->editor_data.Callback = (T_EDIT_CB)SetQQBind_CB;
/* 2003/12/04 sunsj modify for new editor mode */
if( data->editor_data.mode == TEXTINPUT_MODE )
{
data->QQ->editorPWwin = text_input(win, &data->editor_data);
}
else
{
data->QQ->editorPWwin = editor_start(win, &data->editor_data); /* start the editor */
}
}
break;
case INPUT_DESTROY:
case QQ_DESTROY:
{
MmiTrace("QQ_DESTROY");
SetQQBind_destroy( win );
}
break;
}
}
/*******************************************************************************
$Function: SendQQnumber_CB
$Description: default call back for name entry
$Returns: None
$Arguments: win, handle of parent window, reason, for invocation
*******************************************************************************/
static void SetQQBind_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason )
{
T_MFW_WIN *win_data = ( (T_MFW_HDR *) win )->data;
tQQStandard *data = (tQQStandard *) win_data->user;
T_QQ *QQ = data->QQ;
int i;
UINT32 oldColor,oldFontColor;
UBYTE* pstrinfo;
char info[200];
USHORT outLen;
T_MFW_SMS_INFO sms_parameter;
char sc_addr[MAX_LEN]; /* service centre address */
MmiTrace("SetQQBind_CB");
MmiTrace("In_QQ");
MmiTraceInt(In_QQ);
MmiTrace("HavenewQQ");
MmiTraceInt(HavenewQQ);
MmiTrace("CanReadQQ");
MmiTraceInt(CanReadQQ);
switch( reason )
{
case INFO_KCD_OK:
if( (CanReadQQ)&&(HavenewQQ) )
{//hxl add for qq,2003-3-2
//copy the first list element to temp element
IsFormDatalistcb=0;
Get_Unread_info(win);
break;
}
case INFO_KCD_LEFT:
{
if( (strlen((char *)QQ->edt_buf_number)!=0) &&
(strlen((char *)QQ->edt_buf_password)!=0) )
{
if( !smsidle_get_ready_state() )
{
QQShowInformation( win,TxtNotReady, TxtSim,NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
return ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -