📄 jpushinboxcommonui.c
字号:
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* PushInboxCommonUI.c
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* This file is common functions calls to be used by both service inbox and UM.
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef _MMI_PUSHINBOXCOMMONUI_C
#define _MMI_PUSHINBOXCOMMONUI_C
#include "MMI_features.h"
#if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
#include "PixtelDataTypes.h"
#include "Unicodexdcl.h"
#include "HistoryGprot.h"
#include "GlobalDefs.h"
#include "CommonScreens.h"
#include "SettingProfile.h"
#include "NVRAMType.h"
#include "NVRAMProt.h"
#include "NVRAMEnum.h"
#include "worldclock.h" /* Vivek - 01092006 */
#include "wgui_categories.h"
#include "wgui_categories_inputs.h"
#include "wap_ps_struct.h"
#include "wapadp.h"
#include "ddl.h"
#include "jcal.h"
#include "jdd_memapi.h"
#include "jdd_BrowserConfig.h" /* Added by Vivek - 08-nov-2006 */
#include "jdi_communicator.h"
#include "jdi_BrowserDatatype.h"
#include "JBrowserMMIDefs.h"
#include "JBrowserMMIProts.h"
#include "JBrowserMMIGprots.h"
#include "JBrowserMMITypes.h"
// #include "JBrowserStartup.h"
#include "wgui_status_icons.h"
/* PMT DARA PROFILE HANDLER 020106 */
#include "JProfileHandlerTypes.h"
#include "JProfileHandlerProts.h"
#include "UnifiedMessageDef.h"
#include "JPushInboxCommonAPIs.h"
#include "JPushInboxCommonUI.h"
#include "time.h"
#include "app_datetime.h"
#include "DateTimeGprot.h"
#include "PhoneSetupGprots.h"
#include "CallManagementGprot.h"
SERVICE_VALUE *g_current_service_message = NULL;
SERVICE_VALUE **g_brw_service_msg_list_p = NULL;
U16 g_brw_index_current_highlighted_item = 0;
U8 *g_message_buffer = NULL;
S32 g_max_push_messages = 0;
/*
* We will set this flag when a push delete notification will come. So that
* on idle 'new service message' pop can be avoid in case of push
* replacement. This flag will be reset at the following place
* - While reading the push message.
* - While displaying the Inbox.
* - While entering to the idle screen.
* - While displaying the UM Main Screen (Only for UM)
*/
MMI_BOOL g_mmi_brw_delete_push_notification = MMI_FALSE;
extern void mmi_um_brw_delete_all_push_messages_ind(void);
extern void mmi_um_brw_highlight_push_messages_ind(void);
/*****************************************************************************
* FUNCTION
* mmi_brw_initialize_push_message_list
* DESCRIPTION
* This function is responsible for initializing th push message list.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_initialize_push_message_list(void)
{
/* Get maximum number of push mesages supported */
#ifdef __MMI_UNIFIED_MESSAGE__
g_max_push_messages = MMI_UM_MAX_GET_LIST_MSG_NUMBER;
#else /* __MMI_UNIFIED_MESSAGE__ */
g_max_push_messages = jdd_BrowserConfigGetMaxPushMessage();
#endif /* __MMI_UNIFIED_MESSAGE__ */
g_brw_service_msg_list_p = (SERVICE_VALUE **) jdd_MemAlloc(g_max_push_messages,sizeof(SERVICE_VALUE *));
/* TODO : null check */
jc_memset(g_brw_service_msg_list_p, 0, g_max_push_messages * sizeof(SERVICE_VALUE *));
}
/*****************************************************************************
* FUNCTION
* mmi_brw_deinitialize_push_message_list
* DESCRIPTION
* This function is responsible for freeing the push message list.
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_brw_deinitialize_push_message_list(void)
{
if (g_brw_service_msg_list_p != NULL)
{
jdd_MemFree(g_brw_service_msg_list_p);
g_brw_service_msg_list_p = NULL;
}
}
/*****************************************************************************
* FUNCTION
* mmi_brw_push_free_service_value_struct
* DESCRIPTION
* This function is responsible for freeing service value struct.
* PARAMETERS
* service_message [IN] Service value structure.
* about push messages.(?)(?)
* RETURNS
* returns local time.(?)
*
* Note : function is freeing only those field which are copied in(?)
* mmi_brw_push_service_value_struct_dup. - Vivek 13072006(?)
*****************************************************************************/
void mmi_brw_push_free_service_value_struct(SERVICE_VALUE **service_message)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if ((NULL == service_message) || (NULL == *service_message))
{
return;
}
if ((*service_message)->pmHref != NULL)
{
jdd_MemFree((*service_message)->pmHref);
(*service_message)->pmHref = NULL;
}
if ((*service_message)->pSICreated != NULL)
{
jdd_MemFree((*service_message)->pSICreated);
(*service_message)->pSICreated = NULL;
}
if ((*service_message)->pSIExpires != NULL)
{
jdd_MemFree((*service_message)->pSIExpires);
(*service_message)->pSIExpires = NULL;
}
if ((*service_message)->pSIRcvd != NULL)
{
jdd_MemFree((*service_message)->pSIRcvd);
(*service_message)->pSIRcvd = NULL;
}
if ((*service_message)->pmMessage != NULL)
{
jdd_MemFree((*service_message)->pmMessage);
(*service_message)->pmMessage = NULL;
}
jdd_MemFree(*service_message);
*service_message = NULL;
}
/*****************************************************************************
* FUNCTION
* mmi_brw_push_service_value_struct_dup
* DESCRIPTION
* This function is responsible for creating the copy of service value structure.
* PARAMETERS
* service_message [?]
* SI_TIME(?) [IN] Time structure filled with GMT time.
* about push messages.(?)(?)
* RETURNS
* returns local time.
* Note : We are copying only those value which are needed in MMI. - Vivek 13072006.
*****************************************************************************/
SERVICE_VALUE *mmi_brw_push_service_value_struct_dup(SERVICE_VALUE *service_message)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
SERVICE_VALUE *dup_service_message = NULL;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
dup_service_message = (SERVICE_VALUE*) jdd_MemAlloc(1, sizeof(SERVICE_VALUE));
if (NULL == dup_service_message)
{
return NULL;
}
dup_service_message->service_flag = service_message->service_flag;
if (service_message->pmMessage != NULL)
{
dup_service_message->pmMessage =
(JC_CHAR*) jdd_MemAlloc(jc_tcslen(service_message->pmMessage) + 1, sizeof(JC_CHAR));
if (NULL == dup_service_message->pmMessage)
{
mmi_brw_push_free_service_value_struct(&dup_service_message);
return NULL;
}
jc_tcscpy(dup_service_message->pmMessage, service_message->pmMessage);
}
if (service_message->pmHref != NULL)
{
dup_service_message->pmHref = (JC_CHAR*) jdd_MemAlloc(jc_tcslen(service_message->pmHref) + 1, sizeof(JC_CHAR));
if (NULL == dup_service_message->pmHref)
{
mmi_brw_push_free_service_value_struct(&dup_service_message);
return NULL;
}
jc_tcscpy(dup_service_message->pmHref, service_message->pmHref);
}
if (NULL != service_message->pSICreated)
{
dup_service_message->pSICreated = (SI_TIME*) jdd_MemAlloc(1, sizeof(SI_TIME));
if (NULL == dup_service_message->pSICreated)
{
mmi_brw_push_free_service_value_struct(&dup_service_message);
return NULL;
}
jc_memmove(dup_service_message->pSICreated, service_message->pSICreated, sizeof(SI_TIME));
}
if (NULL != service_message->pSIRcvd)
{
dup_service_message->pSIRcvd = (SI_TIME*) jdd_MemAlloc(1, sizeof(SI_TIME));
if (NULL == dup_service_message->pSIRcvd)
{
mmi_brw_push_free_service_value_struct(&dup_service_message);
return NULL;
}
jc_memmove(dup_service_message->pSIRcvd, service_message->pSIRcvd, sizeof(SI_TIME));
}
if (NULL != service_message->pSIExpires)
{
dup_service_message->pSIExpires = (SI_TIME*) jdd_MemAlloc(1, sizeof(SI_TIME));
if (NULL == dup_service_message->pSIExpires)
{
mmi_brw_push_free_service_value_struct(&dup_service_message);
return NULL;
}
jc_memmove(dup_service_message->pSIExpires, service_message->pSIExpires, sizeof(SI_TIME));
}
return dup_service_message;
}
/*****************************************************************************
* FUNCTION
* convert_gmt_in_to_local_time
* DESCRIPTION
* This function is responsible for converting GMT time in to local time.
* PARAMETERS
* gmt_time_p [?]
* SI_TIME(?) [IN] Time structure filled with GMT time.
* about push messages.(?)(?)
* RETURNS
* returns local time.
*****************************************************************************/
static SI_TIME convert_gmt_in_to_local_time(SI_TIME *gmt_time_p)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U32 tzdiff = 0;
U32 timeSecs = 0;
U32 local_time = 0;
FLOAT tz = 0.0;
MYTIME result = {0};
MYTIME currGMTTime = {0};
SI_TIME local_time_p = {0};
applib_time_struct time;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (NULL == gmt_time_p)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -