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

📄 jpushinboxcommonui.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
    {
        return; /* added by tk */
    }

    /* Show unread push message icon on idle screen */
    mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);

    if (brw_unread_msg_count > 0)
    {
        /* Display unread message icon on idle screen */
        ShowStatusIcon(STATUS_ICON_WAP);
    }
    else
    {
        /* hide unread push message icon on idle screen */
        HideStatusIcon(STATUS_ICON_WAP);
    }

    /* Commneted  by Vivek to fix the status bar rehresh prblem */
    /* refresh_status_icon_display(); */
}


/*****************************************************************************
 * FUNCTION
 *  mmi_brw_entry_service_inbox_read_options
 * DESCRIPTION
 *  Entry function for recent page options screen.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_entry_service_inbox_read_options(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U16 uc_list_of_items[3];
    U8 *gui_buffer;
    S32 num_of_items;
    U16 parent_menuid;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    EntryNewScreen(SCR_ID_BRW_PUSH_MESSAGE_READ_OPTIONS, NULL, mmi_brw_entry_service_inbox_read_options, NULL);

    gui_buffer = GetCurrGuiBuffer(SCR_ID_BRW_PUSH_MESSAGE_READ_OPTIONS);

    if (!isInCall())
    {
        parent_menuid = MENU_ID_BRW_PUSH_MSG_READ_OPTIONS_1;
    }
    else
    {
        parent_menuid = MENU_ID_BRW_PUSH_MSG_READ_OPTIONS_2;
    }

    num_of_items = GetNumOfChild(parent_menuid);
    GetSequenceStringIds(parent_menuid, uc_list_of_items);
    SetParentHandler(parent_menuid);
    RegisterHighlightHandler(ExecuteCurrHiliteHandler);

    ShowCategory15Screen(
        STR_GLOBAL_OPTIONS,
        GetRootTitleIcon(SERVICES_WAP_MENU_ID),
        STR_GLOBAL_OK,
        0,
        STR_GLOBAL_BACK,
        0,
        num_of_items,
        uc_list_of_items,
        (U16*) gIndexIconsImageList,
        LIST_MENU,
        0,
        gui_buffer);

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


static MMI_BOOL mmi_brw_is_push_message_expired(void)
{
    struct tm expiry_timestamp = {0};
    time_t expiry_secs_since_1970 = {0};
    time_t current_secs_since_1970 = {0};

    if ((g_current_service_message->service_flag == SERVICE_INDICATION) &&
        (NULL != g_current_service_message->pSIExpires)
       )
    {
        expiry_timestamp.tm_mon = g_current_service_message->pSIExpires->month - 1;      /* month scale to 0 to 11 */
        expiry_timestamp.tm_year = g_current_service_message->pSIExpires->year - 1900;   /* offset since 1900 */
        expiry_timestamp.tm_mday = g_current_service_message->pSIExpires->day;
        expiry_timestamp.tm_hour = g_current_service_message->pSIExpires->hour;
        expiry_timestamp.tm_min = g_current_service_message->pSIExpires->minute;
        expiry_timestamp.tm_sec = g_current_service_message->pSIExpires->seconds;

        /* Get difference of seconds of expiry time from 1970 (as per UTC standard) */
        expiry_secs_since_1970 = (time_t) mktime(&expiry_timestamp);
        /* Get difference of seconds of current time from 1970 (as per UTC standard) */
        current_secs_since_1970 = get_current_utc_time();
    
        if (expiry_secs_since_1970 <= current_secs_since_1970)
        {
            return MMI_TRUE;
        }
    }
    return MMI_FALSE;
}

/*****************************************************************************
 * FUNCTION
 *  mmi_brw_accept_push_message
 * DESCRIPTION
 *  Deletes the entire recent page list
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_accept_push_message(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    MMI_BOOL is_valid_url;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/

    if (TRUE == mmi_brw_is_push_message_expired())
    {
        DisplayPopup((PU8) GetString(STR_ID_BRW_PUSH_EXPIRED), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
    }
    else
    {
        is_valid_url = mmi_brw_validate_url((U8*) g_current_service_message->pmHref);
        if (is_valid_url == MMI_TRUE)
        {
            mmi_JBrowserInitApp();
            mmi_brw_set_current_url((S8*) g_current_service_message->pmHref);
            mmi_brw_pre_entry_goto_url();

/* Start - PMTSW00006677 & PMTSW00007001 */

    #ifndef __MMI_UNIFIED_MESSAGE__
            
            /* 
             * When there is only one unread service message, We display the message body 
             * directly, instead of displaying the service Inbox, that is why  we are  adding 
             * service Inbox screen so that while pressing cacel or while exiting the browser 
             * user will come on Service Inbox screen. 
             */
            if ((FALSE == IsScreenPresent(SCR_ID_BRW_SERVICE_INBOX)) &&
                (FALSE == IsScreenPresent(SCR_ID_BRW_SERVICE_INBOX_OPTIONS))
               ) 
            {
                HistoryReplace(SCR_ID_BRW_READ_SERVICE_MESSAGE, SCR_ID_BRW_SERVICE_INBOX,mmi_brw_entry_service_inbox);
            }
            DeleteUptoScrID(SCR_ID_BRW_SERVICE_INBOX);

    #else /*__MMI_UNIFIED_MESSAGE__*/
			
			g_brw_cntx.page_fetchReqSrc = 1;
            DeleteUptoScrID(SCR_ID_UM_INBOX);

    #endif /* __MMI_UNIFIED_MESSAGE__ */

/* End - PMTSW00006677 & PMTSW00007001 */

        }
        else
        {
            DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
        }
    }
}


/*****************************************************************************
 * FUNCTION
 *  mmi_brw_confirm_delete_push_message
 * DESCRIPTION
 *  This function displays the confirmation screen for deletion of push message
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_confirm_delete_push_message(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    DisplayConfirm(
        STR_GLOBAL_YES,
        IMG_GLOBAL_YES,
        STR_GLOBAL_NO,
        IMG_GLOBAL_NO,
        get_string(STR_ID_BRW_DELETE),
        IMG_GLOBAL_QUESTION,
        WARNING_TONE);

    SetLeftSoftkeyFunction(mmi_brw_delete_push_message, KEY_EVENT_UP);
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_brw_delete_push_message
 * DESCRIPTION
 *  Deletes the push message from the list
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_delete_push_message(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U32 brw_total_msg_count = 0;
    U32 brw_unread_msg_count = 0;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_brw_delete_push_msg(g_brw_index_current_highlighted_item);

    /* Added by Vivek - 13072006 */
    mmi_brw_push_free_service_value_struct(&g_current_service_message);

    /* update the copy of local pointers */
    mmi_brw_create_push_msg_list();

    /* Save to persistant storage */
    mmi_brw_save_current_push_info();

    mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);

    if (brw_unread_msg_count > 0)
    {
        /* Display unread message icon on idle screen */
        ShowStatusIcon(STATUS_ICON_WAP);
    }
    else
    {
        /* hide unread push message icon on idle screen */
        HideStatusIcon(STATUS_ICON_WAP);
    }

    /* DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_DELETED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE); */
    /* Edited by Vivek - 02082006. Now instead of displaying the image IMG_GLOBAL_DELETED
       we are displaying IMG_GLOBAL_ACTIVATED as we are doing in other part of browser */
    DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);

#ifndef __MMI_UNIFIED_MESSAGE__

    if (IsScreenPresent(SCR_ID_BRW_SERVICE_INBOX))
    {
        DeleteUptoScrID(SCR_ID_BRW_SERVICE_INBOX);
    }
    else    /* when message is deleted from idle screen */
    {
        mmi_brw_entry_service_inbox();
        DeleteScreenIfPresent(SCR_ID_BRW_PUSH_MESSAGE_READ_OPTIONS);
        DeleteScreenIfPresent(SCR_ID_BRW_NEW_PUSH_MESSAGE_IND);
        DeleteScreenIfPresent(SCR_ID_BRW_READ_SERVICE_MESSAGE);
    }

#else /* __MMI_UNIFIED_MESSAGE__ */ 

    mmi_um_brw_highlight_push_messages_ind();
    DeleteUptoScrID(SCR_ID_UM_INBOX);

#endif /* __MMI_UNIFIED_MESSAGE__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  mmi_brw_confirm_delete_all_push_messages
 * DESCRIPTION
 *  This function displays the confirmation screen for deletion of entire recent page list
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_confirm_delete_all_push_messages(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    DisplayConfirm(
        STR_GLOBAL_YES,
        IMG_GLOBAL_YES,
        STR_GLOBAL_NO,
        IMG_GLOBAL_NO,
        get_string(STR_ID_BRW_DELETE_ALL),
        IMG_GLOBAL_QUESTION,
        WARNING_TONE);

#ifndef __MMI_UNIFIED_MESSAGE__
    SetLeftSoftkeyFunction(mmi_brw_delete_all_push_messages, KEY_EVENT_UP);
#else 
    SetLeftSoftkeyFunction(mmi_um_brw_delete_all_push_messages_ind, KEY_EVENT_UP);
#endif 
    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}


/*****************************************************************************
 * FUNCTION
 *  mmi_brw_create_push_msg_list
 * DESCRIPTION
 *  Function to create the list of push messages
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_brw_create_push_msg_list()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 msg_counter = 0, temp_ctr;
    SERVICE_VALUE *service_msg_p = NULL;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    for (temp_ctr = 0; temp_ctr < g_max_push_messages; temp_ctr++)
    {
        if (g_brw_service_msg_list_p[temp_ctr] != NULL)
        {
            g_brw_service_msg_list_p[temp_ctr] = NULL;
        }
        else
        {
            break;
        }
    }

    /* Get Jataayu service list */
    mmi_brw_get_push_servicelist(&service_msg_p);

    while (service_msg_p != NULL)
    {
        g_brw_service_msg_list_p[msg_counter] = service_msg_p;
        service_msg_p = service_msg_p->pNext;
        msg_counter++;
    }
}


/*****************************************************************************
 * FUNCTION
 *  get_current_utc_time
 * DESCRIPTION
 *  This function returns the current time of the system.
 *  The time returned is UTC time.
 * PARAMETERS
 *  void
 * RETURNS
 *  S32.
 *****************************************************************************/
U32 get_current_utc_time(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    S32 timeSecs;
    FLOAT tz;
    U32 tzdiff = 0;
    MYTIME t;
    applib_time_struct time;
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_dt_get_secure_time(&t);
    timeSecs=mmi_dt_mytime_2_utc_sec(&t,TRUE);
    tz = mmi_dt_get_tz();
    if(tz < 0)
    {
        time = applib_conv_tz_to_mytime(tz * (-1));
    }
    else
    {
        time = applib_conv_tz_to_mytime(tz);
    }
    tzdiff =  time.nHour * 3600 + time.nMin * 60 + time.nSec;
    if(tz > 0)
    {
        return timeSecs-tzdiff;
    }
    else
    {
        return timeSecs+tzdiff;
    }
}

#endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */ 
#endif /* _MMI_PUSHINBOXCOMMONUI_C */ 

⌨️ 快捷键说明

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