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

📄 jmmswritemmsui.c

📁 MTK_MMI的部分源代码,从code中大致了解到MMI的执行流程
💻 C
📖 第 1 页 / 共 5 页
字号:
        {
            len = MAX_RECIPIENTS_CAPTION_LENGTH - temp_len;
            pfnUnicodeStrncat((S8*) bcc_caption, (const S8*)GetString(STR_ID_JMMS_RECIPIENTS), len);
        }
        else
        {
            pfnUnicodeStrcat((S8*) bcc_caption, (const S8*)GetString(STR_ID_JMMS_RECIPIENTS));
        }

    }

    SetInlineItemDisplayOnly(&wgui_inline_items[E_WRITE_MMS_BCC], (U8*) bcc_caption);

    /* Subject */
    SetInlineItemActivation(&wgui_inline_items[E_WRITE_MMS_SUBJECT], KEY_LSK, KEY_EVENT_UP);
    SetInlineItemFullScreenEdit(
        &wgui_inline_items[E_WRITE_MMS_SUBJECT],
        STR_ID_WRITE_MMS_SUBJECT,
        GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
        (PU8) g_jmms_context->subject_input_buffer,
        MAX_SUBJECT_LENGTH + 1,
        INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
    SetInlineFullScreenEditCustomFunction(
        &wgui_inline_items[E_WRITE_MMS_SUBJECT],
        mmi_jmms_write_mms_subject_custom_func);

    /* Attachments */
    SetInlineItemActivation(
        &wgui_inline_items[E_WRITE_MMS_ATTACHMENT_CAPTION],
        INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
        0);
    SetInlineItemCaption(&wgui_inline_items[E_WRITE_MMS_ATTACHMENT_CAPTION], (U8*) GetString(STR_ID_JMMS_ATTACHMENT));
    SetInlineItemActivation(&wgui_inline_items[E_WRITE_MMS_ATTACHMENT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);

    memset(attachment_caption, 0x00, (MAX_FILES_CAPTION_LENGTH + 1) * ENCODING_LENGTH);
    mmi_jmms_jdi_get_media_count(g_jmms_context->msg_handle, 0, &(no_attachments), E_TRUE);

    g_jmms_context->num_attachments = no_attachments;

    sprintf(str, "%d ", g_jmms_context->num_attachments);
    AnsiiToUnicodeString((PS8) attachment_caption, (PS8) str);

    len = pfnUnicodeStrlen((PS8) attachment_caption);
    temp_len = len;
    len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_FILES));
    if (len > MAX_FILES_CAPTION_LENGTH)
    {
        len = MAX_FILES_CAPTION_LENGTH - temp_len;
        pfnUnicodeStrncat((S8*) attachment_caption, (const S8*)GetString(STR_ID_JMMS_FILES), len);
    }
    else
    {
        pfnUnicodeStrcat((S8*) attachment_caption, (const S8*)GetString(STR_ID_JMMS_FILES));
    }

    SetInlineItemDisplayOnly(&wgui_inline_items[E_WRITE_MMS_ATTACHMENT], (U8*) attachment_caption);

    /* Edit Content */
    SetInlineItemActivation(
        &wgui_inline_items[E_WRITE_MMS_EDIT_CONTENT_CAPTION],
        INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
        0);
    SetInlineItemCaption(
        &wgui_inline_items[E_WRITE_MMS_EDIT_CONTENT_CAPTION],
        (U8*) GetString(STR_ID_WRITE_MMS_EDIT_CONTENT));
    SetInlineItemActivation(&wgui_inline_items[E_WRITE_MMS_EDIT_CONTENT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);

    mmi_jmms_jdi_get_total_pages(g_jmms_context->msg_handle, &page_count);

    memset(slides_caption, 0x00, (MAX_SLIDES_CAPTION_LENGTH + 1) * ENCODING_LENGTH);
    sprintf(str, "%d ", page_count);
    AnsiiToUnicodeString((PS8) slides_caption, (PS8) str);

    len = pfnUnicodeStrlen((PS8) slides_caption);
    temp_len = len;
    len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_SLIDES));
    if (len > MAX_SLIDES_CAPTION_LENGTH)
    {
        pfnUnicodeStrncat(
            (S8*) slides_caption,
            (const S8*)GetString(STR_ID_JMMS_SLIDES),
            MAX_SLIDES_CAPTION_LENGTH - temp_len);
        goto END;
    }
    else
    {
        pfnUnicodeStrcat((S8*) slides_caption, (const S8*)GetString(STR_ID_JMMS_SLIDES));
    }

    //PMT VIKAS START 20050325
    //To add slide size
    mmi_jmms_jdi_get_size(g_jmms_context->msg_handle, 0, &mms_size);

    size_kb = mms_size / 1024;
    size_bytes = mms_size % 1024;
	size_mb = (float32)size_kb/1024 ;
	size_gb = size_mb/1024;
	if (size_gb > 1.0 && size_mb > 1024)
    {
        sprintf(str, " (%0.02f ", size_gb);
        AnsiiToUnicodeString((PS8) tempstr, (PS8) str);

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) tempstr);
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat((S8*) slides_caption, (S8*) tempstr, MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) tempstr);
        }

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_GB));
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat(
                (S8*) slides_caption,
                (S8*) GetString(STR_ID_JMMS_GB),
                MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) GetString(STR_ID_JMMS_GB));
        }

    }
	else if (size_mb > 1.0 && size_kb > 1024)
    {
        sprintf(str, " (%0.02f ", size_mb);
        AnsiiToUnicodeString((PS8) tempstr, (PS8) str);

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) tempstr);
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat((S8*) slides_caption, (S8*) tempstr, MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) tempstr);
        }

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_MB));
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat(
                (S8*) slides_caption,
                (S8*) GetString(STR_ID_JMMS_MB),
                MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) GetString(STR_ID_JMMS_MB));
        }

    }
    else if (size_kb >= 1)
    {
        size_kb++;
        sprintf(str, " (%d ", size_kb);
        AnsiiToUnicodeString((PS8) tempstr, (PS8) str);

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) tempstr);
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat((S8*) slides_caption, (S8*) tempstr, MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) tempstr);
        }

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_KB));
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat(
                (S8*) slides_caption,
                (S8*) GetString(STR_ID_JMMS_KB),
                MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) GetString(STR_ID_JMMS_KB));
        }

    }
    else
    {
        sprintf(str, " (%d ", mms_size);
        AnsiiToUnicodeString((PS8) tempstr, (PS8) str);

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) tempstr);
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat((S8*) slides_caption, (S8*) tempstr, MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) tempstr);
        }

        temp_len = len;
        len = len + pfnUnicodeStrlen((PS8) GetString(STR_ID_JMMS_KB));
        if (len > MAX_SLIDES_CAPTION_LENGTH)
        {
            pfnUnicodeStrncat(
                (S8*) slides_caption,
                (S8*) GetString(STR_ID_JMMS_WRITE_MMS_BYTES),
                MAX_SLIDES_CAPTION_LENGTH - temp_len);
            goto END;
        }
        else
        {
            pfnUnicodeStrcat((S8*) slides_caption, (S8*) GetString(STR_ID_JMMS_WRITE_MMS_BYTES));
        }

    }

    memset(tempstr, 0, 20 * ENCODING_LENGTH);
    AnsiiToUnicodeString((PS8) tempstr, ")");
    temp_len = len;
    len = len + pfnUnicodeStrlen((PS8) tempstr);
    if (len > MAX_SLIDES_CAPTION_LENGTH)
    {
        pfnUnicodeStrncat((S8*) slides_caption, (S8*) tempstr, MAX_SLIDES_CAPTION_LENGTH - temp_len);
    }
    else
    {
        pfnUnicodeStrcat((S8*) slides_caption, (S8*) tempstr);
    }

    /* PMT VIKAS END 20050325 */

  END:

    SetInlineItemDisplayOnly(&wgui_inline_items[E_WRITE_MMS_EDIT_CONTENT], (U8*) slides_caption);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_write_mms_subject_custom_func
 * DESCRIPTION
 *  Custom fn for subject editor
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_write_mms_subject_custom_func(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
    SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
    SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID));

