JPushInboxCommonUI.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:43k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * PushInboxCommonUI.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is common functions calls to be used by both service inbox and UM.
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  * removed!
  95.  *
  96.  * removed!
  97.  * removed!
  98.  * removed!
  99.  *
  100.  * removed!
  101.  * removed!
  102.  * removed!
  103.  *
  104.  * removed!
  105.  * removed!
  106.  * removed!
  107.  *
  108.  *------------------------------------------------------------------------------
  109.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  110.  *============================================================================
  111.  ****************************************************************************/
  112. #ifndef _MMI_PUSHINBOXCOMMONUI_C
  113. #define _MMI_PUSHINBOXCOMMONUI_C
  114. #include "MMI_features.h"
  115. #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
  116. #include "PixtelDataTypes.h"
  117. #include "Unicodexdcl.h"
  118. #include "HistoryGprot.h"
  119. #include "GlobalDefs.h"
  120. #include "CommonScreens.h"
  121. #include "SettingProfile.h"
  122. #include "NVRAMType.h"
  123. #include "NVRAMProt.h"
  124. #include "NVRAMEnum.h"
  125. #include "worldclock.h" /* Vivek - 01092006 */
  126. #include "wgui_categories.h"
  127. #include "wgui_categories_inputs.h"
  128. #include "wap_ps_struct.h"
  129. #include "wapadp.h"
  130. #include "ddl.h"
  131. #include "jcal.h"
  132. #include "jdd_memapi.h"
  133. #include "jdd_BrowserConfig.h" /* Added by Vivek  - 08-nov-2006 */
  134. #include "jdi_communicator.h"
  135. #include "jdi_BrowserDatatype.h"
  136. #include "JBrowserMMIDefs.h"
  137. #include "JBrowserMMIProts.h"
  138. #include "JBrowserMMIGprots.h"
  139. #include "JBrowserMMITypes.h"
  140. // #include "JBrowserStartup.h"
  141. #include "wgui_status_icons.h"
  142. /* PMT DARA  PROFILE HANDLER 020106 */
  143. #include "JProfileHandlerTypes.h"
  144. #include "JProfileHandlerProts.h"
  145. #include "UnifiedMessageDef.h"
  146. #include "JPushInboxCommonAPIs.h"
  147. #include "JPushInboxCommonUI.h"
  148. #include "time.h"
  149. #include "app_datetime.h"
  150. #include "DateTimeGprot.h"
  151. #include "PhoneSetupGprots.h"
  152. #include "CallManagementGprot.h"
  153. SERVICE_VALUE *g_current_service_message = NULL;
  154. SERVICE_VALUE **g_brw_service_msg_list_p = NULL;
  155. U16 g_brw_index_current_highlighted_item = 0;
  156. U8 *g_message_buffer = NULL;
  157. S32 g_max_push_messages = 0;
  158. /*
  159.   * We will set this flag when a push delete notification will come. So that 
  160.   * on idle 'new service message' pop can be avoid in case of push 
  161.   * replacement. This flag will be reset at the following place
  162.   *  - While reading the push message.
  163.   *  - While displaying the Inbox.
  164.   *  - While entering to the idle screen.
  165.   *  - While displaying the UM Main Screen (Only for UM)
  166.   */
  167. MMI_BOOL g_mmi_brw_delete_push_notification = MMI_FALSE;
  168. extern void mmi_um_brw_delete_all_push_messages_ind(void);
  169. extern void mmi_um_brw_highlight_push_messages_ind(void);
  170. /*****************************************************************************
  171.  * FUNCTION
  172.  *  mmi_brw_initialize_push_message_list
  173.  * DESCRIPTION
  174.  *  This function is responsible for initializing th push message list.
  175.  * PARAMETERS
  176.  *  void
  177.  * RETURNS
  178.  *  void
  179.  *****************************************************************************/
  180. void mmi_brw_initialize_push_message_list(void)
  181. {
  182.     /* Get maximum number of push mesages supported */
  183. #ifdef __MMI_UNIFIED_MESSAGE__
  184.     g_max_push_messages = MMI_UM_MAX_GET_LIST_MSG_NUMBER;
  185. #else /* __MMI_UNIFIED_MESSAGE__ */ 
  186.     g_max_push_messages = jdd_BrowserConfigGetMaxPushMessage();
  187. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  188. g_brw_service_msg_list_p = (SERVICE_VALUE **) jdd_MemAlloc(g_max_push_messages,sizeof(SERVICE_VALUE *));
  189. /* TODO : null check */
  190. jc_memset(g_brw_service_msg_list_p, 0, g_max_push_messages * sizeof(SERVICE_VALUE *));
  191. }
  192. /*****************************************************************************
  193.  * FUNCTION
  194.  *  mmi_brw_deinitialize_push_message_list
  195.  * DESCRIPTION
  196.  *  This function is responsible for freeing the push message list.
  197.  * PARAMETERS
  198.  *  void
  199.  * RETURNS
  200.  *  void
  201.  *****************************************************************************/
  202. void mmi_brw_deinitialize_push_message_list(void)
  203. {
  204.     if (g_brw_service_msg_list_p != NULL)
  205.     {
  206.         jdd_MemFree(g_brw_service_msg_list_p);
  207.         g_brw_service_msg_list_p = NULL;
  208.     }
  209. }
  210. /*****************************************************************************
  211.  * FUNCTION
  212.  *  mmi_brw_push_free_service_value_struct
  213.  * DESCRIPTION
  214.  *  This function is responsible for freeing service value struct.
  215.  * PARAMETERS
  216.  *  service_message     [IN]        Service value structure.
  217.  *  about push messages.(?)(?)
  218.  * RETURNS
  219.  *  returns local time.(?)
  220.  *  
  221.  *  Note : function is freeing only those field which are copied in(?)
  222.  *  mmi_brw_push_service_value_struct_dup. - Vivek 13072006(?)
  223.  *****************************************************************************/
  224. void mmi_brw_push_free_service_value_struct(SERVICE_VALUE **service_message)
  225. {
  226.     /*----------------------------------------------------------------*/
  227.     /* Local Variables                                                */
  228.     /*----------------------------------------------------------------*/
  229.     /*----------------------------------------------------------------*/
  230.     /* Code Body                                                      */
  231.     /*----------------------------------------------------------------*/
  232.     if ((NULL == service_message) || (NULL == *service_message))
  233.     {
  234.         return;
  235.     }
  236.     if ((*service_message)->pmHref != NULL)
  237.     {
  238.         jdd_MemFree((*service_message)->pmHref);
  239.         (*service_message)->pmHref = NULL;
  240.     }
  241.     if ((*service_message)->pSICreated != NULL)
  242.     {
  243.         jdd_MemFree((*service_message)->pSICreated);
  244.         (*service_message)->pSICreated = NULL;
  245.     }
  246.     if ((*service_message)->pSIExpires != NULL)
  247.     {
  248.         jdd_MemFree((*service_message)->pSIExpires);
  249.         (*service_message)->pSIExpires = NULL;
  250.     }
  251.     if ((*service_message)->pSIRcvd != NULL)
  252.     {
  253.         jdd_MemFree((*service_message)->pSIRcvd);
  254.         (*service_message)->pSIRcvd = NULL;
  255.     }
  256.     if ((*service_message)->pmMessage != NULL)
  257.     {
  258.         jdd_MemFree((*service_message)->pmMessage);
  259.         (*service_message)->pmMessage = NULL;
  260.     }
  261.     jdd_MemFree(*service_message);
  262.     *service_message = NULL;
  263. }
  264. /*****************************************************************************
  265.  * FUNCTION
  266.  *  mmi_brw_push_service_value_struct_dup
  267.  * DESCRIPTION
  268.  *  This function is responsible for creating the copy of service value structure.
  269.  * PARAMETERS
  270.  *  service_message     [?]         
  271.  *  SI_TIME(?)          [IN]        Time structure filled with GMT time.
  272.  *  about push messages.(?)(?)
  273.  * RETURNS
  274.  *  returns local time.
  275.  *  Note : We are copying only those value which are needed in MMI. - Vivek 13072006.
  276.  *****************************************************************************/
  277. SERVICE_VALUE *mmi_brw_push_service_value_struct_dup(SERVICE_VALUE *service_message)
  278. {
  279.     /*----------------------------------------------------------------*/
  280.     /* Local Variables                                                */
  281.     /*----------------------------------------------------------------*/
  282.     SERVICE_VALUE *dup_service_message = NULL;
  283.     /*----------------------------------------------------------------*/
  284.     /* Code Body                                                      */
  285.     /*----------------------------------------------------------------*/
  286.     dup_service_message = (SERVICE_VALUE*) jdd_MemAlloc(1, sizeof(SERVICE_VALUE));
  287.     if (NULL == dup_service_message)
  288.     {
  289.         return NULL;
  290.     }
  291.     dup_service_message->service_flag = service_message->service_flag;
  292.     if (service_message->pmMessage != NULL)
  293.     {
  294.         dup_service_message->pmMessage =
  295.             (JC_CHAR*) jdd_MemAlloc(jc_tcslen(service_message->pmMessage) + 1, sizeof(JC_CHAR));
  296.         if (NULL == dup_service_message->pmMessage)
  297.         {
  298.             mmi_brw_push_free_service_value_struct(&dup_service_message);
  299.             return NULL;
  300.         }
  301.         jc_tcscpy(dup_service_message->pmMessage, service_message->pmMessage);
  302.     }
  303.     if (service_message->pmHref != NULL)
  304.     {
  305.         dup_service_message->pmHref = (JC_CHAR*) jdd_MemAlloc(jc_tcslen(service_message->pmHref) + 1, sizeof(JC_CHAR));
  306.         if (NULL == dup_service_message->pmHref)
  307.         {
  308.             mmi_brw_push_free_service_value_struct(&dup_service_message);
  309.             return NULL;
  310.         }
  311.         jc_tcscpy(dup_service_message->pmHref, service_message->pmHref);
  312.     }
  313.     if (NULL != service_message->pSICreated)
  314.     {
  315.         dup_service_message->pSICreated = (SI_TIME*) jdd_MemAlloc(1, sizeof(SI_TIME));
  316.         if (NULL == dup_service_message->pSICreated)
  317.         {
  318.             mmi_brw_push_free_service_value_struct(&dup_service_message);
  319.             return NULL;
  320.         }
  321.         jc_memmove(dup_service_message->pSICreated, service_message->pSICreated, sizeof(SI_TIME));
  322.     }
  323.     if (NULL != service_message->pSIRcvd)
  324.     {
  325.         dup_service_message->pSIRcvd = (SI_TIME*) jdd_MemAlloc(1, sizeof(SI_TIME));
  326.         if (NULL == dup_service_message->pSIRcvd)
  327.         {
  328.             mmi_brw_push_free_service_value_struct(&dup_service_message);
  329.             return NULL;
  330.         }
  331.         jc_memmove(dup_service_message->pSIRcvd, service_message->pSIRcvd, sizeof(SI_TIME));
  332.     }
  333.     if (NULL != service_message->pSIExpires)
  334.     {
  335.         dup_service_message->pSIExpires = (SI_TIME*) jdd_MemAlloc(1, sizeof(SI_TIME));
  336.         if (NULL == dup_service_message->pSIExpires)
  337.         {
  338.             mmi_brw_push_free_service_value_struct(&dup_service_message);
  339.             return NULL;
  340.         }
  341.         jc_memmove(dup_service_message->pSIExpires, service_message->pSIExpires, sizeof(SI_TIME));
  342.     }
  343.     return dup_service_message;
  344. }
  345. /*****************************************************************************
  346.  * FUNCTION
  347.  *  convert_gmt_in_to_local_time
  348.  * DESCRIPTION
  349.  *  This function is responsible for converting GMT time in to local time.
  350.  * PARAMETERS
  351.  *  gmt_time_p      [?]         
  352.  *  SI_TIME(?)      [IN]        Time structure filled with GMT time.
  353.  *  about push messages.(?)(?)
  354.  * RETURNS
  355.  *  returns local time.
  356.  *****************************************************************************/
  357. static SI_TIME convert_gmt_in_to_local_time(SI_TIME *gmt_time_p)
  358. {
  359.     /*----------------------------------------------------------------*/
  360.     /* Local Variables                                                */
  361.     /*----------------------------------------------------------------*/
  362.     U32 tzdiff = 0;
  363.     U32 timeSecs = 0;
  364.     U32 local_time = 0;
  365.     FLOAT tz = 0.0; 
  366.     MYTIME result = {0};
  367.     MYTIME currGMTTime = {0};
  368.     SI_TIME local_time_p = {0};
  369.     applib_time_struct time;
  370.     /*----------------------------------------------------------------*/
  371.     /* Code Body                                                      */
  372.     /*----------------------------------------------------------------*/
  373.     if (NULL == gmt_time_p)
  374.     {
  375.         return local_time_p;
  376.     }
  377.     currGMTTime.nSec = gmt_time_p->seconds;
  378.     currGMTTime.nMin = gmt_time_p->minute;
  379.     currGMTTime.nHour = gmt_time_p->hour;
  380.     currGMTTime.nDay = gmt_time_p->day;
  381.     currGMTTime.nMonth = gmt_time_p->month;
  382.     currGMTTime.nYear = gmt_time_p->year;
  383.     timeSecs = (U32) mmi_dt_mytime_2_utc_sec(&currGMTTime, MMI_TRUE);
  384.     tz = mmi_dt_get_tz();
  385.     if(tz < 0)
  386.     {
  387.         time = applib_conv_tz_to_mytime(tz * (-1));
  388.     }
  389.     else
  390.     {
  391.         time = applib_conv_tz_to_mytime(tz);
  392.     }
  393.     tzdiff =  time.nHour * 3600 + time.nMin * 60 + time.nSec;
  394.     if(tz > 0)
  395.     {
  396.      local_time = timeSecs + tzdiff;
  397.     }
  398.     else
  399.     {
  400.      local_time = timeSecs - tzdiff;
  401.     }
  402.     mmi_dt_utc_sec_2_mytime(local_time, &result, MMI_TRUE);
  403.     local_time_p.year = result.nYear;
  404.     local_time_p.month = result.nMonth;
  405.     local_time_p.day = result.nDay;
  406.     local_time_p.hour = result.nHour;
  407.     local_time_p.minute = result.nMin;
  408.     local_time_p.seconds = result.nSec;
  409.     return local_time_p;
  410. }
  411. /*****************************************************************************
  412.  * FUNCTION
  413.  *  mmi_brw_create_push_display_format
  414.  * DESCRIPTION
  415.  *  This function is responsible for creating the formatted Push message string.
  416.  *  Push message should display in the following format.
  417.  *  SI message should be display in the following format(example)
  418.  *  
  419.  *  10 jan 2006 12:00 (If created date is not present then received date should be here)
  420.  *  Expires:
  421.  *  20 Jun 2006 12:00
  422.  *  URL:
  423.  *  http://www.exampleSISL.com
  424.  *  Message:
  425.  *  SISL message Body
  426.  *  
  427.  *  for SL messages only URL should display.
  428.  * PARAMETERS
  429.  *  push_message_struct     [IN]        Structure pointer which contatins all the information
  430.  *  about push messages.(?)
  431.  * RETURNS
  432.  *  returns buffer, which contains the formatted string of push messages.
  433.  *****************************************************************************/
  434. PS8 mmi_brw_create_push_display_format(SERVICE_VALUE *push_message_struct)
  435. {
  436.     /*----------------------------------------------------------------*/
  437.     /* Local Variables                                                */
  438.     /*----------------------------------------------------------------*/
  439.     S16 message_length = 0;
  440.     S16 message_href_length = 0;
  441.     S16 meassage_body_length = 0;
  442.     PS8 ucs2_message_buffer = NULL;
  443.     S8 ucs2_time_string[MMI_BRW_SI_DATE_N_TIME_STRING_LENGTH] = {0};
  444.     SI_TIME sisl_local_time = {0};
  445.     /*----------------------------------------------------------------*/
  446.     /* Code Body                                                      */
  447.     /*----------------------------------------------------------------*/
  448.     if (push_message_struct->service_flag == SERVICE_INDICATION)
  449.     {
  450.         meassage_body_length = pfnUnicodeStrlen((const S8*)push_message_struct->pmMessage);
  451.         message_href_length = pfnUnicodeStrlen((const S8*)push_message_struct->pmHref);
  452.         /* Calculate the length of the message */
  453.         message_length = message_href_length + meassage_body_length +
  454.             MMI_BRW_SI_DATE_N_TIME_STRING_LENGTH +
  455.             pfnUnicodeStrlen((const S8*)GetString(STR_ID_BRW_PUSH_MESSAGE)) +
  456.             pfnUnicodeStrlen((const S8*)GetString(STR_ID_BRW_PUSH_URL));
  457.         if (NULL != push_message_struct->pSIExpires)
  458.         {
  459.             message_length += (MMI_BRW_SI_DATE_N_TIME_STRING_LENGTH +
  460.                                pfnUnicodeStrlen((const S8*)GetString(STR_ID_BRW_PUSH_EXPIRES)));
  461.         }
  462.         /* adding 1 for '' */
  463.         ucs2_message_buffer = (PS8) jdd_MemAlloc((message_length + 1), ENCODING_LENGTH);
  464.         /* todo : check null value */
  465.         if (NULL != push_message_struct->pSICreated)
  466.         {
  467.             sisl_local_time = convert_gmt_in_to_local_time(push_message_struct->pSICreated);
  468.         }
  469.         else    /* If date Created is not present, use date received. */
  470.         {
  471.             sisl_local_time = convert_gmt_in_to_local_time(push_message_struct->pSIRcvd);
  472.         }
  473.         mmi_brw_create_ucs2_push_time_format_string(&sisl_local_time, ucs2_time_string);
  474.         pfnUnicodeStrcpy(ucs2_message_buffer, ucs2_time_string);
  475.         pfnUnicodeStrcat(ucs2_message_buffer, "n");
  476.         if (NULL != push_message_struct->pSIExpires)
  477.         {
  478.             pfnUnicodeStrcat(ucs2_message_buffer, GetString(STR_ID_BRW_PUSH_EXPIRES));
  479.             pfnUnicodeStrcat(ucs2_message_buffer, "n");
  480.             sisl_local_time = convert_gmt_in_to_local_time(push_message_struct->pSIExpires);
  481.             mmi_brw_create_ucs2_push_time_format_string(&sisl_local_time, ucs2_time_string);
  482.             pfnUnicodeStrcat(ucs2_message_buffer, ucs2_time_string);
  483.             pfnUnicodeStrcat(ucs2_message_buffer, "n");
  484.         }
  485.         pfnUnicodeStrcat((S8*) ucs2_message_buffer, GetString(STR_ID_BRW_PUSH_URL));
  486.         pfnUnicodeStrcat(ucs2_message_buffer, "n");
  487.         pfnUnicodeStrcat((S8*) ucs2_message_buffer, (const S8*)push_message_struct->pmHref);
  488.         pfnUnicodeStrcat((S8*) ucs2_message_buffer, "n");
  489.         if (0 != meassage_body_length)
  490.         {
  491.             pfnUnicodeStrcat((S8*) ucs2_message_buffer, GetString(STR_ID_BRW_PUSH_MESSAGE));
  492.             pfnUnicodeStrcat(ucs2_message_buffer, "n");
  493.             pfnUnicodeStrcat((S8*) ucs2_message_buffer, (const S8*)push_message_struct->pmMessage);
  494.         }
  495.     }
  496.     else if (push_message_struct->service_flag == SERVICE_LOADING)
  497.     {
  498.         message_href_length = pfnUnicodeStrlen((const S8*)push_message_struct->pmHref);
  499.         message_length = message_href_length + pfnUnicodeStrlen((const S8*)GetString(STR_ID_BRW_PUSH_URL));
  500.         ucs2_message_buffer = (PS8) jdd_MemAlloc((message_length + 2), ENCODING_LENGTH);
  501.         pfnUnicodeStrcpy(ucs2_message_buffer, GetString(STR_ID_BRW_PUSH_URL));
  502.         pfnUnicodeStrcat(ucs2_message_buffer, "n");
  503.         pfnUnicodeStrcat((S8*) ucs2_message_buffer, (const S8*)push_message_struct->pmHref);
  504.     }
  505.     else
  506.     {
  507.         /* error */
  508.     }
  509.     return ucs2_message_buffer;
  510. }
  511. /*****************************************************************************
  512.  * FUNCTION
  513.  *  mmi_brw_create_ucs2_push_time_format_string
  514.  * DESCRIPTION
  515.  *  This function is responsible for generating time string (As given in the following  example),
  516.  *  which will be displayed with push messages.
  517.  *  Ex. : 20 Jun 2006 12:00
  518.  * PARAMETERS
  519.  *  sisl_time               [?]         
  520.  *  ucs2_time_string        [IN]        
  521.  *  time(?)                 [IN]        Time structure.
  522.  * RETURNS
  523.  *  returns buffer, which contains the formatted string of time for push messages.(?)
  524.  *****************************************************************************/
  525. void mmi_brw_create_ucs2_push_time_format_string(SI_TIME *sisl_time, PS8 ucs2_time_string)
  526. {
  527.     /*----------------------------------------------------------------*/
  528.     /* Local Variables                                                */
  529.     /*----------------------------------------------------------------*/
  530.     MYTIME time = {0};
  531.     UI_character_type temp_time_buffer[20] = {0};
  532.     /*----------------------------------------------------------------*/
  533.     /* Code Body                                                      */
  534.     /*----------------------------------------------------------------*/
  535.     time.nYear = sisl_time->year;
  536.     time.nMonth = sisl_time->month;
  537.     time.nDay = sisl_time->day;
  538.     time.nHour = sisl_time->hour;
  539.     time.nMin = sisl_time->minute;
  540.     time.nSec = sisl_time->seconds;
  541.     date_string(&time, temp_time_buffer, DT_IDLE_SCREEN);
  542.     pfnUnicodeStrncpy((S8*) ucs2_time_string, (S8*) temp_time_buffer, pfnUnicodeStrlen((const S8*)temp_time_buffer));
  543.     pfnUnicodeStrncat((S8*) ucs2_time_string, (S8*) " ", 1);
  544.     time_string(&time, temp_time_buffer, DT_IDLE_SCREEN);
  545.     pfnUnicodeStrncat((S8*) ucs2_time_string, (S8*) temp_time_buffer, pfnUnicodeStrlen((const S8*)temp_time_buffer));
  546.     pfnUnicodeStrncat((S8*) ucs2_time_string, (S8*) "", 1);
  547. }
  548. /*****************************************************************************
  549.  * FUNCTION
  550.  *  mmi_brw_entry_read_push_message_exit
  551.  * DESCRIPTION
  552.  *  Exit Function to read arrived push message form idle screen
  553.  * PARAMETERS
  554.  *  void
  555.  * RETURNS
  556.  *  void
  557.  *****************************************************************************/
  558. void mmi_brw_entry_read_push_message_exit(void)
  559. {
  560.     /*----------------------------------------------------------------*/
  561.     /* Local Variables                                                */
  562.     /*----------------------------------------------------------------*/
  563.     /*----------------------------------------------------------------*/
  564.     /* Code Body                                                      */
  565.     /*----------------------------------------------------------------*/
  566.     if (NULL != g_message_buffer)
  567.     {
  568.         jdd_MemFree(g_message_buffer);
  569.         g_message_buffer = NULL;
  570.     }
  571. #ifdef __MMI_UNIFIED_MESSAGE__
  572.     if (!IsScreenPresent(SCR_ID_BRW_READ_SERVICE_MESSAGE))
  573.     {
  574.         mmi_brw_push_free_service_value_struct(&g_current_service_message);
  575.     }
  576. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  577. }
  578. #ifndef __MMI_UNIFIED_MESSAGE__
  579. /*****************************************************************************
  580.  * FUNCTION
  581.  *  mmi_brw_idle_screen_read_message_back_option
  582.  * DESCRIPTION
  583.  *  This function will be called when RSK
  584.  * PARAMETERS
  585.  *  void
  586.  * RETURNS
  587.  *  void
  588.  *****************************************************************************/
  589. void mmi_brw_idle_screen_read_message_back_option(void)
  590. {
  591.     /*----------------------------------------------------------------*/
  592.     /* Local Variables                                                */
  593.     /*----------------------------------------------------------------*/
  594.     /*----------------------------------------------------------------*/
  595.     /* Code Body                                                      */
  596.     /*----------------------------------------------------------------*/
  597.     mmi_brw_entry_service_inbox();
  598.     DeleteScreenIfPresent(SCR_ID_BRW_NEW_PUSH_MESSAGE_IND);
  599.     DeleteScreenIfPresent(SCR_ID_BRW_READ_SERVICE_MESSAGE);
  600.     /* DeleteUptoScrID(IDLE_SCREEN_ID); */
  601. }
  602. #endif /* __MMI_UNIFIED_MESSAGE__ */
  603. /*****************************************************************************
  604.  * FUNCTION
  605.  *  mmi_brw_entry_read_push_message
  606.  * DESCRIPTION
  607.  *  Deletes the entire recent page list
  608.  * PARAMETERS
  609.  *  void
  610.  * RETURNS
  611.  *  void
  612.  *****************************************************************************/
  613. void mmi_brw_entry_read_push_message(void)
  614. {
  615.     /*----------------------------------------------------------------*/
  616.     /* Local Variables                                                */
  617.     /*----------------------------------------------------------------*/
  618.     U8 *gui_buffer;
  619.     S32 buffer_size;
  620.     SERVICE_VALUE *selected_push_message_p = NULL;
  621.     /*----------------------------------------------------------------*/
  622.     /* Code Body                                                      */
  623.     /*----------------------------------------------------------------*/
  624.     g_mmi_brw_delete_push_notification = MMI_FALSE;
  625.     if (NULL == g_current_service_message)
  626.     {
  627.         selected_push_message_p = g_brw_service_msg_list_p[g_brw_index_current_highlighted_item];
  628.         /* Set the read status */
  629.         mmi_brw_set_read_status(1, g_brw_service_msg_list_p[g_brw_index_current_highlighted_item]);
  630.         /* Save to persistant storage */
  631.         mmi_brw_save_current_push_info();
  632.         mmi_brw_unread_push_message_indication();
  633.         UpdateStatusIcons();    /* Added By Vivek 24072006 */
  634.         g_message_buffer = (U8*) mmi_brw_create_push_display_format(selected_push_message_p);
  635.         g_current_service_message = mmi_brw_push_service_value_struct_dup(selected_push_message_p);
  636.         if(NULL == g_current_service_message)
  637.         {
  638.             DisplayPopup((PU8) GetString(STR_ID_BRW_PUSH_MEMORY_NOT_ENOUGH), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
  639.             return;
  640.         }
  641.     }
  642.     else
  643.     {
  644.         g_message_buffer = (U8*) mmi_brw_create_push_display_format(g_current_service_message);
  645.         selected_push_message_p = g_current_service_message;
  646.     }
  647.     EntryNewScreen(
  648.         SCR_ID_BRW_READ_SERVICE_MESSAGE,
  649.         mmi_brw_entry_read_push_message_exit,
  650.         mmi_brw_entry_read_push_message,
  651.         NULL);
  652.     gui_buffer = GetCurrGuiBuffer(SCR_ID_BRW_READ_SERVICE_MESSAGE);
  653.     buffer_size = pfnUnicodeStrlen((PS8) g_message_buffer);
  654.     if (selected_push_message_p->service_flag == SERVICE_LOADING)
  655.     {
  656.         ShowCategory74Screen(
  657.             STR_ID_BRW_MESSAGE,
  658.             GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  659.             STR_GLOBAL_OPTIONS,
  660.             IMG_GLOBAL_OPTIONS,
  661.             STR_GLOBAL_BACK,
  662.             IMG_GLOBAL_BACK,
  663.             g_message_buffer,
  664.             buffer_size,
  665.             gui_buffer);
  666.     }
  667.     else if (selected_push_message_p->service_flag == SERVICE_INDICATION)
  668.     {
  669.         ShowCategory74Screen(
  670.             STR_ID_BRW_MESSAGE,
  671.             GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  672.             STR_GLOBAL_OPTIONS,
  673.             IMG_GLOBAL_OPTIONS,
  674.             STR_GLOBAL_BACK,
  675.             IMG_GLOBAL_BACK,
  676.             g_message_buffer,
  677.             buffer_size,
  678.             gui_buffer);
  679.     }
  680.     else
  681.     {
  682.         /* Assert */
  683.     }
  684.     SetLeftSoftkeyFunction(mmi_brw_entry_service_inbox_read_options, KEY_EVENT_UP);
  685. #ifndef __MMI_UNIFIED_MESSAGE__
  686.     
  687.     if (TRUE == IsScreenPresent(SCR_ID_BRW_NEW_PUSH_MESSAGE_IND))
  688.     {
  689.         SetRightSoftkeyFunction(mmi_brw_idle_screen_read_message_back_option, KEY_EVENT_UP);
  690.         SetKeyHandler(mmi_brw_idle_screen_read_message_back_option, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  691.     }
  692.     else
  693.     {
  694.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  695.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  696.     }
  697. #else 
  698.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  699.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  700. #endif /* __MMI_UNIFIED_MESSAGE__ */
  701. }
  702. /*****************************************************************************
  703.  * FUNCTION
  704.  *  mmi_brw_unread_push_message_indication
  705.  * DESCRIPTION
  706.  *  Function to show unread push message icon on idle screen.
  707.  * PARAMETERS
  708.  *  void
  709.  * RETURNS
  710.  *  void
  711.  *****************************************************************************/
  712. void mmi_brw_unread_push_message_indication(void)
  713. {
  714.     /*----------------------------------------------------------------*/
  715.     /* Local Variables                                                */
  716.     /*----------------------------------------------------------------*/
  717.     JC_UINT32 brw_total_msg_count;
  718.     JC_UINT32 brw_unread_msg_count;
  719.     /*----------------------------------------------------------------*/
  720.     /* Code Body                                                      */
  721.     /*----------------------------------------------------------------*/
  722.     /* If browser is not ready then return */
  723.     if (!jbrowser_is_ready())
  724.     {
  725.         return; /* added by tk */
  726.     }
  727.     /* Show unread push message icon on idle screen */
  728.     mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);
  729.     if (brw_unread_msg_count > 0)
  730.     {
  731.         /* Display unread message icon on idle screen */
  732.         ShowStatusIcon(STATUS_ICON_WAP);
  733.     }
  734.     else
  735.     {
  736.         /* hide unread push message icon on idle screen */
  737.         HideStatusIcon(STATUS_ICON_WAP);
  738.     }
  739.     /* Commneted  by Vivek to fix the status bar rehresh prblem */
  740.     /* refresh_status_icon_display(); */
  741. }
  742. /*****************************************************************************
  743.  * FUNCTION
  744.  *  mmi_brw_entry_service_inbox_read_options
  745.  * DESCRIPTION
  746.  *  Entry function for recent page options screen.
  747.  * PARAMETERS
  748.  *  void
  749.  * RETURNS
  750.  *  void
  751.  *****************************************************************************/
  752. void mmi_brw_entry_service_inbox_read_options(void)
  753. {
  754.     /*----------------------------------------------------------------*/
  755.     /* Local Variables                                                */
  756.     /*----------------------------------------------------------------*/
  757.     U16 uc_list_of_items[3];
  758.     U8 *gui_buffer;
  759.     S32 num_of_items;
  760.     U16 parent_menuid;
  761.     /*----------------------------------------------------------------*/
  762.     /* Code Body                                                      */
  763.     /*----------------------------------------------------------------*/
  764.     EntryNewScreen(SCR_ID_BRW_PUSH_MESSAGE_READ_OPTIONS, NULL, mmi_brw_entry_service_inbox_read_options, NULL);
  765.     gui_buffer = GetCurrGuiBuffer(SCR_ID_BRW_PUSH_MESSAGE_READ_OPTIONS);
  766.     if (!isInCall())
  767.     {
  768.         parent_menuid = MENU_ID_BRW_PUSH_MSG_READ_OPTIONS_1;
  769.     }
  770.     else
  771.     {
  772.         parent_menuid = MENU_ID_BRW_PUSH_MSG_READ_OPTIONS_2;
  773.     }
  774.     num_of_items = GetNumOfChild(parent_menuid);
  775.     GetSequenceStringIds(parent_menuid, uc_list_of_items);
  776.     SetParentHandler(parent_menuid);
  777.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  778.     ShowCategory15Screen(
  779.         STR_GLOBAL_OPTIONS,
  780.         GetRootTitleIcon(SERVICES_WAP_MENU_ID),
  781.         STR_GLOBAL_OK,
  782.         0,
  783.         STR_GLOBAL_BACK,
  784.         0,
  785.         num_of_items,
  786.         uc_list_of_items,
  787.         (U16*) gIndexIconsImageList,
  788.         LIST_MENU,
  789.         0,
  790.         gui_buffer);
  791.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  792.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  793. }
  794. static MMI_BOOL mmi_brw_is_push_message_expired(void)
  795. {
  796.     struct tm expiry_timestamp = {0};
  797.     time_t expiry_secs_since_1970 = {0};
  798.     time_t current_secs_since_1970 = {0};
  799.     if ((g_current_service_message->service_flag == SERVICE_INDICATION) &&
  800.         (NULL != g_current_service_message->pSIExpires)
  801.        )
  802.     {
  803.         expiry_timestamp.tm_mon = g_current_service_message->pSIExpires->month - 1;      /* month scale to 0 to 11 */
  804.         expiry_timestamp.tm_year = g_current_service_message->pSIExpires->year - 1900;   /* offset since 1900 */
  805.         expiry_timestamp.tm_mday = g_current_service_message->pSIExpires->day;
  806.         expiry_timestamp.tm_hour = g_current_service_message->pSIExpires->hour;
  807.         expiry_timestamp.tm_min = g_current_service_message->pSIExpires->minute;
  808.         expiry_timestamp.tm_sec = g_current_service_message->pSIExpires->seconds;
  809.         /* Get difference of seconds of expiry time from 1970 (as per UTC standard) */
  810.         expiry_secs_since_1970 = (time_t) mktime(&expiry_timestamp);
  811.         /* Get difference of seconds of current time from 1970 (as per UTC standard) */
  812.         current_secs_since_1970 = get_current_utc_time();
  813.     
  814.         if (expiry_secs_since_1970 <= current_secs_since_1970)
  815.         {
  816.             return MMI_TRUE;
  817.         }
  818.     }
  819.     return MMI_FALSE;
  820. }
  821. /*****************************************************************************
  822.  * FUNCTION
  823.  *  mmi_brw_accept_push_message
  824.  * DESCRIPTION
  825.  *  Deletes the entire recent page list
  826.  * PARAMETERS
  827.  *  void
  828.  * RETURNS
  829.  *  void
  830.  *****************************************************************************/
  831. void mmi_brw_accept_push_message(void)
  832. {
  833.     /*----------------------------------------------------------------*/
  834.     /* Local Variables                                                */
  835.     /*----------------------------------------------------------------*/
  836.     MMI_BOOL is_valid_url;
  837.     /*----------------------------------------------------------------*/
  838.     /* Code Body                                                      */
  839.     /*----------------------------------------------------------------*/
  840.     if (TRUE == mmi_brw_is_push_message_expired())
  841.     {
  842.         DisplayPopup((PU8) GetString(STR_ID_BRW_PUSH_EXPIRED), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
  843.     }
  844.     else
  845.     {
  846.         is_valid_url = mmi_brw_validate_url((U8*) g_current_service_message->pmHref);
  847.         if (is_valid_url == MMI_TRUE)
  848.         {
  849.             mmi_JBrowserInitApp();
  850.             mmi_brw_set_current_url((S8*) g_current_service_message->pmHref);
  851.             mmi_brw_pre_entry_goto_url();
  852. /* Start - PMTSW00006677 & PMTSW00007001 */
  853.     #ifndef __MMI_UNIFIED_MESSAGE__
  854.             
  855.             /* 
  856.              * When there is only one unread service message, We display the message body 
  857.              * directly, instead of displaying the service Inbox, that is why  we are  adding 
  858.              * service Inbox screen so that while pressing cacel or while exiting the browser 
  859.              * user will come on Service Inbox screen. 
  860.              */
  861.             if ((FALSE == IsScreenPresent(SCR_ID_BRW_SERVICE_INBOX)) &&
  862.                 (FALSE == IsScreenPresent(SCR_ID_BRW_SERVICE_INBOX_OPTIONS))
  863.                ) 
  864.             {
  865.                 HistoryReplace(SCR_ID_BRW_READ_SERVICE_MESSAGE, SCR_ID_BRW_SERVICE_INBOX,mmi_brw_entry_service_inbox);
  866.             }
  867.             DeleteUptoScrID(SCR_ID_BRW_SERVICE_INBOX);
  868.     #else /*__MMI_UNIFIED_MESSAGE__*/
  869. g_brw_cntx.page_fetchReqSrc = 1;
  870.             DeleteUptoScrID(SCR_ID_UM_INBOX);
  871.     #endif /* __MMI_UNIFIED_MESSAGE__ */
  872. /* End - PMTSW00006677 & PMTSW00007001 */
  873.         }
  874.         else
  875.         {
  876.             DisplayPopup((PU8) GetString(STR_ID_BRW_INVALID_URL), IMG_GLOBAL_ERROR, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
  877.         }
  878.     }
  879. }
  880. /*****************************************************************************
  881.  * FUNCTION
  882.  *  mmi_brw_confirm_delete_push_message
  883.  * DESCRIPTION
  884.  *  This function displays the confirmation screen for deletion of push message
  885.  * PARAMETERS
  886.  *  void
  887.  * RETURNS
  888.  *  void
  889.  *****************************************************************************/
  890. void mmi_brw_confirm_delete_push_message(void)
  891. {
  892.     /*----------------------------------------------------------------*/
  893.     /* Local Variables                                                */
  894.     /*----------------------------------------------------------------*/
  895.     /*----------------------------------------------------------------*/
  896.     /* Code Body                                                      */
  897.     /*----------------------------------------------------------------*/
  898.     DisplayConfirm(
  899.         STR_GLOBAL_YES,
  900.         IMG_GLOBAL_YES,
  901.         STR_GLOBAL_NO,
  902.         IMG_GLOBAL_NO,
  903.         get_string(STR_ID_BRW_DELETE),
  904.         IMG_GLOBAL_QUESTION,
  905.         WARNING_TONE);
  906.     SetLeftSoftkeyFunction(mmi_brw_delete_push_message, KEY_EVENT_UP);
  907.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  908. }
  909. /*****************************************************************************
  910.  * FUNCTION
  911.  *  mmi_brw_delete_push_message
  912.  * DESCRIPTION
  913.  *  Deletes the push message from the list
  914.  * PARAMETERS
  915.  *  void
  916.  * RETURNS
  917.  *  void
  918.  *****************************************************************************/
  919. void mmi_brw_delete_push_message(void)
  920. {
  921.     /*----------------------------------------------------------------*/
  922.     /* Local Variables                                                */
  923.     /*----------------------------------------------------------------*/
  924.     U32 brw_total_msg_count = 0;
  925.     U32 brw_unread_msg_count = 0;
  926.     /*----------------------------------------------------------------*/
  927.     /* Code Body                                                      */
  928.     /*----------------------------------------------------------------*/
  929.     mmi_brw_delete_push_msg(g_brw_index_current_highlighted_item);
  930.     /* Added by Vivek - 13072006 */
  931.     mmi_brw_push_free_service_value_struct(&g_current_service_message);
  932.     /* update the copy of local pointers */
  933.     mmi_brw_create_push_msg_list();
  934.     /* Save to persistant storage */
  935.     mmi_brw_save_current_push_info();
  936.     mmi_brw_get_push_statistics(&brw_total_msg_count, &brw_unread_msg_count);
  937.     if (brw_unread_msg_count > 0)
  938.     {
  939.         /* Display unread message icon on idle screen */
  940.         ShowStatusIcon(STATUS_ICON_WAP);
  941.     }
  942.     else
  943.     {
  944.         /* hide unread push message icon on idle screen */
  945.         HideStatusIcon(STATUS_ICON_WAP);
  946.     }
  947.     /* DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_DELETED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE); */
  948.     /* Edited by Vivek - 02082006. Now instead of displaying the image IMG_GLOBAL_DELETED
  949.        we are displaying IMG_GLOBAL_ACTIVATED as we are doing in other part of browser */
  950.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
  951. #ifndef __MMI_UNIFIED_MESSAGE__
  952.     if (IsScreenPresent(SCR_ID_BRW_SERVICE_INBOX))
  953.     {
  954.         DeleteUptoScrID(SCR_ID_BRW_SERVICE_INBOX);
  955.     }
  956.     else    /* when message is deleted from idle screen */
  957.     {
  958.         mmi_brw_entry_service_inbox();
  959.         DeleteScreenIfPresent(SCR_ID_BRW_PUSH_MESSAGE_READ_OPTIONS);
  960.         DeleteScreenIfPresent(SCR_ID_BRW_NEW_PUSH_MESSAGE_IND);
  961.         DeleteScreenIfPresent(SCR_ID_BRW_READ_SERVICE_MESSAGE);
  962.     }
  963. #else /* __MMI_UNIFIED_MESSAGE__ */ 
  964.     mmi_um_brw_highlight_push_messages_ind();
  965.     DeleteUptoScrID(SCR_ID_UM_INBOX);
  966. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  967. }
  968. /*****************************************************************************
  969.  * FUNCTION
  970.  *  mmi_brw_confirm_delete_all_push_messages
  971.  * DESCRIPTION
  972.  *  This function displays the confirmation screen for deletion of entire recent page list
  973.  * PARAMETERS
  974.  *  void
  975.  * RETURNS
  976.  *  void
  977.  *****************************************************************************/
  978. void mmi_brw_confirm_delete_all_push_messages(void)
  979. {
  980.     /*----------------------------------------------------------------*/
  981.     /* Local Variables                                                */
  982.     /*----------------------------------------------------------------*/
  983.     /*----------------------------------------------------------------*/
  984.     /* Code Body                                                      */
  985.     /*----------------------------------------------------------------*/
  986.     DisplayConfirm(
  987.         STR_GLOBAL_YES,
  988.         IMG_GLOBAL_YES,
  989.         STR_GLOBAL_NO,
  990.         IMG_GLOBAL_NO,
  991.         get_string(STR_ID_BRW_DELETE_ALL),
  992.         IMG_GLOBAL_QUESTION,
  993.         WARNING_TONE);
  994. #ifndef __MMI_UNIFIED_MESSAGE__
  995.     SetLeftSoftkeyFunction(mmi_brw_delete_all_push_messages, KEY_EVENT_UP);
  996. #else 
  997.     SetLeftSoftkeyFunction(mmi_um_brw_delete_all_push_messages_ind, KEY_EVENT_UP);
  998. #endif 
  999.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1000. }
  1001. /*****************************************************************************
  1002.  * FUNCTION
  1003.  *  mmi_brw_create_push_msg_list
  1004.  * DESCRIPTION
  1005.  *  Function to create the list of push messages
  1006.  * PARAMETERS
  1007.  *  void
  1008.  * RETURNS
  1009.  *  void
  1010.  *****************************************************************************/
  1011. void mmi_brw_create_push_msg_list()
  1012. {
  1013.     /*----------------------------------------------------------------*/
  1014.     /* Local Variables                                                */
  1015.     /*----------------------------------------------------------------*/
  1016.     S32 msg_counter = 0, temp_ctr;
  1017.     SERVICE_VALUE *service_msg_p = NULL;
  1018.     /*----------------------------------------------------------------*/
  1019.     /* Code Body                                                      */
  1020.     /*----------------------------------------------------------------*/
  1021.     for (temp_ctr = 0; temp_ctr < g_max_push_messages; temp_ctr++)
  1022.     {
  1023.         if (g_brw_service_msg_list_p[temp_ctr] != NULL)
  1024.         {
  1025.             g_brw_service_msg_list_p[temp_ctr] = NULL;
  1026.         }
  1027.         else
  1028.         {
  1029.             break;
  1030.         }
  1031.     }
  1032.     /* Get Jataayu service list */
  1033.     mmi_brw_get_push_servicelist(&service_msg_p);
  1034.     while (service_msg_p != NULL)
  1035.     {
  1036.         g_brw_service_msg_list_p[msg_counter] = service_msg_p;
  1037.         service_msg_p = service_msg_p->pNext;
  1038.         msg_counter++;
  1039.     }
  1040. }
  1041. /*****************************************************************************
  1042.  * FUNCTION
  1043.  *  get_current_utc_time
  1044.  * DESCRIPTION
  1045.  *  This function returns the current time of the system.
  1046.  *  The time returned is UTC time.
  1047.  * PARAMETERS
  1048.  *  void
  1049.  * RETURNS
  1050.  *  S32.
  1051.  *****************************************************************************/
  1052. U32 get_current_utc_time(void)
  1053. {
  1054.     /*----------------------------------------------------------------*/
  1055.     /* Local Variables                                                */
  1056.     /*----------------------------------------------------------------*/
  1057.     S32 timeSecs;
  1058.     FLOAT tz;
  1059.     U32 tzdiff = 0;
  1060.     MYTIME t;
  1061.     applib_time_struct time;
  1062.     /*----------------------------------------------------------------*/
  1063.     /* Code Body                                                      */
  1064.     /*----------------------------------------------------------------*/
  1065.     mmi_dt_get_secure_time(&t);
  1066.     timeSecs=mmi_dt_mytime_2_utc_sec(&t,TRUE);
  1067.     tz = mmi_dt_get_tz();
  1068.     if(tz < 0)
  1069.     {
  1070.         time = applib_conv_tz_to_mytime(tz * (-1));
  1071.     }
  1072.     else
  1073.     {
  1074.         time = applib_conv_tz_to_mytime(tz);
  1075.     }
  1076.     tzdiff =  time.nHour * 3600 + time.nMin * 60 + time.nSec;
  1077.     if(tz > 0)
  1078.     {
  1079.         return timeSecs-tzdiff;
  1080.     }
  1081.     else
  1082.     {
  1083.         return timeSecs+tzdiff;
  1084.     }
  1085. }
  1086. #endif /* defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT) */ 
  1087. #endif /* _MMI_PUSHINBOXCOMMONUI_C */