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

📄 jmmsinboxui.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_msg_register_callback(g_jmms_context->msg_handle, E_CB_ERROR_IND, (void*)mmi_jmms_error_ind_cb);
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_set_content_class(g_jmms_context->msg_handle, MMS_SUPPORTED_CONTENT_CLASS);
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, mmi_jmms_compose_settings_creation_mode());
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_set_msg_type(g_jmms_context->msg_handle, E_TYPE_MMS);
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_set_presentation_type(g_jmms_context->msg_handle, E_PRESENTATION_SMIL);
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_set_max_pages(g_jmms_context->msg_handle, (U8) mmi_jmms_compose_settings_max_no_pages());
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_msg_register_callback(
            g_jmms_context->msg_handle,
            E_CB_REPLY_CHARGING,
            (void*)mmi_jmms_reply_charging_ind_cb);
    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
    if (eRet != JC_OK || pMsgHeaders == NULL)
    {
        eRet = JC_ERR_STORE_FILE_CORRUPTED;
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    if (pMsgHeaders->eMsgType != E_MSG_TYPE_SEND)
    {
        DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
        goto END;
    }

    send_p = (MESSAGE_SEND*) (pMsgHeaders->pHeaders);

    mmi_jmms_free_addresses_list();

    /* /Make the To Addresses list */

    if (send_p->pTo != NULL)
    {
        str = (S8*) (send_p->pTo);
        len = 0;
        start_index = 0;
        g_jmms_context->address_list_flag = E_TO_ADDRESSES;

        while (pfnUnicodeStrcmp(str, "\0") != 0)
        {

            while (((*str) != ';') && ((*str) != '\0'))
            {
                if ((*str) == '@')
                {
                    is_email = MMI_TRUE;
                }

                len++;
                str = str + ENCODING_LENGTH;

            }

            if (is_email == MMI_FALSE && len > (MAX_POSSIBLE_NUMBER_LENGHT_SENT))
            {
                len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
            }
            else if (is_email == MMI_TRUE && len > (MAX_POSSIBLE_EMAIL_LENGHT_SENT))
            {
                len_to_copy = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
            }
            else
            {
                len_to_copy = len;
            }

            temp_str = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
            if (temp_str == NULL)
            {
                DisplayPopup(
                    (U8*) GetString(STR_ID_JMMS_OUT_OF_MEMORY),
                    IMG_GLOBAL_ERROR,
                    1,
                    JMMS_POPUP_TIME,
                    (U8) ERROR_TONE);
                goto END;
            }
            pfnUnicodeStrncpy((S8*) temp_str, (S8*) (send_p->pTo + start_index), len_to_copy);

            if ((is_duplicate = mmi_jmms_check_duplicate_address((U8*) temp_str,E_NONE_ADDRESSES,-1)) != MMI_TRUE)   // compiler warning removal
            {
                ret = mmi_jmms_add_address_in_addresse_list((S8*) temp_str);
                if (ret != 0)
                {
                    DisplayPopup(
                        (U8*) GetString(STR_ID_JMMS_OUT_OF_MEMORY),
                        IMG_GLOBAL_ERROR,
                        1,
                        JMMS_POPUP_TIME,
                        (U8) ERROR_TONE);
                    goto END;
                }
            }

            if (temp_str != NULL)
            {
                jdd_MemFree(temp_str);
                temp_str = NULL;
            }

            start_index = start_index + len + 1;
            len = 0;
            if ((*str) != '\0')
            {
                str = str + ENCODING_LENGTH;
            }

        }

        if (temp_str != NULL)
        {
            jdd_MemFree(temp_str);
            temp_str = NULL;
        }
    }

    /* /Make the Cc Addresses list */
    if (send_p->pCc != NULL)
    {

        str = (S8*) (send_p->pCc);
        len = 0;
        start_index = 0;
        g_jmms_context->address_list_flag = E_CC_ADDRESSES;
        is_email = MMI_FALSE;

        while (pfnUnicodeStrcmp(str, "\0") != 0)
        {

            while (((*str) != ';') && ((*str) != '\0'))
            {
                len++;

                if ((*str) == '@')
                {
                    is_email = MMI_TRUE;
                }

                str = str + ENCODING_LENGTH;
            }

            if (is_email == MMI_FALSE && len > (MAX_POSSIBLE_NUMBER_LENGHT_SENT))
            {
                len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
            }
            else if (is_email == MMI_TRUE && len > (MAX_POSSIBLE_EMAIL_LENGHT_SENT))
            {
                len_to_copy = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
            }
            else
            {
                len_to_copy = len;
            }

            temp_str = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
            if (temp_str == NULL)
            {
                DisplayPopup(
                    (U8*) GetString(STR_ID_JMMS_OUT_OF_MEMORY),
                    IMG_GLOBAL_ERROR,
                    1,
                    JMMS_POPUP_TIME,
                    (U8) ERROR_TONE);
                goto END;
            }
            pfnUnicodeStrncpy((S8*) temp_str, (S8*) (send_p->pCc + start_index), len_to_copy);

            if ((is_duplicate = mmi_jmms_check_duplicate_address((U8*) temp_str,E_NONE_ADDRESSES,-1)) != MMI_TRUE)  // compiler warning removal
            {
                ret = mmi_jmms_add_address_in_addresse_list((S8*) temp_str);
                if (ret != 0)
                {
                    DisplayPopup(
                        (U8*) GetString(STR_GLOBAL_ERROR),
                        IMG_GLOBAL_ERROR,
                        1,
                        JMMS_POPUP_TIME,
                        (U8) ERROR_TONE);
                    goto END;
                }
            }

            if (temp_str != NULL)
            {
                jdd_MemFree(temp_str);
                temp_str = NULL;
            }

            start_index = start_index + len + 1;
            len = 0;
            if ((*str) != '\0')
            {
                str = str + ENCODING_LENGTH;
            }
        }

        if (temp_str != NULL)
        {
            jdd_MemFree(temp_str);
            temp_str = NULL;
        }

    }

    /* /Make the BCc Addresses list */
    if (send_p->pBcc != NULL)
    {
        str = (S8*) (send_p->pBcc);
        len = 0;
        start_index = 0;
        g_jmms_context->address_list_flag = E_BCC_ADDRESSES;
        is_email = MMI_FALSE;

        while (pfnUnicodeStrcmp(str, "\0") != 0)
        {

            while (((*str) != ';') && ((*str) != '\0'))
            {
                len++;
                if ((*str) == '@')
                {
                    is_email = MMI_TRUE;
                }
                str = str + ENCODING_LENGTH;
            }

            if (is_email == MMI_FALSE && len > (MAX_POSSIBLE_NUMBER_LENGHT_SENT))
            {
                len_to_copy = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
            }
            else if (is_email == MMI_TRUE && len > (MAX_POSSIBLE_EMAIL_LENGHT_SENT))
            {
                len_to_copy = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
            }
            else
            {
                len_to_copy = len;
            }

            temp_str = (S8*) jdd_MemAlloc(sizeof(S8), (len_to_copy + 1) * ENCODING_LENGTH);
            if (temp_str == NULL)
            {
                DisplayPopup(
                    (U8*) GetString(STR_ID_JMMS_OUT_OF_MEMORY),
                    IMG_GLOBAL_ERROR,
                    1,
                    JMMS_POPUP_TIME,
                    (U8) ERROR_TONE);
                goto END;
            }
            pfnUnicodeStrncpy((S8*) temp_str, (S8*) (send_p->pBcc + start_index), len_to_copy);

            if ((is_duplicate = mmi_jmms_check_duplicate_address((U8*) temp_str,E_NONE_ADDRESSES,-1)) != MMI_TRUE) // compiler warning removal
            {
                ret = mmi_jmms_add_address_in_addresse_list((S8*) temp_str);
                if (ret != 0)
                {
                    DisplayPopup(
                        (U8*) GetString(STR_GLOBAL_ERROR),
                        IMG_GLOBAL_ERROR,
                        1,
                        JMMS_POPUP_TIME,
                        (U8) ERROR_TONE);
                    goto END;
                }
            }

            if (temp_str != NULL)
            {
                jdd_MemFree(temp_str);
                temp_str = NULL;
            }

            start_index = start_index + len + 1;
            len = 0;
            if ((*str) != '\0')
            {
                str = str + ENCODING_LENGTH;
            }
        }
    }

    /* /Make the subject buffer */
    memset(g_jmms_context->subject_input_buffer, 0x00, (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH);
    if (send_p->pSubject != NULL)
    {

        len = (pfnUnicodeStrlen((S8*) (send_p->pSubject))) * ENCODING_LENGTH;

        if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
        {
            memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, (MAX_SUBJECT_LENGTH * ENCODING_LENGTH));
        }
        else
        {
            memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, len);
        }
    }

    g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_DONE;

//    g_jmms_context->g_use_local_send_setings = 0;
/* MAUI_00227929 Start */
	    g_jmms_context->g_use_local_send_setings = 0;
		mmi_jmms_fill_mms_sending_settings();        
/* MAUI_00227929 End */
    if (g_jmms_context->is_add_media_warning == 0)
    {
        mmi_jmms_entry_write_message_screen();
    }
    else
    {
        DisplayPopupCallBack(
            (PU8) GetString(STR_ID_JMMS_MMS_ERR_WARNING_CONTENT_CLASS),
            IMG_GLOBAL_WARNING,
            1,
            JMMS_POPUP_TIME,
            WARNING_TONE,
            mmi_jmms_entry_write_message_screen);
    }

  END:

    if (temp_str != NULL)
    {
        jdd_MemFree(temp_str);
        temp_str = NULL;
    }

    // TODO:: need to check whether this is to do or not
    if (hTempMsg != NULL)
    {
        mmi_jmms_jdi_msg_deinit(hTempMsg);
        hTempMsg = NULL;
    }

    if (Content.pFileName != NULL)
    {
        jdd_MemFree(Content.pFileName);
        Content.pFileName = NULL;
    }

    if (eRet != JC_OK)
    

⌨️ 快捷键说明

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