⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmiqq.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
#include "mmiQQSwitch.h"
#ifdef QQFUNC//hxl add for qq func switch,2003-3-24
/*******************************************************************************

                    CONDAT (UK)

********************************************************************************                                                                              

 This software product is the property of Condat (UK) Ltd and may not be
 disclosed to any third party without the express permission of the owner.                                 
                                                                              
********************************************************************************

 $Project name:	Basic MMI                                                      
 $Project code:	BMI (6349)                                                           
 $Module:		QQ
 $File:		    MmiQQ.c
 $Revision:		1.0                                                       
                                                                              
 $Author:		Condat(UK)                                                         
 $Date:		    25/10/00                                                      
                                                                               
********************************************************************************
                                                                              
 Description:
 
    This module provides the phone QQ search window functionality for the
    phone QQ module of the basic MMI
                        
********************************************************************************
 $History: MmiQQ.c

    16/12/02			Original Condat(UK) BMI version.	
       
 $End

*******************************************************************************/


/*******************************************************************************
                                                                              
                                Include Files
                                                                              
*******************************************************************************/
    #define ENTITY_MFW

/* includes */
    #include <string.h>
    #include <stdio.h>
    #include <stdlib.h>

    #if defined (NEW_FRAME)

        #include "typedefs.h"
        #include "vsi.h"
        #include "pei.h"
        #include "custom.h"
        #include "gsm.h"

    #else

        #include "stddefs.h"
        #include "custom.h"
        #include "gsm.h"
        #include "vsi.h"

    #endif

    #include "mfw_sys.h"

    #include "mfw_mfw.h"
    #include "mfw_win.h"
    #include "mfw_kbd.h"
    #include "mfw_lng.h"
    #include "mfw_edt.h"
    #include "mfw_icn.h"
    #include "mfw_mnu.h"
    #include "mfw_tim.h"

    #include "mfw_sim.h"
    #include "mfw_cm.h"
    #include "mfw_nm.h"
    #include "mfw_phb.h"
    #include "mfw_mme.h"
    #include "mfw_sat.h"
    #include "mfw_sms.h"

    #include "dspl.h"

    #include "ksd.h"
    #include "psa.h"

    #include "MmiMain.h"
    #include "MmiBookController.h"
    #include "MmiDummy.h"
    #include "MmiDialogs.h"
    #include "MmiLists.h"

    #include "MmiMenu.h"
    #include "MmiCall.h"
    #include "MmiIcons.h"
    #include "MmiIdle.h"

    #include "MmiSoftKeys.h"
    #include "MmiSounds.h"
    #include "MmiIdle.h"
    #include "MmiNetwork.h"
    #include "MmiSat_i.h"
    #include "MmiAoc.h"

    #include "gdi.h"
    #include "audio.h"

    #include "cus_aci.h"
    #include "p_sim.h"
    #include "mfw_ffs.h"
    #include "MmiTimers.h"
    #include "mmiusersymbolinput.h"
    #include "mmisettings.h"
    #include "mfw_cnvt.h"
    #include "mmiQQ.h"
    #include "Mmieditor_i.h"
    #include "Mmieditor.h"
    #include "Rtc_api.h" //hxl add for rtc
    #include "MmiSmsMenu.h"
    #include "Mminetwork.h"

    #define	MaxQQData	30

ListMenuData    *Data_List_data=NULL;
void    *pQQListItem=NULL;  //for friend list data; need destroy in selet menu
static  int DataListType=0;

ListMenuData    *temp_Data_List_data=NULL;//when creat unread list info on datalist,i save the first list alloc point in this element,2003-3-5
void    *pQQTempListItem=NULL;  //when creat unread list info on datalist,i save the first list alloc point in this element,2003-3-5
static  int tempDataListType=0;//when creat unread list info on datalist,i save the first list type in this element,2003-3-5

ListMenuData    *psearch_Data_List_data=NULL;//when creat unread list info on datalist,i save the first list alloc point in this element,2003-3-5
void    *pSerach_QQListItem=NULL;   //for search friend list data; need destroy in selet menu

TQQItem         QQSmsItem[MaxQQData];
TQQFrinendItem  QQNetFri[MAX_NETFRI_NUMBER];//max net qq friend
char        QQFriInfo[MAX_MSG_LEN_ARRAY-60+3];//see qq fri datas
static  char    QQSernumber[MAX_QQSer_NUMBER+3];    //service number 1700 9777;not unicode

extern const unsigned char iconWaitting[];