//    SetKeyHandler(mmi_jmms_free_addresses_list_on_end, KEY_END, KEY_EVENT_DOWN);

}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_write_mms_highlight_hdlr
 * DESCRIPTION
 *  Highlight handler of write mms screen items
 * PARAMETERS
 *  index       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_write_mms_highlight_hdlr(S32 index)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    is_add_media_as_drm = MMI_FALSE;
    if (index == E_WRITE_MMS_ATTACHMENT)
    {
        if (mmi_jmms_is_message_to_fwd() == MMI_TRUE)
        {
            ChangeLeftSoftkey(NULL, NULL);
        }
        else
        {
            ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
            SetLeftSoftkeyFunction(mmi_jmms_entry_attachment_options, KEY_EVENT_UP);
        }
        ChangeTitleString((U8*) GetString(STR_ID_JMMS_ATTACHMENT));
        draw_title();
        if (g_jmms_context->g_write_mms_right_soft_key == STR_GLOBAL_DONE)
        {
            SetRightSoftkeyFunction(mmi_jmms_done_write_mms, KEY_EVENT_UP);
            ChangeRightSoftkey(STR_GLOBAL_DONE, NULL);
        }

    }
    else
    {
        if (mmi_jmms_is_message_to_fwd() == MMI_TRUE && index == E_WRITE_MMS_EDIT_CONTENT)
        {
            ChangeLeftSoftkey(NULL, NULL);
        }
        else
            ChangeLeftSoftkey(STR_GLOBAL_EDIT, NULL);

        if (index == E_WRITE_MMS_TO)
        {
            g_jmms_context->address_list_flag = E_TO_ADDRESSES;
            SetLeftSoftkeyFunction(mmi_jmms_entry_address_option, KEY_EVENT_UP);
            ChangeTitleString((U8*) GetString(STR_ID_WRITE_MMS_TO));
            draw_title();
        }

        if (index == E_WRITE_MMS_CC)
        {
            g_jmms_context->address_list_flag = E_CC_ADDRESSES;
            SetLeftSoftkeyFunction(mmi_jmms_entry_address_option, KEY_EVENT_UP);
            ChangeTitleString((U8*) GetString(STR_ID_WRITE_MMS_CC));
            draw_title();
        }

        if (index == E_WRITE_MMS_BCC)
        {
            g_jmms_context->address_list_flag = E_BCC_ADDRESSES;
            SetLeftSoftkeyFunction(mmi_jmms_entry_address_option, KEY_EVENT_UP);
            ChangeTitleString((U8*) GetString(STR_ID_WRITE_MMS_BCC));
            draw_title();
        }

        if (index == E_WRITE_MMS_EDIT_CONTENT)
        {
            if (mmi_jmms_is_message_to_fwd() != MMI_TRUE)
            {
                SetLeftSoftkeyFunction(mmi_jmms_pre_entry_edit_content_screen, KEY_EVENT_UP);
            }
			else
			{
				ChangeLeftSoftkey(NULL, NULL);
			}
            ChangeTitleString((U8*) GetString(STR_ID_WRITE_MMS_EDIT_CONTENT));
            draw_title();
        }

        if (index == E_WRITE_MMS_SUBJECT)
        {
            ChangeTitleString((U8*) GetString(STR_ID_WRITE_MMS_SUBJECT));
            draw_title();
            if (g_jmms_context->g_write_mms_right_soft_key == STR_GLOBAL_DONE)
            {
                SetRightSoftkeyFunction(mmi_jmms_done_write_mms, KEY_EVENT_UP);
                ChangeRightSoftkey(STR_GLOBAL_DONE, NULL);
            }

⌨️ 快捷键说明

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