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

📄 mmismssend.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
                *outLen = i*2+2;
        }
        if( *outLen == 0 )
        {//Reached end of message without finding 0x0000 - set last word to 0x0000
            *outLen = MAX_MSG_LEN;
            temp_conv_buffer[MAX_MSG_LEN-2] = 0x00;
            temp_conv_buffer[MAX_MSG_LEN-1] = 0x00;
        }
        return(temp_conv_buffer);
    }
    else
    {   /*MC*/
        *outLen = strlen((char*)ipText);
        SmsRead_convertSMSmsg(ipText, MFW_ASCII, MAX_MSG_LEN, temp_conv_buffer, MFW_DCS_8bits, MAX_MSG_LEN, FALSE);
        //return (ipText);
        return(temp_conv_buffer);
    }
}

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

 $Function:    	SmsSend_R_OPTExeSendOnly

 $Description:	Start the creation of the main window for SMS Send.
 
 $Returns:		none

 $Arguments:	m - Menu handle
                i - Menu item selected.
 
*******************************************************************************/

static int SmsSend_R_OPTExeSendOnly(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND          win      = mfwParent(mfw_header());
    T_MFW_WIN        * win_data = ((T_MFW_HDR *)win)->data;
    T_SMSSEND_R_OPT  * data     = (T_SMSSEND_R_OPT *)win_data->user;
    /* access to data from parent   */
    T_SEND  * parent_data =  (T_SEND *)data->parent_data;
    T_EDITOR_DATA editor_data;
    T_MFW_SMS_INFO  sms_parameter;
    USHORT parameter;

    TRACE_FUNCTION("SmsSend_R_OPTExeSendOnly");
    /* delete only the one selected SMS */
    if( Send_state==E_REPLY )
    {
        if( (phb_get_mode() EQ PHB_RESTRICTED)
            && (phb_check_number(parent_data->edt_data.NumberBuffer) EQ MFW_PHB_FAIL) )
        {
            mmi_dialog_information_screen(win,TxtNotImplemented, 0, 
                                          (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_NOT_ALLOWED);
        }
        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_R_OPT_destroy(parent_data->options_win);
                SmsSend_CENTREEDIT_exec_cb(parent_data->win, E_INIT,(void*)&parameter);
            }
            else
            {
                /* 2004/4/20, wangyan modify */
#if 0
                /*NM FTA 34.2.8*/
                if( parent_data->edt_data.called_from_reply_item EQ FALSE )
                {
                    TRACE_EVENT("take the own serviceCenternum");
                    strcpy((char *)parent_data->edt_data.CentreBuffer, (char *)sms_parameter.sc_addr);
                    {
                        char buf[30];
                        sprintf(buf,"serviceNr:%s",parent_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",parent_data->edt_data.CentreBuffer);
                        TRACE_EVENT(buf);
                    }
                }
                /*NM FTA 34.2.8*/
#endif
                /* 2004/4/20, wangyan modify */
                Send_save=E_SENDONLY;
                SmsSend_R_OPT_destroy(parent_data->options_win);
                SmsSend_send_to_mfw(parent_data->win);
            }
        }
    }
    else
    {
        Send_save=E_SENDONLY;
        SmsSend_loadEditDefault(&editor_data);
        /* 2003/12/29 sunsj modify for number buffer size */
        editor_attr_init_fullscr(&editor_data.editor_attr,1,TxtEnterNumber,
                                 (char *)parent_data->edt_data.NumberBuffer,PHB_MAX_LEN+3,edtCurBar1);
        editor_data.edtInPbk           = 0;
        editor_data.LeftSoftKey          = TxtSend;
        editor_data.AlternateLeftSoftKey  = TxtSearchName;
        editor_data.RightSoftKey         = TxtDelete;
        editor_data.Identifier           = SMSSEND_ID_NBEDIT ; 
        editor_data.mode                 = E_EDIT_DIGITS_MODE;
        editor_data.Callback             = (T_EDIT_CB)SmsSend_NBEDIT_edit_cb;
        editor_data.destroyEditor        = FALSE;
        editor_data.mode=PHONENUMONLY_MODE  ;
        parent_data->number_editor = editor_start(parent_data->win, &editor_data);  /* start the editor */ 
        SmsSend_R_OPT_destroy(parent_data->options_win);
    }
}

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

 $Function:    	SmsSend_R_OPTExeSend

 $Description:	Start the creation of the main window for SMS Send.
 
 $Returns:		none

 $Arguments:	m - Menu handle
                i - Menu item selected.
 