static int QQ_Inofrmation_cb(T_MFW_HND win, USHORT identifier, USHORT reason);
static void DataList_cb(T_MFW_HND * Parent, ListMenuData * ListData);
static MfwHnd QQShowInformation( MfwHnd parent, int txtId, int txtId2, char *str2, unsigned long time,USHORT identifier,T_VOID_FUNC cb_function );
static T_MFW_HND DataListPa_create (T_MFW_HND parent_window);
static void DataListPa_destroy (T_MFW_HND own_window);
static void DataListPa_dialog(T_MFW_HND win, USHORT event, SHORT value, void *parameter);
static T_MFW_HND DataListPa_Start (T_MFW_HND parent_window );
static int DataListPa_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static void QQ_loadEditDefault(T_EDITOR_DATA *editor_data);
static void SetQQBind_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static void Input_QQ_Password(T_MFW_HND win,T_QQ            *QQ);
static void InputQQPWCB( T_MFW_HND win,  USHORT Identifier, UBYTE reason );
static void QQAddNewCB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static T_MFW_HND QQAddNewCreate( MfwHnd parent );
static void QQAddNewDestroy( MfwHnd window );
static void QQAddNewDialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static MfwHnd QQAddNewStart( MfwHnd parent);
static int QQAddNewWindowCB( MfwEvt e, MfwWin *w );
static T_MFW_HND SetQQBind_create (T_MFW_HND parent_window);
static void SetQQBind_destroy (T_MFW_HND own_window);
static void SetQQBind_dialog(T_MFW_HND win, USHORT event, SHORT value, void *parameter);
static int SetQQBind_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static void QQSetEditAttributes(
                               U16  winPx,   U16 winPy, U16 winSx, U16 winSy,
                               U8   fgColor, U8  font,  U8  mode,  U8  *controls,
                               char *text,   U16 size,
                               MfwEdtAttr*   attr);
//static int SetQQBind_kbd_cb(MfwEvt e, MfwKbd *k);
static void SendQQ_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static T_MFW_HND SendQQ_Create( MfwHnd parent );
static void SendQQ_Destroy( MfwHnd window );
static void SendQQ_Dialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static int SendQQ_Win_cb( MfwEvt e, MfwWin *w );
static int  writeToQQFile(int   freeSpace);
static int  GetQQFileLen(void);
static void SortQQ(void) ;
static int  findQQFunc(int  type,TQQItem * FindData);
static void Modify(int  idx,int type);
static unsigned short *ustrstr(unsigned short *ws1, const unsigned short *ws2);
static unsigned short *ustrchr(const unsigned char *ws, unsigned char   c);
static int DatalistUpdate(void);
static T_MFW_HND View_QQ_Sms(T_MFW_HND parent_win);
static void View_QQ_Sms_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static T_MFW_HND View_QQ_Sms_Creat( MfwHnd parent );
static void View_QQ_Sms_Destroy( MfwHnd window );
static void View_QQ_Sms_Dialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static int View_QQ_Sms_wincb( MfwEvt e, MfwWin *w );
static T_MFW_HND View_QQ_Datas(T_MFW_HND parent_win);
static void View_QQ_Datas_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static T_MFW_HND View_QQ_Datas_Creat( MfwHnd parent );
static void View_QQ_Datas_Destroy( MfwHnd window );
static void View_QQ_Datas_Dialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static int View_QQ_Datas_wincb( MfwEvt e, MfwWin *w );
static int  DeleteAllQQFunc(SHORT        delListType);
static MfwHnd QQShowAsk( MfwHnd parent, int txtId, int txtId2, char *str2, unsigned long time,USHORT identifier,T_VOID_FUNC cb_function );
static int QQ_InfoAsk_cb(T_MFW_HND win, USHORT identifier, USHORT reason);
static BOOL IsUniNumeric(char *s);
static int Show_QQ_Datas();
static int Show_NET_Friend();
static T_MFW_HND FindQQ_create (T_MFW_HND parent_window);
static void FindQQ_destroy (T_MFW_HND own_window);
static void FindQQ_dialog(T_MFW_HND win, USHORT event, SHORT value, void *parameter);
static void FindQQ_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static int FindQQ_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static T_MFW_HND Show_QQ_help_Creat( MfwHnd parent );
static void Show_QQ_help_Destroy( MfwHnd window );
static void Show_QQ_help_Dialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static int Show_QQ_help_wincb( MfwEvt e, MfwWin *w );
static void Show_QQ_help_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static void if_back_datalist(T_MFW_HND parwin);
static void SearchList_cb(T_MFW_HND * Parent, ListMenuData * ListData);
static T_MFW_HND SearchListPa_create (T_MFW_HND parent_window);
static void SearchListPa_destroy (T_MFW_HND own_window);
static void SearchListPa_dialog(T_MFW_HND win, USHORT event, SHORT value, void *parameter);
static T_MFW_HND SearchListPa_Start (T_MFW_HND parent_window);
static int SearchListPa_win_cb (T_MFW_EVENT event, T_MFW_WIN * win);
static int SearchlistUpdate(void);
static void FreeSearchListMemory();
static int Show_Ser_Note(T_MFW_HND parwin,SHORT value);
static void Show_Ser_Note_CB( T_MFW_HND win,USHORT Identifier, UBYTE reason );
static T_MFW_HND Show_Ser_Note_Creat( MfwHnd parent );
static void Show_Ser_Note_Destroy( MfwHnd window );
static void Show_Ser_Note_Dialog( T_MFW_HND win, USHORT event, SHORT value, void *parameter );
static int Show_Ser_Note_wincb( MfwEvt e, MfwWin *w );
static int sendQQServiceOn(T_MFW_HND win);

