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

📄 jmmstemplatesui.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
    SetKeyHandler(mmi_jmms_template_use_number, KEY_WAP, KEY_EVENT_DOWN);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_template_use_number
 * DESCRIPTION
 *  Pre entry fn for use details screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_template_use_number(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_jmms_pre_entry_use_details_screen(MMI_JMMS_TEMPLATES);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_entry_templates_view_options_scren
 * DESCRIPTION
 *  Entry fn for templates options screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_entry_templates_view_options_scren(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    PU8 gui_buffer;                     /* Buffer holding history data */
    U16 str_item_list[MAX_SUB_MENUS];   /* Stores the strings id of submenus returned */
    U16 num_item;                       /* Stores no of children in the submenu */

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_JMMS_TEMPLATES_VIEW_OPTIONS, NULL, mmi_jmms_entry_templates_view_options_scren, NULL);

    gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_TEMPLATES_VIEW_OPTIONS);

    num_item = GetNumOfChild(MENU_ID_JMMS_TEMPLATES_VIEW_OPTIONS);
    GetSequenceStringIds_Ext(MENU_ID_JMMS_TEMPLATES_VIEW_OPTIONS, str_item_list);

    SetParentHandler(MENU_ID_JMMS_TEMPLATES_VIEW_OPTIONS);
    RegisterHighlightHandler(ExecuteCurrHiliteHandler);

    ShowCategory52Screen(
        STR_GLOBAL_OPTIONS,
        GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
        STR_GLOBAL_OK,
        IMG_GLOBAL_OK,
        STR_GLOBAL_BACK,
        IMG_GLOBAL_BACK,
        num_item,
        str_item_list,
        (U16*) gIndexIconsImageList,
        NULL,
        0,
        0,
        gui_buffer);

    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
    SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);

}
#endif /* __MMI_UNIFIED_MESSAGE__ */ 


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_templates_view
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_templates_view(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_RETCODE eRet = JC_OK;
    CONTENT_DATA Content = {0, };

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    Content.bIsStream = E_TRUE;
    eRet = mmi_jmms_get_message("Templates", &Content, (g_jmms_context->nCurr_scr_hilited_index + 1));

    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

 	g_jmms_context->last_scr_id = SCR_ID_JMMS_TEMPLATES_OPTIONS;
	#ifdef __MMI_UNIFIED_MESSAGE__
		mmi_jmms_deinit_view();			
	#endif 
    eRet = mmi_jmms_pre_entry_mms_view(&Content);
    if (eRet == JC_ERR_MMS_PARSE_PENDING)
    {
        return;
    }

  END:

    if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
    {
        eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
        g_jmms_context->msg_handle = NULL;
    }

}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_templates_write_message
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_templates_write_message(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    JC_RETCODE eRet = JC_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_jmms_deinit_mms_context(g_jmms_context);

    if (g_jmms_context->pParseContent == NULL)
    {
        g_jmms_context->pParseContent = (CONTENT_DATA*) jdd_MemAlloc(sizeof(CONTENT_DATA), 1);
    }

    g_jmms_context->pParseContent->bIsStream = E_TRUE;
    eRet = mmi_jmms_get_message("Templates", g_jmms_context->pParseContent, (g_jmms_context->nCurr_scr_hilited_index + 1));

    if (eRet != JC_OK)
    {
        mmi_jmms_error_handler(eRet);
        goto END;
    }

    mmi_jmms_parsing_progressing_screen();

    eRet = mmi_jmms_jdi_parse_msg_buffer(&g_jmms_context->msg_handle, g_jmms_context->pParseContent, E_TYPE_MMS, E_TRUE);

    if (eRet == JC_ERR_MMS_PARSE_PENDING)
    {
        mmi_jmms_parse_continue_start_timer(
            g_jmms_context->msg_handle,
            mmi_jmms_templates_write_message_async_callback, mmi_jmms_only_abort_parsing_progress);
        return;
    }

    mmi_jmms_templates_write_message_async_callback(eRet);
    return;

  END:

    if (g_jmms_context->pParseContent != NULL)
    {
        if (g_jmms_context->pParseContent->pFileName != NULL)
        {
            jdd_MemFree(g_jmms_context->pParseContent->pFileName);
            g_jmms_context->pParseContent->pFileName = NULL;
        }
        jdd_MemFree(g_jmms_context->pParseContent);
        g_jmms_context->pParseContent = NULL;
    }

    if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
    {
        eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
        g_jmms_context->msg_handle = NULL;
    }
    g_jmms_context->is_add_media_warning = 0;
}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_templates_write_message_async_callback
 * DESCRIPTION
 *  
 * PARAMETERS
 *  eRet        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_templates_write_message_async_callback(JC_RETCODE eRet)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MESSAGE_HEADERS *pMsgHeaders = NULL;
    MESSAGE_SEND *send_p = NULL;
    S32 len = 0;
    ECreationMode create_mode;
    JC_RETCODE eRet_restricted = JC_OK;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (JC_OK != eRet)
    {
        if (GetActiveScreenId() == SCR_ID_JMMS_PARSING_PROGRESS)
        {
            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;
    }

    create_mode = mmi_jmms_compose_settings_creation_mode();

    eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, create_mode);
    if (eRet != JC_OK)
    {
        /********************************************************************
           These lines are added to ask a query if the message contains the 
           invalid media in restricted mode.

            Written By  : RAJ KUMAR GUPTA
            Date        : Augest 08, 2006
         *******************************************************************/
        if (JC_ERR_MSG_MMS_CONTENT_RESTRICTED == eRet)
        {
            eRet_restricted = JC_ERR_MSG_MMS_CONTENT_RESTRICTED;
        }
        else
        {
            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_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 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)) + 1) * 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;
	mmi_jmms_fill_mms_sending_settings();

    if (g_jmms_context->is_add_media_warning == 0)
    {
        if (eRet_restricted == JC_ERR_MSG_MMS_CONTENT_RESTRICTED)
        {
            mmi_jmms_edit_content_restricted_mode_query();
        }
        else
        {
            mmi_jmms_entry_write_message_screen();
        }
    }
    else
    {
        DisplayPopupCallBack(
            (PU8) GetString(STR_ID_JMMS_MMS_ERR_WARNING_CONTENT_CLASS),

⌨️ 快捷键说明

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