*******************************************************************************/

static int SmsSend_R_OPTExeSend(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND          win      = mfwParent(mfw_header());
    T_MFW_WIN        * win_data = ((T_MFW_HDR *)win)->data;
    T_SMSSEND_R_OPT  * data     = (T_SMSSEND_R_OPT *)win_data->user;
    /* access to data from parent   */
    T_SEND  * parent_data =  (T_SEND *)data->parent_data;

    T_EDITOR_DATA editor_data;
    T_MFW_SMS_INFO  sms_parameter;
    USHORT parameter;

    TRACE_FUNCTION("SmsSend_R_OPTExeSend");
    //sms_get_memset();

    if( memory.used == memory.total )//smsidle_get_memory_full())
    {
        SmsSend_R_OPT_destroy(parent_data->options_win);
        mmi_dialog_information_screen(parent_data->win,TxtSmsFull, 0, 
                                      (T_VOID_FUNC)SmsSend_standard_dialog_cb, SMSSEND_ID_NOT_ALLOWED);
    }
    else
    {
        if( Send_state==E_REPLY )
        {
            if( (phb_get_mode() EQ PHB_RESTRICTED)
                && (phb_check_number(parent_data->edt_data.NumberBuffer) EQ MFW_PHB_FAIL) )
            {
                SmsSend_R_OPT_destroy(parent_data->options_win);
                mmi_dialog_information_screen(parent_data->win,TxtNotImplemented, 0, 
                                              (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
                    SmsSend_R_OPT_destroy(parent_data->options_win);
                    mmi_dialog_information_screen(parent_data->win,TxtPleaseWait, TxtSimNot, 
                                                  (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_R_OPT_destroy(parent_data->options_win);
                        SmsSend_CENTREEDIT_exec_cb(parent_data->win, E_INIT,(void*)&parameter);
                    }
                    else
                    {
                        /* 2004/4/20, wangyan modify */
#if 0
                        /*NM FTA 34.2.8*/
                        if( parent_data->edt_data.called_from_reply_item EQ FALSE )
                        {
                            TRACE_EVENT("take the own serviceCenternum");
                            strcpy((char *)parent_data->edt_data.CentreBuffer, (char *)sms_parameter.sc_addr);
                            {
                                char buf[30];
                                sprintf(buf,"serviceNr:%s",parent_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",parent_data->edt_data.CentreBuffer);
                                TRACE_EVENT(buf);
                            }
                        }
                        /*NM FTA 34.2.8*/
#endif
                        /* 2004/4/20, wangyan modify */
                        Send_save=E_SENDSAVE;
                        SmsSend_R_OPT_destroy(parent_data->options_win);
                        SmsSend_send_to_mfw(parent_data->win);
                    }
                }
            }
        }
        else
        {
            Send_save=E_SENDSAVE;
            SmsSend_loadEditDefault(&editor_data);

            // Reset the number if it is sent an other time (supposed to a new number)
            //			if (parent_data->id == SMSSEND_ID_SENT)
            //				parent_data->edt_data.NumberBuffer[0] = '\0';

            //			 parent_data->edt_data.NumberBuffer[0] = '\0';  /* MZ 6/2/01 SMSSEND_ID_SENT is never received need to check!  */
            editor_attr_init_fullscr(&editor_data.editor_attr,1,TxtEnterNumber,(char *)parent_data->edt_data.NumberBuffer,PHB_MAX_LEN,edtCurBar1);
            //bookSetEditAttributes( 0,Mmi_layout_first_line()+2,84 , 20, 0, 0, edtCurBar1, 0, 
            //(char *) parent_data->edt_data.NumberBuffer, /*MAX_SEARCH_CHAR*/NUMBER_LENGTH, &editor_data.editor_attr);
            editor_data.edtInPbk           = 0;
            editor_data.LeftSoftKey          = TxtSend;
            editor_data.AlternateLeftSoftKey = TxtSearchName;
            editor_data.RightSoftKey         = TxtDelete;
            editor_data.Identifier           = SMSSEND_ID_NBEDIT ; 
            editor_data.mode                 = E_EDIT_DIGITS_MODE;
            editor_data.Callback             = (T_EDIT_CB)SmsSend_NBEDIT_edit_cb;
            editor_data.destroyEditor        = FALSE;
            editor_data.mode=PHONENUMONLY_MODE  ;
            parent_data->number_editor = editor_start(parent_data->win, &editor_data);  /* start the editor */ 
            SmsSend_R_OPT_destroy(parent_data->options_win);
        }
    }

}

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

 $Function:    	SmsSend_R_OPTExeDiscard

 $Description:	
 
 $Returns:		execution status

 $Arguments:	m - Menu handle
                i - Menu item selected.
 
*******************************************************************************/

static int SmsSend_R_OPTExeDiscard(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND          win      = mfwParent(mfw_header());
    T_MFW_WIN        * win_data = ((T_MFW_HDR *)win)->data;
    T_SMSSEND_R_OPT  * data     = (T_SMSSEND_R_OPT *)win_data->user;
    /* access to data from parent   */
    T_SEND  * parent_data =  (T_SEND *)data->parent_data;
    //T_EDITOR_DATA editor_data;
    T_MFW_HDR    * parent      =  parent_data->parent;
    TRACE_FUNCTION("SmsSend_R_OPTExeDiscard");

    SmsSend_R_OPT_destroy(parent_data->options_win);
    /*#if	defined(CHINESE_MMI) && defined(EASY_TEXT_ENABLED)
         if (Mmi_getCurrentLanguage() == CHINESE_LANGUAGE)
            chinese_input_destroy(parent_data->text_editor);
         else
    #endif
    */
    //editor_destroy(parent_data->text_editor);
    //parent_data->text_editor = 0;
    SmsSend_SEND_destroy(parent_data->win);
    if( !call_data.win )
        SEND_EVENT (parent, E_BACK, data->id, NULL);
    return 1;
}


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

 $Function:    	SmsSend_R_OPTExeCmMsg

 $Description:	
 
 $Returns:		execution status

 $Arguments:	m - Menu handle
                i - Menu item selected.
 
*******************************************************************************/

static int SmsSend_R_OPTExeCmMsg(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND          win      = mfwParent(mfw_header());
    T_MFW_WIN        * win_data = ((T_MFW_HDR *)win)->data;
    T_SMSSEND_R_OPT  * data     = (T_SMSSEND_R_OPT *)win_data->user;
    T_MFW_HND          parent   = data->parent;
    /* access to data from parent   */
    T_SEND  * parent_data =  (T_SEND *)data->parent_data;
    T_EDITOR_DATA editor_data;

    TRACE_FUNCTION("SmsSend_R_OPTExeCmMsg");

    SmsSend_R_OPT_destroy(parent_data->options_win);
    Send_ed_state=SEND_USE_COMMON_MSG;
    // modified by clrobert
    // from
    /*
    smscb_common_msg_start (data->win, NULL);
    */
    // to
    smscb_common_msg_start (parent, NULL);
    // modify end
    return 1;
}

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

 $Function:    	SmsSend_R_OPTExeSave

 $Description:	called when the user press Save sender in the Option menu
 
 $Returns:		execution status

 $Arguments:	m - Menu handle
                i - Menu item selected.
 
*******************************************************************************/

static int SmsSend_R_OPTExeSave(MfwMnu* m, MfwMnuItem* i)
{
    T_MFW_HND       win  = mfwParent(mfw_header());
    T_MFW_WIN     * win_data = ((T_MFW_HDR *)win)->data;
    T_SMSSEND_R_OPT         * data = (T_SMSSEND_R_OPT *)win_data->user;
#ifdef _VIRTUAL_SIM_
    UBYTE index = 2;
#endif

    TRACE_FUNCTION("SmsSend_R_OPTExeSave");

    if( !smsidle_get_ready_state() )
    {

⌨️ 快捷键说明

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