int View_left_info(void);
static int findQQNumber(char *number);
static int ustrcmp(const unsigned char *ws1, const unsigned char *ws2);
uint8   In_QQ=0;//in qq menu,and can read new qq
uint8   CanReadQQ=0;//in new qq read dialog,can't read new qq
uint8   ReadbtnShow=0;//if read btn has been shown,it is 1;etherwise it is 0
uint8   HavenewQQ=0;//have unread qq
uint8   In_QQInfo=0;//if in qq info dialog,don't show read button
uint8   nsms=0;//for check qq,2003-3-16

extern int hstrcpy( char *d,const char *r);
extern int hstrlen(const char * txt);
extern int ComTime(UINT16 y1,UINT16 m1,UINT16 d1,UINT16 h1,UINT16 mi1,
                   UINT16 y2,UINT16 m2,UINT16 d2,UINT16 h2,UINT16 mi2);
char QQFriInfoNumber[MAX_QQ_NUMBER+3];//not unicode
char QQFriInfoName[MAX_QQ_NAME+3];

T_QQSEND    QQsend={0,NULL,0,NULL,0};
int QQReadNewSms=0;
static T_MFW_HND QQlistWin=0;
static uint8 IsFormDatalistcb=0;
static MfwMnuAttr qq_menuAttrib =
{
    0,
    &menuDynamicArea,
    MNU_LEFT | MNU_LIST | MNU_CUR_LINE, /* centered page menu       */
    -1,                                 /* use default font         */
    NULL,                               /* with these items         */
    0 
};

int setQQRecieveOn(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win =  mfwParent( mfw_header() );
    T_MFW_WIN * win_Data = ((T_MFW_HDR *)win)->data;
    tBookStandard   *data = (tBookStandard *)win_Data->user;
    UBYTE*  pstrinfo;
    char    info[20];
    USHORT outLen;
    T_MFW_SMS_INFO  sms_parameter;
    char              sc_addr[MAX_LEN]; /* service centre address   */


    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( win,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);

    QQsend.QQsendmsg=Recieve_on;

    wstrcpy(info,"HF");//52
    pstrinfo = mmi_Sys_Sim((char *)info, &outLen,&(sms_parameter.dcs));
    SmsSend_set_dcs_number (&sms_parameter);

    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 1;
}



int setQQRecieveOff(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win =  mfwParent( mfw_header() );
    T_MFW_WIN * win_Data = ((T_MFW_HDR *)win)->data;
    tBookStandard   *data = (tBookStandard *)win_Data->user;
    UBYTE*  pstrinfo;
    char    info[20];
    USHORT outLen;
    T_MFW_SMS_INFO  sms_parameter;
    char              sc_addr[MAX_LEN]; /* service centre address   */


    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( win, 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);

    QQsend.QQsendmsg=Recieve_off;

    wstrcpy(info,"ZT");//"53"
    pstrinfo = mmi_Sys_Sim((char *)info, &outLen,&(sms_parameter.dcs));
    SmsSend_set_dcs_number (&sms_parameter);

    sms_submit(MFW_SMS_SUBMIT,QQSernumber,(UBYTE *)pstrinfo,outLen,sc_addr);            

    MmiTrace("sending parent");
    MmiTraceInt(win);

    QQsend.sendingwin=QQShowInformation( win, 0, TxtSending,QQSernumber,FOREVER,SMS_SENDING_MSG,(T_VOID_FUNC)QQ_Inofrmation_cb);

    return 1;

}

int setQQServiceOn(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND win =  mfwParent( mfw_header() );


    MmiTraceInt(win);

    Show_Ser_Note(win, TxtQQNoteSerOn);
    return MFW_EVENT_CONSUMED;
}


static int sendQQServiceOn(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   */


    MmiTraceInt(win);
    if( strlen(QQSernumber)==0 )
    {//no network
        QQShowInformation( win, TxtNoNetwork,0, NULL,300,only_info,(T_VOID_FUNC)QQ_Inofrmation_cb);
        return	MFW_EVENT_CONSUMED;
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -