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

📄 jmmswritemmsui.c

📁 MTK_MMI的部分源代码,从code中大致了解到MMI的执行流程
💻 C
📖 第 1 页 / 共 5 页
字号:
/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_address_fullscreen_editor_on_not_empty
 * DESCRIPTION
 *  This Fn called when editor screen is not empty
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_address_fullscreen_editor_on_not_empty(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 currScrenID = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    currScrenID = GetActiveScreenId();
    ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
    if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR)  /* /lefyt soft key set to NULL also so left key handler get cleared */
    {
        SetLeftSoftkeyFunction(mmi_jmms_address_search_phonebook_or_ok, KEY_EVENT_UP);
    }
}

/* PMT VUIKAS START 20060325 */


/*****************************************************************************
 * FUNCTION
 *  update_mms_number_from_phonebook
 * DESCRIPTION
 *  This fn copy the number selected from phonebook to adderess editor(number) screen
 * PARAMETERS
 *  number      [?]     [?]
 * RETURNS
 *  void
 *****************************************************************************/
void update_mms_number_from_phonebook(S8 *number)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    
    MMI_BOOL number_allow = MMI_TRUE;
//	U8 *temp_str;
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
   // (U8*) temp_str = (U8*) number;
    number_allow = mmi_jmms_check_number_input_format((U8*)number);
    if(number_allow == MMI_FALSE)
    {
        DisplayPopup(
                (U8*) GetString(STR_ID_JMMS_INPUT_FORMAT_ERROR),
                IMG_GLOBAL_ERROR,
                1,
                JMMS_POPUP_TIME,
                ERROR_TONE);
        if (IsScreenPresent(SCR_PBOOK_LIST))
        {
            DeleteUptoScrID(SCR_PBOOK_LIST);
        }
            memset(g_jmms_context->g_jmms_add_number_buffer, 0x00, (MAX_POSSIBLE_NUMBER_LENGHT_SENT + 1) * ENCODING_LENGTH);
            return;
    }
        
    if (number)
    {
        memset(g_jmms_context->g_jmms_add_number_buffer, 0x00, (MAX_POSSIBLE_NUMBER_LENGHT_SENT + 1) * ENCODING_LENGTH);
        pfnUnicodeStrcpy((S8*) (g_jmms_context->g_jmms_add_number_buffer), (PS8) number);
    }
    /*Dilip Start 14th Sept to display out of limit number from phonebook*/
    if(g_jmms_context->g_jmms_add_number_buffer[MAX_POSSIBLE_NUMBER_LENGHT_SENT*ENCODING_LENGTH] != '\0')
        {
            DisplayPopup(
                (U8*) GetString(STR_ID_JMMS_PHB_LIMIT_EXCEEDED),
                IMG_GLOBAL_ERROR,
                1,
                JMMS_POPUP_TIME,
                ERROR_TONE);
            if (IsScreenPresent(SCR_PBOOK_LIST))
                {
                    DeleteUptoScrID(SCR_PBOOK_LIST);
                }
            memset(g_jmms_context->g_jmms_add_number_buffer, 0x00, (MAX_POSSIBLE_NUMBER_LENGHT_SENT + 1) * ENCODING_LENGTH);
            
        }
        /*Dilip END 14th Sept to display out of limit number from phonebook*/
    else
    {

    HistoryReplace(
        SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR,
        SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR,
        mmi_jmms_entry_write_message_add_number_screen);
    GoBackToHistory(SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR);
    }
}


/*****************************************************************************
 * FUNCTION
 *  update_mms_email_from_phonebook
 * DESCRIPTION
 *  This fn copy the email selected from phonebook to adderess editor(email) screen
 * PARAMETERS
 *  email       [?]     [?]
 * RETURNS
 *  void
 *****************************************************************************/
void update_mms_email_from_phonebook(S8 *email)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (email)
    {
        pfnUnicodeStrcpy((S8*) (g_jmms_context->g_jmms_add_email_buffer), (PS8) email);
    }

    HistoryReplace(
        SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR,
        SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR,
        mmi_jmms_entry_write_message_add_email_screen);
    GoBackToHistory(SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR);
}

/* PMT VUIKAS END 20060325 */


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_address_search_phonebook_or_ok
 * DESCRIPTION
 *  This fn henadled the LSK press in adderess editor(number or email) screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_jmms_address_search_phonebook_or_ok(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    MMI_BOOL found = MMI_FALSE;
    U8 *temp_str;
    U8 length;
    MMI_BOOL format_allow = MMI_TRUE;
    U16 currScrenID;
    U8 num_addresses = 0;
    U8 ret = 0;
    MMI_BOOL number_allow_phb = MMI_TRUE;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    currScrenID = GetActiveScreenId();

    if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR)
    {
        temp_str = g_jmms_context->g_jmms_add_number_buffer;
        length = MAX_POSSIBLE_NUMBER_LENGHT_SENT;
    }
    else if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR)
    {
        temp_str = g_jmms_context->g_jmms_add_email_buffer;
        length = MAX_POSSIBLE_EMAIL_LENGHT_SENT;
    }
    else
    {
        return;
    }

    if (pfnUnicodeStrncmp((S8*) temp_str, "\0", length * ENCODING_LENGTH) == 0)
    {
        /* PMT VIKAS START 20060325 */
        if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR)
        {
            EntryPhbFromMMSNumber();
            temp_str = g_jmms_context->g_jmms_add_number_buffer;
        }
        else if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR)
        {
            EntryPhbFromMMSEmail();
            temp_str = g_jmms_context->g_jmms_add_email_buffer;
        }
        /* PMT VIKAS END 20060325 */
    }
    else
    {
        if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR)
        {
            number_allow_phb = mmi_jmms_check_number_input_format(temp_str);
            if(number_allow_phb == MMI_FALSE)
            {
            DisplayPopup(
                (U8*) GetString(STR_ID_JMMS_INPUT_FORMAT_ERROR),
                IMG_GLOBAL_ERROR,
                1,
                JMMS_POPUP_TIME,
                ERROR_TONE);
                return;
            }
        }

        if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_EMAIL_EDITOR)
        {
            format_allow = mmi_jmms_check_address_input_format(temp_str);
        }

        if (format_allow == MMI_FALSE)
        {
            DisplayPopup(
                (U8*) GetString(STR_ID_JMMS_INPUT_FORMAT_ERROR),
                IMG_GLOBAL_ERROR,
                1,
                JMMS_POPUP_TIME,
                ERROR_TONE);
            return;
        }
        /*Dilip 1st Sept 06 */
        if (g_address_option_index == E_EDIT_ADDRESS)
        {
            U8 temp = 0;
            jmms_address_list *address_node = NULL;
            if (g_jmms_context->address_list_flag == E_TO_ADDRESSES)
            {
                address_node = g_jmms_context->to_address_p;;
            }
            else if (g_jmms_context->address_list_flag == E_CC_ADDRESSES)
            {
                address_node = g_jmms_context->cc_address_p;
            }
            else if (g_jmms_context->address_list_flag == E_BCC_ADDRESSES)
            {
                address_node = g_jmms_context->bcc_address_p;
            }
            if(address_node != NULL)
            {
                temp = g_hilite_address_item;
                while(temp)
                {
                    address_node = address_node->next;
                    temp--;
                }
            }
            if(address_node != NULL)
            {
                if (mmi_jmms_compair_string((S8*) temp_str,(S8*)address_node->address) != 0)
                {
                    found = mmi_jmms_check_duplicate_address(temp_str, g_jmms_context->address_list_flag, g_hilite_address_item);
                }

            }
                       
        }
        else
        {
            found = mmi_jmms_check_duplicate_address(temp_str, E_NONE_ADDRESSES, -1);   // COMPILER WARNING REMOVAL
        }
       /*Dilip 1st Sept 06 */
        if (found != MMI_TRUE)
        {
            if (g_address_option_index == E_EDIT_ADDRESS)
            {
                ret = mmi_jmms_replace_address_in_addresse_list((S8*) temp_str);
                if (ret != 0)
                {
                    DisplayPopup(
                        (U8*) GetString(STR_ID_JMMS_MEMORY_FULL),
                        IMG_GLOBAL_ERROR,
                        1,
                        JMMS_POPUP_TIME,
                        (U8) ERROR_TONE);
                    return;
                }
                g_address_list_right_soft_key = STR_GLOBAL_DONE;
                g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_DONE;
                GoBackToHistory(SCR_ID_JMMS_ADDRESS_LIST);
            }
            else    /* add number or email */
            {
                ret = mmi_jmms_add_address_in_addresse_list((S8*) temp_str);
                if (ret != 0)
                {
                    DisplayPopup(
                        (U8*) GetString(STR_ID_JMMS_MEMORY_FULL),
                        IMG_GLOBAL_ERROR,
                        1,
                        JMMS_POPUP_TIME,
                        (U8) ERROR_TONE);
                    return;
                }
                /* /back to address list scren with newly added adress highlighted and rsk as DONE */
                g_address_list_right_soft_key = STR_GLOBAL_DONE;
                g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_DONE;

                if (g_jmms_context->address_list_flag == E_TO_ADDRESSES)
                {
                    num_addresses = g_jmms_context->num_to_addresses;
                }
                else if (g_jmms_context->address_list_flag == E_CC_ADDRESSES)
                {
                    num_addresses = g_jmms_context->num_cc_addresses;
                }
                else if (g_jmms_context->address_list_flag == E_BCC_ADDRESSES)
                {
                    num_addresses = g_jmms_context->num_bcc_addresses;
                }

                g_hilite_address_item = num_addresses;

                if (num_addresses <= 1)
                {
                    /* We don't need to add the SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR screen to history 
                       again. So, we have to use HistoryReplace() insteasd of invoking the entry function 
                       mmi_jmms_entry_addresses_list_screen()  */
                    HistoryReplace(SCR_ID_WRITE_MMS_ADDRESSES_OPTION, SCR_ID_JMMS_ADDRESS_LIST, mmi_jmms_entry_addresses_list_screen);
                    //mmi_jmms_entry_addresses_list_screen(); /* /new entry to address list screen */
                    GoBackHistory();
                }
                else
                {
                    ///it means address list screen already exist
                    ///just go back to that screen
                    GoBackToHistory(SCR_ID_JMMS_ADDRESS_LIST);
                }

            }

        }
        else
        {
             /* changes for adding different message for Email address and phone Number*/ 
            /*Dilip Start 21 Aug 2006*/
            if (currScrenID == SCR_ID_JMMS_WRITE_MMS_ADD_NUMBER_EDITOR)
            {
                DisplayPopup(
                (U8*) GetString(STR_ID_JMMS_ADDRESS_ALREADY_EXIST),
                IMG_GLOBAL_ERROR,
                1,
                JMMS_POPUP_TIME,
                ERROR_TONE);
            }
            else
            {
                DisplayPopup(
                (U8*) GetString(STR_ID_JMMS_EMAIL_ADDRESS_ALREADY_EXIST),
                IMG_GLOBAL_ERROR,
                1,
                JMMS_POPUP_TIME,
                ERROR_TONE);
            }
            /*Dilip End 21 Aug 2006*/
        }
    }

}


/*****************************************************************************
 * FUNCTION
 *  mmi_jmms_add_address_in_addresse_list
 * DESCRIPTION
 *  Add the input address in address list
 * PARAMETERS
 *  address    

⌨️ 快捷键说明

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