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

MTK

开发平台:

C/C++

  1.    
  2.   
  3.     //PMT VIKAS START 20060325
  4.     ///MMS Size            
  5.     memset(temp, 0x00, 14);
  6.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  7.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  8.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SIZE));
  9.     memset(temp, 0x00, 14);
  10.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  11.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  12.     mmi_jmms_save_size_of_mms(&size, MMS_SIZE_RETRIVE);
  13.     size_kb = size / 1024;
  14.     size_bytes = size % 1024;
  15.     if (size_kb >= 1)
  16.     {
  17.         size_kb++;
  18.         memset(temp, 0x00, 14);
  19.         gui_itoa((S32) size_kb, (UI_string_type) temp, 10);
  20.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  21.         memset(temp, 0x00, 4);
  22.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  23.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  24.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_KB));
  25.     }
  26.     else
  27.     {
  28.         memset(temp, 0x00, 14);
  29.         gui_itoa((S32) size_bytes, (UI_string_type) temp, 10);
  30.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  31.         memset(temp, 0x00, 4);
  32.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  33.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  34.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BYTES));
  35.     }
  36.     /* PMT VIKAS END 20060325 */
  37.     ShowCategory78Screen(
  38. /* MAUI_00018481 Start */
  39. STR_ID_JMMS_OPTIONS_PROPERTIES,
  40. /* MAUI_0001848 End */
  41.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  42.         NULL,
  43.         NULL,
  44.         STR_GLOBAL_BACK,
  45.         IMG_GLOBAL_BACK,
  46.         NULL,
  47.         (U8*) subMenuData,
  48.         pfnUnicodeStrlen((S8*) subMenuData),
  49.         gui_buffer);
  50.     SetRightSoftkeyFunction(mm_jmms_back_from_sent_msg_properties, KEY_EVENT_UP);
  51.     SetKeyHandler(mm_jmms_back_from_sent_msg_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  52. if (isInCall() == FALSE)
  53.     SetKeyHandler(mm_jmms_end_from_sent_msg_properties, KEY_END, KEY_EVENT_DOWN);
  54.     return;
  55. }
  56. /*End :Added by dilip on 10th sept to show Template properties screen*/
  57. /*****************************************************************************
  58.  * FUNCTION
  59.  *  mm_jmms_back_from_sent_msg_properties
  60.  * DESCRIPTION
  61.  *  
  62.  * PARAMETERS
  63.  *  void
  64.  * RETURNS
  65.  *  void
  66.  *****************************************************************************/
  67. void mm_jmms_back_from_sent_msg_properties(void)
  68. {
  69.     /*----------------------------------------------------------------*/
  70.     /* Local Variables                                                */
  71.     /*----------------------------------------------------------------*/
  72.     /*----------------------------------------------------------------*/
  73.     /* Code Body                                                      */
  74.     /*----------------------------------------------------------------*/
  75.     mmi_jmms_free_new_mms_sent_header();
  76.     GoBackHistory();
  77. }
  78. /*****************************************************************************
  79.  * FUNCTION
  80.  *  mm_jmms_end_from_sent_msg_properties
  81.  * DESCRIPTION
  82.  *  
  83.  * PARAMETERS
  84.  *  void
  85.  * RETURNS
  86.  *  void
  87.  *****************************************************************************/
  88. void mm_jmms_end_from_sent_msg_properties(void)
  89. {
  90.     /*----------------------------------------------------------------*/
  91.     /* Local Variables                                                */
  92.     /*----------------------------------------------------------------*/
  93.     /*----------------------------------------------------------------*/
  94.     /* Code Body                                                      */
  95.     /*----------------------------------------------------------------*/
  96.     mmi_jmms_free_new_mms_sent_header();
  97.     DisplayIdleScreen();
  98. }
  99. /*****************************************************************************
  100.  * FUNCTION
  101.  *  mmi_jmms_show_notification_properties
  102.  * DESCRIPTION
  103.  *  
  104.  * PARAMETERS
  105.  *  void
  106.  * RETURNS
  107.  *  void
  108.  *****************************************************************************/
  109. void mmi_jmms_show_notification_properties(void)
  110. {
  111.     /*----------------------------------------------------------------*/
  112.     /* Local Variables                                                */
  113.     /*----------------------------------------------------------------*/
  114.     PU8 gui_buffer; /* Buffer holding history data */
  115.     S8 temp[14];
  116.     U8 dttemp[40];
  117.     MYTIME time1, time;
  118.     FLOAT timezone;
  119.     S32 expiry_secs = 0, expiry_hrs = 0, expiry_mins = 0, expiry_days = 0;
  120.     S32 size = 0, size_kb = 0, size_bytes = 0;
  121. #ifdef __MMI_UNIFIED_MESSAGE__
  122.     U16 left_softkey_property = NULL;
  123.     U16 left_softkey_icon_property = NULL;
  124. #endif
  125.     /*----------------------------------------------------------------*/
  126.     /* Code Body                                                      */
  127.     /*----------------------------------------------------------------*/
  128.     timezone = mmi_dt_get_tz();
  129.     EntryNewScreen(SCR_ID_JMMS_NOTIFICATION_PROPERTIES, NULL, mmi_jmms_show_notification_properties, NULL);
  130.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NOTIFICATION_PROPERTIES);
  131.     pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_FROM));
  132.     memset(temp, 0x00, 14);
  133.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  134.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  135.     if (((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->pFrom == NULL)
  136.     {
  137.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  138.     }
  139.     else
  140.     {
  141.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->pFrom);
  142.     }
  143.     /* /Subject */
  144.     memset(temp, 0x00, 14);
  145.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  146.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  147.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
  148.     memset(temp, 0x00, 14);
  149.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  150.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  151.     if (((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->pSubject == NULL)
  152.     {
  153.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  154.     }
  155.     else
  156.     {
  157.         pfnUnicodeStrcat(
  158.             (S8*) subMenuData,
  159.             (S8*) ((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->pSubject);
  160.     }
  161.     /* Expiry Time */
  162.     memset(temp, 0x00, 14);
  163.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  164.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  165.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_EXPIRE_TIME));
  166.     memset(temp, 0x00, 14);
  167.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  168.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  169.     expiry_secs = (S32) (((MESSAGE_NOTIFICATION*) (g_jmms_context->notification_p))->uiExpiryTime);
  170.     expiry_hrs = (S32) (expiry_secs / 3600);
  171.     if (expiry_hrs > 24)    /* /> 1 day */
  172.     {
  173.         expiry_days = expiry_hrs / 24;
  174.         expiry_hrs = expiry_hrs % 24;
  175.         /* /expiry days */
  176.         memset(temp, 0x00, 14);
  177.         gui_itoa((S32) expiry_days, (UI_string_type) temp, 10);
  178.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  179.         memset(temp, 0x00, 4);
  180.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  181.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  182.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DAYS));
  183.         if (expiry_hrs > 0)
  184.         {
  185.             memset(temp, 0x00, 4);
  186.             AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  187.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  188.             /* /expiry hrs */
  189.             memset(temp, 0x00, 14);
  190.             gui_itoa((S32) expiry_hrs, (UI_string_type) temp, 10);
  191.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  192.             memset(temp, 0x00, 4);
  193.             AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  194.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  195.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_HRS));
  196.         }
  197.     }
  198.     else
  199.     {
  200.         /* /expiry hrs */
  201.         memset(temp, 0x00, 14);
  202.         gui_itoa((S32) expiry_hrs, (UI_string_type) temp, 10);
  203.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  204.         memset(temp, 0x00, 4);
  205.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  206.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  207.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_HRS));
  208.         /* /expiry mins */
  209.         expiry_mins = (S32) ((expiry_secs % 3600) / 60);
  210.         if (expiry_mins > 0)
  211.         {
  212.             memset(temp, 0x00, 4);
  213.             AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  214.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  215.             memset(temp, 0x00, 14);
  216.             gui_itoa((S32) expiry_mins, (UI_string_type) temp, 10);
  217.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  218.             memset(temp, 0x00, 4);
  219.             AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  220.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  221.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_MINS));
  222.         }
  223.     }
  224.     /* /Size of MMS */
  225.     memset(temp, 0x00, 14);
  226.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  227.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  228.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SIZE));
  229.     memset(temp, 0x00, 14);
  230.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  231.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  232.     size = (S32) (((MESSAGE_NOTIFICATION*) (g_jmms_context->notification_p))->uiMessageSize);
  233.     size_kb = size / 1024;
  234.     size_bytes = size % 1024;
  235.     if (size_kb >= 1)
  236.     {
  237.         size_kb++;
  238.         memset(temp, 0x00, 14);
  239.         gui_itoa((S32) size_kb, (UI_string_type) temp, 10);
  240.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  241.         memset(temp, 0x00, 4);
  242.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  243.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  244.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_KB));
  245.     }
  246.     else
  247.     {
  248.         memset(temp, 0x00, 14);
  249.         gui_itoa((S32) size_bytes, (UI_string_type) temp, 10);
  250.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  251.         memset(temp, 0x00, 4);
  252.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  253.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  254.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BYTES));
  255.     }
  256.     /* /Priority */
  257.     memset(temp, 0x00, 14);
  258.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  259.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  260.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_PRIORITY));
  261.     memset(temp, 0x00, 14);
  262.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  263.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  264. /* MAUI_00017989 Start */
  265. /* MAUI_00018625 Start */
  266.     switch (((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->eMsgPriority)
  267. /* MAUI_00018625 End */
  268. /* MAUI_00017989 End */
  269.     {
  270.         case E_MSG_PRIORITY_LOW:
  271.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_LOW));
  272.             break;
  273.         case E_MSG_PRIORITY_NORMAL:
  274.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_NORMAL));
  275.             break;
  276.         case E_MSG_PRIORITY_HIGH:
  277.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_HIGH));
  278.             break;
  279.         default:
  280.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  281.             break;
  282.     }
  283.     /* //message class */
  284.     memset(temp, 0x00, 14);
  285.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  286.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  287.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_MSG_CLASS));
  288.     memset(temp, 0x00, 14);
  289.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  290.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  291.     switch (((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->eMsgClass)
  292.     {
  293.         case E_MSG_PERSONAL_CLASS:
  294.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_PERSONEL_MSG_CLASS));
  295.             break;
  296.         case E_MSG_ADVERTISEMENT_CLASS:
  297.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_ADVERTISMENT));
  298.             break;
  299.         case E_MSG_INFORMATION_CLASS:
  300.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_INFORMATIONAL_MSG_CLASS));
  301.             break;
  302.         case E_MSG_AUTO_CLASS:
  303.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_AUTO_MSG_CLASS));
  304.             break;
  305.         default:
  306.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  307.             break;
  308.     }
  309.     /* /Recieve Date */
  310.     memset(temp, 0x00, 14);
  311.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  312.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  313.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
  314.     memset(temp, 0x00, 14);
  315.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  316.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  317.     mmi_dt_utc_sec_2_mytime(
  318.         (U32) ((MESSAGE_NOTIFICATION*) g_jmms_context->notification_p)->uiReceivedTime,
  319.         &time1,
  320.         MMI_TRUE);
  321.     mmi_dt_utc_to_rtc(timezone, time1, time);
  322.     /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
  323.     /* Date */
  324.     memset(dttemp, 0x00, 40);
  325.     date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  326.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  327.     memset(temp, 0x00, 6);
  328.     AnsiiToUnicodeString((PS8) temp, (PS8) "n");
  329.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  330.     /* Time */
  331.     memset(dttemp, 0x00, 40);
  332.     time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  333.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  334.     /* END of changes - RAJ KUMAR GUPTA */
  335. #ifdef __MMI_UNIFIED_MESSAGE__
  336. if(g_jmms_context->last_scr_id == SCR_ID_JMMS_INBOX_OPTIONS)
  337. {
  338.         left_softkey_property = NULL;
  339.         left_softkey_icon_property = NULL;
  340. }
  341. else
  342. {
  343.         left_softkey_property = STR_GLOBAL_OPTIONS;
  344.         left_softkey_icon_property = IMG_GLOBAL_OPTIONS;
  345. }
  346. #endif
  347. /* MAUI_00018481 Start */
  348.     ShowCategory78Screen(STR_ID_JMMS_OPTIONS_PROPERTIES, GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  349. /* MAUI_00018481 End */
  350. #ifdef __MMI_UNIFIED_MESSAGE__
  351.                          left_softkey_property, left_softkey_icon_property,
  352. #else 
  353.                          NULL, NULL,
  354. #endif 
  355.                          STR_GLOBAL_BACK,
  356.                          IMG_GLOBAL_BACK, NULL, (U8*) subMenuData, pfnUnicodeStrlen((S8*) subMenuData), gui_buffer);
  357.     SetRightSoftkeyFunction(mm_jmms_back_from_noification_properties, KEY_EVENT_UP);
  358.     SetKeyHandler(mm_jmms_back_from_noification_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  359. #ifdef __MMI_UNIFIED_MESSAGE__
  360. if(g_jmms_context->last_scr_id != SCR_ID_JMMS_INBOX_OPTIONS)
  361. {
  362. SetKeyHandler(mmi_jmms_pre_entry_inbox_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  363. SetLeftSoftkeyFunction(mmi_jmms_pre_entry_inbox_options_scren, KEY_EVENT_UP);
  364. }
  365. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  366. if (isInCall() == FALSE)
  367.     SetKeyHandler(mm_jmms_end_from_notification_properties, KEY_END, KEY_EVENT_DOWN);
  368.     return;
  369. }
  370. /*****************************************************************************
  371.  * FUNCTION
  372.  *  mm_jmms_back_from_noification_properties
  373.  * DESCRIPTION
  374.  *  
  375.  * PARAMETERS
  376.  *  void
  377.  * RETURNS
  378.  *  void
  379.  *****************************************************************************/
  380. void mm_jmms_back_from_noification_properties(void)
  381. {
  382.     /*----------------------------------------------------------------*/
  383.     /* Local Variables                                                */
  384.     /*----------------------------------------------------------------*/
  385.     /*----------------------------------------------------------------*/
  386.     /* Code Body                                                      */
  387.     /*----------------------------------------------------------------*/
  388. #ifdef __MMI_UNIFIED_MESSAGE__
  389. g_jmms_context->last_scr_id = 0;
  390. #endif
  391.     mmi_jmms_free_notification_header();
  392.     GoBackHistory();
  393. }
  394. /*****************************************************************************
  395.  * FUNCTION
  396.  *  mm_jmms_end_from_notification_properties
  397.  * DESCRIPTION
  398.  *  
  399.  * PARAMETERS
  400.  *  void
  401.  * RETURNS
  402.  *  void
  403.  *****************************************************************************/
  404. void mm_jmms_end_from_notification_properties(void)
  405. {
  406.     /*----------------------------------------------------------------*/
  407.     /* Local Variables                                                */
  408.     /*----------------------------------------------------------------*/
  409.     /*----------------------------------------------------------------*/
  410.     /* Code Body                                                      */
  411.     /*----------------------------------------------------------------*/
  412. #ifdef __MMI_UNIFIED_MESSAGE__
  413. g_jmms_context->last_scr_id = 0;
  414. #endif
  415.     mmi_jmms_free_notification_header();
  416.     DisplayIdleScreen();
  417. }
  418. /*****************************************************************************
  419.  * FUNCTION
  420.  *  mmi_jmms_entry_java_mms_properties
  421.  * DESCRIPTION
  422.  *  
  423.  * PARAMETERS
  424.  *  void
  425.  * RETURNS
  426.  *  void
  427.  *****************************************************************************/
  428. void mmi_jmms_entry_java_mms_properties(void)
  429. {
  430.     /*----------------------------------------------------------------*/
  431.     /* Local Variables                                                */
  432.     /*----------------------------------------------------------------*/
  433.     PU8 gui_buffer; /* Buffer holding history data */
  434.     S8 temp[14];
  435.     U8 dttemp[40];
  436.     MYTIME time1, time;
  437.     FLOAT timezone;
  438.     /* PMT VIKAS START 20060325 */
  439.     S32 size = 0, size_kb = 0, size_bytes = 0;
  440.     /* PMT VIKAS END 20060325 */
  441.     S8 *app_id = NULL, *reply_to_app_id = NULL;
  442.     MM1_HDR_PARAM *pContentTypeParams = NULL;
  443.     U32 len = 0;
  444. #ifdef __MMI_UNIFIED_MESSAGE__
  445.     U16 left_softkey_property = NULL;
  446.     U16 left_softkey_icon_property = NULL;
  447. #endif
  448.     /*----------------------------------------------------------------*/
  449.     /* Code Body                                                      */
  450.     /*----------------------------------------------------------------*/
  451.     timezone = mmi_dt_get_tz();
  452.     EntryNewScreen(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES, NULL, mmi_jmms_entry_java_mms_properties, NULL);
  453.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES);
  454.     /* From */
  455.     pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_FROM));
  456.     memset(temp, 0x00, 14);
  457.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  458.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  459.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pFrom == NULL)
  460.     {
  461.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  462.     }
  463.     else
  464.     {
  465.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pFrom);
  466.     }
  467.     /* /TO */
  468.     memset(temp, 0x00, 14);
  469.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  470.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  471.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
  472.     memset(temp, 0x00, 14);
  473.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  474.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  475.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pTo == NULL)
  476.     {
  477.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  478.     }
  479.     else
  480.     {
  481.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pTo);
  482.     }
  483.     /* /CC */
  484.     memset(temp, 0x00, 14);
  485.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  486.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  487.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_CC));
  488.     memset(temp, 0x00, 14);
  489.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  490.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  491.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pCc == NULL)
  492.     {
  493.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  494.     }
  495.     else
  496.     {
  497.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pCc);
  498.     }
  499.     /* /Subject */
  500.     memset(temp, 0x00, 14);
  501.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  502.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  503.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
  504.     memset(temp, 0x00, 14);
  505.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  506.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  507.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pSubject == NULL)
  508.     {
  509.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  510.     }
  511.     else
  512.     {
  513.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->pSubject);
  514.     }
  515.     /* /Priority */
  516.     memset(temp, 0x00, 14);
  517.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  518.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  519.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_PRIORITY));
  520.     memset(temp, 0x00, 14);
  521.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  522.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  523. /* MAUI_00017989 Start */
  524. /* MAUI_00018625 Start */
  525.     switch (((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->eMsgPriority )
  526. /* MAUI_00018625 End */
  527. /* MAUI_00017989 End */
  528.     {
  529.         case E_MSG_PRIORITY_LOW:
  530.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_LOW));
  531.             break;
  532.         case E_MSG_PRIORITY_NORMAL:
  533.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_NORMAL));
  534.             break;
  535.         case E_MSG_PRIORITY_HIGH:
  536.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_HIGH));
  537.             break;
  538.         default:
  539.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  540.             break;
  541.     }
  542.     jdi_MsgGetContentTypeParams(g_jmms_context->msg_handle, &pContentTypeParams);
  543.     while (pContentTypeParams != NULL)
  544.     {
  545.         if (mmi_jmms_jsr_get_application_string_from_content_type(pContentTypeParams->pszName, JSR_APPLICATION_ID) != NULL)
  546.         {
  547.             len = strlen((S8*) (pContentTypeParams->pszValue));
  548.             app_id = (S8*) jdd_MemAlloc(sizeof(S8), len * ENCODING_LENGTH + ENCODING_LENGTH);
  549.             if (app_id == NULL)
  550.             {
  551.                 return;
  552.             }
  553.             AnsiiToUnicodeString((PS8) app_id, (PS8) (pContentTypeParams->pszValue));
  554.             memset(temp, 0x00, 14);
  555.             AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  556.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  557.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_APPLICATION_ID));
  558.             memset(temp, 0x00, 14);
  559.             AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  560.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  561.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) app_id);
  562.         }
  563.         else if (mmi_jmms_jsr_get_application_string_from_content_type(pContentTypeParams->pszName, JSR_REPLY_TO_APPLICATION_ID) != NULL)
  564.         {
  565.             len = strlen((S8*) (pContentTypeParams->pszValue));
  566.             reply_to_app_id = (S8*) jdd_MemAlloc(sizeof(S8), len * ENCODING_LENGTH + ENCODING_LENGTH);
  567.             if (reply_to_app_id == NULL)
  568.             {
  569.                 return;
  570.             }
  571.             AnsiiToUnicodeString((PS8) reply_to_app_id, (PS8) (pContentTypeParams->pszValue));
  572.             memset(temp, 0x00, 14);
  573.             AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  574.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  575.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_REPLY_TO_APPLICATION_ID));
  576.             memset(temp, 0x00, 14);
  577.             AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  578.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  579.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) reply_to_app_id);
  580.         }
  581.         pContentTypeParams = pContentTypeParams->pNext;
  582.     }
  583.     if (app_id != NULL)
  584.     {
  585.         jdd_MemFree(app_id);
  586.     }
  587.     if (reply_to_app_id != NULL)
  588.     {
  589.         jdd_MemFree(reply_to_app_id);
  590.     }
  591.     /* /Recieved Date */
  592.     memset(temp, 0x00, 14);
  593.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  594.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  595.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
  596.     memset(temp, 0x00, 14);
  597.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  598.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  599.     mmi_dt_utc_sec_2_mytime((U32) ((MESSAGE_RETRIEVAL*) g_jmms_context->MsgHeader_type_p)->uiDate, &time1, MMI_TRUE);
  600.     mmi_dt_utc_to_rtc(timezone, time1, time);
  601.     /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
  602.     /* Date */
  603.     memset(dttemp, 0x00, 40);
  604.     date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  605.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  606.  
  607.     memset(temp, 0x00, 6);
  608.     AnsiiToUnicodeString((PS8) temp, (PS8) "n");
  609.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  610.     /* Time */
  611.     memset(dttemp, 0x00, 40);
  612.     time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  613.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  614.     /* END of Changes - RAJ KUMAR GUPTA */
  615.     //PMT VIKAS START 20060325
  616.     ///MMS Size            
  617.     memset(temp, 0x00, 14);
  618.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  619.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  620.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SIZE));
  621.     memset(temp, 0x00, 14);
  622.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  623.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  624.     mmi_jmms_save_size_of_mms(&size, MMS_SIZE_RETRIVE);
  625.     size_kb = size / 1024;
  626.     size_bytes = size % 1024;
  627.     if (size_kb >= 1)
  628.     {
  629.         size_kb++;
  630.         memset(temp, 0x00, 14);
  631.         gui_itoa((S32) size_kb, (UI_string_type) temp, 10);
  632.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  633.         memset(temp, 0x00, 4);
  634.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  635.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  636.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_KB));
  637.     }
  638.     else
  639.     {
  640.         memset(temp, 0x00, 14);
  641.         gui_itoa((S32) size_bytes, (UI_string_type) temp, 10);
  642.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  643.         memset(temp, 0x00, 4);
  644.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  645.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  646.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BYTES));
  647.     }
  648.     /* PMT VIKAS END 20060325 */
  649. #ifdef __MMI_UNIFIED_MESSAGE__
  650. if(g_jmms_context->last_scr_id == SCR_ID_JMMS_INBOX_OPTIONS)
  651. {
  652.         left_softkey_property = NULL;
  653.         left_softkey_icon_property = NULL;
  654. }
  655. else
  656. {
  657.         left_softkey_property = STR_GLOBAL_OPTIONS;
  658.         left_softkey_icon_property = IMG_GLOBAL_OPTIONS;
  659. }
  660. #endif
  661. /* MAUI_00018481 Start */
  662.     ShowCategory78Screen(STR_ID_JMMS_OPTIONS_PROPERTIES, GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  663. /* MAUI_00018481 End */
  664. #ifdef __MMI_UNIFIED_MESSAGE__
  665.                          left_softkey_property, left_softkey_icon_property,
  666. #else 
  667.                          NULL, NULL,
  668. #endif 
  669.                          STR_GLOBAL_BACK,
  670.                          IMG_GLOBAL_BACK, NULL, (U8*) subMenuData, pfnUnicodeStrlen((S8*) subMenuData), gui_buffer);
  671.     SetRightSoftkeyFunction(mm_jmms_back_from_java_msg_properties, KEY_EVENT_UP);
  672.     SetKeyHandler(mm_jmms_back_from_java_msg_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  673. #ifdef __MMI_UNIFIED_MESSAGE__
  674. if(g_jmms_context->last_scr_id != SCR_ID_JMMS_INBOX_OPTIONS)
  675. {
  676. SetKeyHandler(mmi_jmms_pre_entry_inbox_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  677. SetLeftSoftkeyFunction(mmi_jmms_pre_entry_inbox_options_scren, KEY_EVENT_UP);
  678. }
  679. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  680. if (isInCall() == FALSE)
  681.     SetKeyHandler(mm_jmms_end_from_java_msg_properties, KEY_END, KEY_EVENT_DOWN);
  682.     return;
  683. }
  684. /*****************************************************************************
  685.  * FUNCTION
  686.  *  mm_jmms_back_from_java_msg_properties
  687.  * DESCRIPTION
  688.  *  
  689.  * PARAMETERS
  690.  *  void
  691.  * RETURNS
  692.  *  void
  693.  *****************************************************************************/
  694. void mm_jmms_back_from_java_msg_properties(void)
  695. {
  696.     /*----------------------------------------------------------------*/
  697.     /* Local Variables                                                */
  698.     /*----------------------------------------------------------------*/
  699.     /*----------------------------------------------------------------*/
  700.     /* Code Body                                                      */
  701.     /*----------------------------------------------------------------*/
  702. #ifdef __MMI_UNIFIED_MESSAGE__
  703. g_jmms_context->last_scr_id = 0;
  704. #endif
  705.     mmi_jmms_deinit_mms_context(g_jmms_context);
  706.     GoBackHistory();
  707. }
  708. /*****************************************************************************
  709.  * FUNCTION
  710.  *  mm_jmms_end_from_java_msg_properties
  711.  * DESCRIPTION
  712.  *  
  713.  * PARAMETERS
  714.  *  void
  715.  * RETURNS
  716.  *  void
  717.  *****************************************************************************/
  718. void mm_jmms_end_from_java_msg_properties(void)
  719. {
  720.     /*----------------------------------------------------------------*/
  721.     /* Local Variables                                                */
  722.     /*----------------------------------------------------------------*/
  723.     /*----------------------------------------------------------------*/
  724.     /* Code Body                                                      */
  725.     /*----------------------------------------------------------------*/
  726. #ifdef __MMI_UNIFIED_MESSAGE__
  727. g_jmms_context->last_scr_id = 0;
  728. #endif
  729.     mmi_jmms_deinit_mms_context(g_jmms_context);
  730.     DisplayIdleScreen();
  731. }
  732. /*****************************************************************************
  733.  * FUNCTION
  734.  *  mmi_jmms_show_retrieved_mms_properties
  735.  * DESCRIPTION
  736.  *  
  737.  * PARAMETERS
  738.  *  void
  739.  * RETURNS
  740.  *  void
  741.  *****************************************************************************/
  742. void mmi_jmms_show_retrieved_mms_properties(void)
  743. {
  744.     /*----------------------------------------------------------------*/
  745.     /* Local Variables                                                */
  746.     /*----------------------------------------------------------------*/
  747.     PU8 gui_buffer = NULL;  /* Buffer holding history data */
  748.     S8 temp[14];
  749.     U8 dttemp[40];
  750.     MYTIME time1, time;
  751.     FLOAT timezone;
  752.     /* PMT VIKAS START 20060325 */
  753.     S32 size = 0, size_kb = 0, size_bytes = 0;
  754.     /*----------------------------------------------------------------*/
  755.     /* Code Body                                                      */
  756.     /*----------------------------------------------------------------*/
  757.     /* PMT VIKAS END 20060325 */
  758.     timezone = mmi_dt_get_tz();
  759.     EntryNewScreen(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES, NULL, mmi_jmms_show_retrieved_mms_properties, NULL);
  760.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVED_MMS_PROPERTIES);
  761.     /* From */
  762.     pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_FROM));
  763.     memset(temp, 0x00, 14);
  764.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  765.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  766.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pFrom == NULL)
  767.     {
  768.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  769.     }
  770.     else
  771.     {
  772.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pFrom);
  773.     }
  774.     /* /TO */
  775.     memset(temp, 0x00, 14);
  776.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  777.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  778.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
  779.     memset(temp, 0x00, 14);
  780.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  781.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  782.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pTo == NULL)
  783.     {
  784.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  785.     }
  786.     else
  787.     {
  788.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pTo);
  789.     }
  790.     /* /CC */
  791.     memset(temp, 0x00, 14);
  792.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  793.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  794.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_CC));
  795.     memset(temp, 0x00, 14);
  796.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  797.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  798.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pCc == NULL)
  799.     {
  800.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  801.     }
  802.     else
  803.     {
  804.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pCc);
  805.     }
  806.     /* /Subject */
  807.     memset(temp, 0x00, 14);
  808.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  809.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  810.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
  811.     memset(temp, 0x00, 14);
  812.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  813.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  814.     if (((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pSubject == NULL)
  815.     {
  816.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  817.     }
  818.     else
  819.     {
  820.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->pSubject);
  821.     }
  822.     /* /Priority */
  823.     memset(temp, 0x00, 14);
  824.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  825.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  826.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_PRIORITY));
  827.     memset(temp, 0x00, 14);
  828.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  829.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  830. /* MAUI_00017989 Start */
  831. /* MAUI_00018625 Start */
  832.     switch (((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->eMsgPriority )
  833. /* MAUI_00018625 End */
  834. /* MAUI_00017989 End */
  835.     {
  836.         case E_MSG_PRIORITY_LOW:
  837.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_LOW));
  838.             break;
  839.         case E_MSG_PRIORITY_NORMAL:
  840.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_NORMAL));
  841.             break;
  842.         case E_MSG_PRIORITY_HIGH:
  843.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_HIGH));
  844.             break;
  845.         default:
  846.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  847.             break;
  848.     }
  849.     /* //message class */
  850.     memset(temp, 0x00, 14);
  851.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  852.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  853.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_MSG_CLASS));
  854.     memset(temp, 0x00, 14);
  855.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  856.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  857.     switch (((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->eMsgClass)
  858.     {
  859.         case E_MSG_PERSONAL_CLASS:
  860.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_PERSONEL_MSG_CLASS));
  861.             break;
  862.         case E_MSG_ADVERTISEMENT_CLASS:
  863.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_SETTINGS_ADVERTISMENT));
  864.             break;
  865.         case E_MSG_INFORMATION_CLASS:
  866.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_INFORMATIONAL_MSG_CLASS));
  867.             break;
  868.         case E_MSG_AUTO_CLASS:
  869.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_AUTO_MSG_CLASS));
  870.             break;
  871.         default:
  872.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  873.             break;
  874.     }
  875.     /* /Recieved Date */
  876.     memset(temp, 0x00, 14);
  877.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  878.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  879.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
  880.     memset(temp, 0x00, 14);
  881.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  882.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  883.     mmi_dt_utc_sec_2_mytime((U32) ((MESSAGE_RETRIEVAL*) g_jmms_context->retrieval_p)->uiDate, &time1, MMI_TRUE);
  884.     mmi_dt_utc_to_rtc(timezone, time1, time);
  885.     /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
  886.     /* Date */
  887.     memset(dttemp, 0x00, 40);
  888.     date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  889.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  890.     memset(temp, 0x00, 6);
  891.     AnsiiToUnicodeString((PS8) temp, (PS8) "n");
  892.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  893.     /* Time */
  894.     memset(dttemp, 0x00, 40);
  895.     time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  896.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  897.     /* END of Changes - RAJ KUMAR GUPTA */
  898.     //PMT VIKAS START 20060325
  899.     ///MMS Size            
  900.     memset(temp, 0x00, 14);
  901.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  902.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  903.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SIZE));
  904.     memset(temp, 0x00, 14);
  905.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  906.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  907.     mmi_jmms_save_size_of_mms(&size, MMS_SIZE_RETRIVE);
  908.     size_kb = size / 1024;
  909.     size_bytes = size % 1024;
  910.     if (size_kb >= 1)
  911.     {
  912.         size_kb++;
  913.         memset(temp, 0x00, 14);
  914.         gui_itoa((S32) size_kb, (UI_string_type) temp, 10);
  915.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  916.         memset(temp, 0x00, 4);
  917.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  918.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  919.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_KB));
  920.     }
  921.     else
  922.     {
  923.         memset(temp, 0x00, 14);
  924.         gui_itoa((S32) size_bytes, (UI_string_type) temp, 10);
  925.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  926.         memset(temp, 0x00, 4);
  927.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  928.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  929.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BYTES));
  930.     }
  931.     /* PMT VIKAS END 20060325 */
  932.     ShowCategory78Screen(
  933. /* MAUI_00018481 Start */
  934. STR_ID_JMMS_OPTIONS_PROPERTIES,
  935. /* MAUI_00018481 End */
  936.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  937.         NULL,
  938.         NULL,
  939.         STR_GLOBAL_BACK,
  940.         IMG_GLOBAL_BACK,
  941.         NULL,
  942.         (U8*) subMenuData,
  943.         pfnUnicodeStrlen((S8*) subMenuData),
  944.         gui_buffer);
  945.     SetRightSoftkeyFunction(mm_jmms_back_from_recive_msg_properties, KEY_EVENT_UP);
  946.     SetKeyHandler(mm_jmms_back_from_recive_msg_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  947. if (isInCall() == FALSE)
  948.     SetKeyHandler(mm_jmms_end_from_recive_msg_properties, KEY_END, KEY_EVENT_DOWN);
  949.     return;
  950. }
  951. /*****************************************************************************
  952.  * FUNCTION
  953.  *  mm_jmms_back_from_recive_msg_properties
  954.  * DESCRIPTION
  955.  *  
  956.  * PARAMETERS
  957.  *  void
  958.  * RETURNS
  959.  *  void
  960.  *****************************************************************************/
  961. void mm_jmms_back_from_recive_msg_properties(void)
  962. {
  963.     /*----------------------------------------------------------------*/
  964.     /* Local Variables                                                */
  965.     /*----------------------------------------------------------------*/
  966.     /*----------------------------------------------------------------*/
  967.     /* Code Body                                                      */
  968.     /*----------------------------------------------------------------*/
  969.     mmi_jmms_free_recieved_msg_header();
  970.     GoBackHistory();
  971. }
  972. /*****************************************************************************
  973.  * FUNCTION
  974.  *  mm_jmms_end_from_recive_msg_properties
  975.  * DESCRIPTION
  976.  *  
  977.  * PARAMETERS
  978.  *  void
  979.  * RETURNS
  980.  *  void
  981.  *****************************************************************************/
  982. void mm_jmms_end_from_recive_msg_properties(void)
  983. {
  984.     /*----------------------------------------------------------------*/
  985.     /* Local Variables                                                */
  986.     /*----------------------------------------------------------------*/
  987.     /*----------------------------------------------------------------*/
  988.     /* Code Body                                                      */
  989.     /*----------------------------------------------------------------*/
  990.     mmi_jmms_free_recieved_msg_header();
  991.     DisplayIdleScreen();
  992. }
  993. /*****************************************************************************
  994.  * FUNCTION
  995.  *  mmi_jmms_entry_view_delivery_report
  996.  * DESCRIPTION
  997.  *  
  998.  * PARAMETERS
  999.  *  void
  1000.  * RETURNS
  1001.  *  void
  1002.  *****************************************************************************/
  1003. void mmi_jmms_entry_view_delivery_report(void)
  1004. {
  1005.     /*----------------------------------------------------------------*/
  1006.     /* Local Variables                                                */
  1007.     /*----------------------------------------------------------------*/
  1008.     PU8 gui_buffer; /* Buffer holding history data */
  1009.     S8 temp[14];
  1010.     U8 dttemp[40];
  1011.     MYTIME time1, time;
  1012.     FLOAT timezone;
  1013. #ifdef __MMI_UNIFIED_MESSAGE__
  1014.     U16 left_softkey_property = NULL;
  1015.     U16 left_softkey_icon_property = NULL;
  1016. #endif
  1017.     /*----------------------------------------------------------------*/
  1018.     /* Code Body                                                      */
  1019.     /*----------------------------------------------------------------*/
  1020.     timezone = mmi_dt_get_tz();
  1021.     EntryNewScreen(SCR_ID_JMMS_NEW_MMS, NULL, mmi_jmms_entry_view_delivery_report, NULL);
  1022. #ifdef __MMI_UNIFIED_MESSAGE__
  1023.     DeleteScreenIfPresent(SCR_ID_JMMS_NEW_MMS);
  1024. #endif 
  1025.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NEW_MMS);
  1026.     /* STATUS */
  1027.     pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_STATUS));
  1028.     memset(temp, 0x00, 14);
  1029.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1030.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1031.     switch (((DELIVERY_REPORT*) g_jmms_context->delivery_p)->eDeliveryStatus)
  1032.     {
  1033.         case E_MSG_EXPIRED:
  1034.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_EXPIRED));
  1035.             break;
  1036.         case E_MSG_RETRIEVED:
  1037.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_RETRIEVED));
  1038.             break;
  1039.         case E_MSG_REJECTED:
  1040.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_REJECTED));
  1041.             break;
  1042.         case E_MSG_DEFERRED:
  1043.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_DEFFERED));
  1044.             break;
  1045.         case E_MSG_UNRECOGNIZED:
  1046.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_UNRECOGNISED));
  1047.             break;
  1048.         case E_MSG_INDETERMINATE:
  1049.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_INDETERMINATE));
  1050.             break;
  1051.         case E_MSG_FORWARDED:
  1052.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_FORWARDED));
  1053.             break;
  1054.         case E_MSG_UNREACHABLE:
  1055.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DELIVERY_STATUS_UNREACHABLE));
  1056.             break;
  1057.         default:
  1058.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  1059.             break;
  1060.     }
  1061.     /* TO */
  1062.     memset(temp, 0x00, 4);
  1063.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1064.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1065.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
  1066.     memset(temp, 0x00, 14);
  1067.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1068.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1069.     if (((DELIVERY_REPORT*) g_jmms_context->delivery_p)->pTo == NULL)
  1070.     {
  1071.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1072.     }
  1073.     else
  1074.     {
  1075.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) (((DELIVERY_REPORT*) g_jmms_context->delivery_p)->pTo));
  1076.     }
  1077.     /* /message id */
  1078.     memset(temp, 0x00, 4);
  1079.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1080.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1081.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_MESSAGE_ID));
  1082.     memset(temp, 0x00, 14);
  1083.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1084.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1085.     if (((DELIVERY_REPORT*) g_jmms_context->delivery_p)->pMessageID == NULL)
  1086.     {
  1087.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1088.     }
  1089.     else
  1090.     {
  1091.         S32 len = 0;
  1092.         S8 *msg_id = NULL;
  1093.         len = strlen((S8*) ((DELIVERY_REPORT*) g_jmms_context->delivery_p)->pMessageID);
  1094.         msg_id = (S8*) jdd_MemAlloc(sizeof(S8), len * ENCODING_LENGTH + ENCODING_LENGTH);
  1095.         if (msg_id == NULL)
  1096.         {
  1097.             return;
  1098.         }
  1099.         /* len=pfnUnicodeStrlen((S8*)subMenuData); */
  1100.         AnsiiToUnicodeString((PS8) (msg_id), (PS8) (((DELIVERY_REPORT*) g_jmms_context->delivery_p)->pMessageID));
  1101.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) (msg_id));
  1102.         if (msg_id != NULL)
  1103.         {
  1104.             jdd_MemFree(msg_id);
  1105.             msg_id = NULL;
  1106.         }
  1107.     }
  1108.     /* /Date */
  1109.     memset(temp, 0x00, 6);
  1110.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1111.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1112.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
  1113.     memset(temp, 0x00, 14);
  1114.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1115.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1116.     mmi_dt_utc_sec_2_mytime((U32) (((DELIVERY_REPORT*) g_jmms_context->delivery_p)->uiDate), &time1, MMI_TRUE);
  1117.     mmi_dt_utc_to_rtc(timezone, time1, time);
  1118.     /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
  1119.     /* Date */
  1120.     memset(dttemp, 0x00, 40);
  1121.     date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  1122.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  1123.     memset(temp, 0x00, 6);
  1124.     AnsiiToUnicodeString((PS8) temp, (PS8) "n");
  1125.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1126.     /* Time */
  1127.     memset(dttemp, 0x00, 40);
  1128.     time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  1129.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  1130.     /* END of Changes - RAJ KUMAR GUPTA */
  1131. #ifdef __MMI_UNIFIED_MESSAGE__
  1132. if(g_jmms_context->last_scr_id == SCR_ID_JMMS_INBOX_OPTIONS)
  1133. {
  1134.         left_softkey_property = NULL;
  1135.         left_softkey_icon_property = NULL;
  1136. }
  1137. else
  1138. {
  1139.         left_softkey_property = STR_GLOBAL_OPTIONS;
  1140.         left_softkey_icon_property = IMG_GLOBAL_OPTIONS;
  1141. }
  1142. #endif
  1143.     ShowCategory78Screen(STR_ID_JMMS_DELIVERY_REPORT, GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1144. #ifdef __MMI_UNIFIED_MESSAGE__
  1145.                          left_softkey_property, left_softkey_icon_property,
  1146. #else 
  1147.                          NULL, NULL,
  1148. #endif 
  1149.                          STR_GLOBAL_BACK,
  1150.                          IMG_GLOBAL_BACK, NULL, (U8*) subMenuData, pfnUnicodeStrlen((S8*) subMenuData), gui_buffer);
  1151.     SetRightSoftkeyFunction(mm_jmms_back_from_delivery_report_properties, KEY_EVENT_UP);
  1152.     SetKeyHandler(mm_jmms_back_from_delivery_report_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1153. #ifdef __MMI_UNIFIED_MESSAGE__
  1154. if(g_jmms_context->last_scr_id != SCR_ID_JMMS_INBOX_OPTIONS)
  1155. {
  1156. SetKeyHandler(mmi_jmms_pre_entry_inbox_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1157. SetLeftSoftkeyFunction(mmi_jmms_pre_entry_inbox_options_scren, KEY_EVENT_UP);
  1158. }
  1159. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  1160. if (isInCall() == FALSE)
  1161.     SetKeyHandler(mm_jmms_end_from_delivery_report_properties, KEY_END, KEY_EVENT_DOWN);
  1162.     return;
  1163. }
  1164. /*****************************************************************************
  1165.  * FUNCTION
  1166.  *  mm_jmms_back_from_delivery_report_properties
  1167.  * DESCRIPTION
  1168.  *  
  1169.  * PARAMETERS
  1170.  *  void
  1171.  * RETURNS
  1172.  *  void
  1173.  *****************************************************************************/
  1174. void mm_jmms_back_from_delivery_report_properties(void)
  1175. {
  1176.     /*----------------------------------------------------------------*/
  1177.     /* Local Variables                                                */
  1178.     /*----------------------------------------------------------------*/
  1179.     /*----------------------------------------------------------------*/
  1180.     /* Code Body                                                      */
  1181.     /*----------------------------------------------------------------*/
  1182. #ifdef __MMI_UNIFIED_MESSAGE__
  1183. g_jmms_context->last_scr_id = 0;
  1184. #endif
  1185.     mmi_jmms_free_delivery_report_header();
  1186.     GoBackHistory();
  1187. }
  1188. /*****************************************************************************
  1189.  * FUNCTION
  1190.  *  mm_jmms_end_from_delivery_report_properties
  1191.  * DESCRIPTION
  1192.  *  
  1193.  * PARAMETERS
  1194.  *  void
  1195.  * RETURNS
  1196.  *  void
  1197.  *****************************************************************************/
  1198. void mm_jmms_end_from_delivery_report_properties(void)
  1199. {
  1200.     /*----------------------------------------------------------------*/
  1201.     /* Local Variables                                                */
  1202.     /*----------------------------------------------------------------*/
  1203.     /*----------------------------------------------------------------*/
  1204.     /* Code Body                                                      */
  1205.     /*----------------------------------------------------------------*/
  1206. #ifdef __MMI_UNIFIED_MESSAGE__
  1207. g_jmms_context->last_scr_id = 0;
  1208. #endif
  1209.     mmi_jmms_free_delivery_report_header();
  1210.     DisplayIdleScreen();
  1211. }
  1212. /*****************************************************************************
  1213.  * FUNCTION
  1214.  *  mmi_jmms_entry_view_read_report
  1215.  * DESCRIPTION
  1216.  *  
  1217.  * PARAMETERS
  1218.  *  void
  1219.  * RETURNS
  1220.  *  void
  1221.  *****************************************************************************/
  1222. void mmi_jmms_entry_view_read_report(void)
  1223. {
  1224.     /*----------------------------------------------------------------*/
  1225.     /* Local Variables                                                */
  1226.     /*----------------------------------------------------------------*/
  1227.     PU8 gui_buffer; /* Buffer holding history data */
  1228.     S8 temp[14];
  1229.     U8 dttemp[40];
  1230.     MYTIME time1, time;
  1231.     FLOAT timezone;
  1232. #ifdef __MMI_UNIFIED_MESSAGE__
  1233.     U16 left_softkey_property = NULL;
  1234.     U16 left_softkey_icon_property = NULL;
  1235. #endif
  1236.     /*----------------------------------------------------------------*/
  1237.     /* Code Body                                                      */
  1238.     /*----------------------------------------------------------------*/
  1239.     timezone = mmi_dt_get_tz();
  1240.     EntryNewScreen(SCR_ID_JMMS_NEW_MMS, NULL, mmi_jmms_entry_view_read_report, NULL);
  1241. #ifdef __MMI_UNIFIED_MESSAGE__
  1242.     DeleteScreenIfPresent(SCR_ID_JMMS_NEW_MMS);
  1243. #endif 
  1244.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NEW_MMS);
  1245.     /* STATUS */
  1246.     pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_STATUS));
  1247.     memset(temp, 0x00, 14);
  1248.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1249.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1250.     switch (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->eReadStatus)
  1251.     {
  1252.         case E_STATUS_READ:
  1253.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_READ_REPORT_READ));
  1254.             break;
  1255.         case E_STATUS_DELETED:
  1256.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_READ_REPORT_DELETED));
  1257.             break;
  1258.         default:
  1259.             pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_UNKNOWN));
  1260.             break;
  1261.     }
  1262.     /* FROM */
  1263.     memset(temp, 0x00, 4);
  1264.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1265.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1266.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_FROM));
  1267.     memset(temp, 0x00, 14);
  1268.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1269.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1270.     if (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pFrom == NULL)
  1271.     {
  1272.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1273.     }
  1274.     else
  1275.     {
  1276.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pFrom));
  1277.     }
  1278.     /* TO */
  1279.     memset(temp, 0x00, 4);
  1280.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1281.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1282.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_TO));
  1283.     memset(temp, 0x00, 14);
  1284.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1285.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1286.     if (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pTo == NULL)
  1287.     {
  1288.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1289.     }
  1290.     else
  1291.     {
  1292.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pTo));
  1293.     }
  1294.     /* message id */
  1295.     memset(temp, 0x00, 4);
  1296.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1297.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1298.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_MESSAGE_ID));
  1299.     memset(temp, 0x00, 14);
  1300.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1301.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1302.     if (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pMessageID == NULL)
  1303.     {
  1304.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1305.     }
  1306.     else
  1307.     {
  1308.         S32 len = 0;
  1309.         S8 *msg_id = NULL;
  1310.         len = strlen((S8*) ((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pMessageID);
  1311.         msg_id = (S8*) jdd_MemAlloc(sizeof(S8), len * ENCODING_LENGTH + ENCODING_LENGTH);
  1312.         if (msg_id == NULL)
  1313.         {
  1314.             return;
  1315.         }
  1316.         /* len=pfnUnicodeStrlen((S8*)subMenuData); */
  1317.         AnsiiToUnicodeString(
  1318.             (PS8) (msg_id),
  1319.             (PS8) (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->pMessageID));
  1320.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) (msg_id));
  1321.         if (msg_id != NULL)
  1322.         {
  1323.             jdd_MemFree(msg_id);
  1324.             msg_id = NULL;
  1325.         }
  1326.     }
  1327.     /* /Date */
  1328.     memset(temp, 0x00, 6);
  1329.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1330.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1331.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_DATE));
  1332.     memset(temp, 0x00, 14);
  1333.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1334.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1335.     mmi_dt_utc_sec_2_mytime(
  1336.         (U32) (((READ_REPORT_RESPONSE*) g_jmms_context->read_report_p)->uiReceivedTime),
  1337.         &time1,
  1338.         MMI_TRUE);
  1339.     mmi_dt_utc_to_rtc(timezone, time1, time);
  1340.     /* PMT RAJ KUMAR GUPTA on Sep 05, 2006 */
  1341.     /* Date */
  1342.     memset(dttemp, 0x00, 40);
  1343.     date_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  1344.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  1345.     memset(temp, 0x00, 6);
  1346.     AnsiiToUnicodeString((PS8) temp, (PS8) "n");
  1347.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1348.     /* Time */
  1349.     memset(dttemp, 0x00, 40);
  1350.     time_string(&time, (UI_string_type)dttemp, DT_IDLE_SCREEN);
  1351.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) dttemp);
  1352.     /* END of Changes - RAJ KUMAR GUPTA */
  1353. #ifdef __MMI_UNIFIED_MESSAGE__
  1354. if(g_jmms_context->last_scr_id == SCR_ID_JMMS_INBOX_OPTIONS)
  1355. {
  1356.         left_softkey_property = NULL;
  1357.         left_softkey_icon_property = NULL;
  1358. }
  1359. else
  1360. {
  1361.         left_softkey_property = STR_GLOBAL_OPTIONS;
  1362.         left_softkey_icon_property = IMG_GLOBAL_OPTIONS;
  1363. }
  1364. #endif
  1365.     ShowCategory78Screen(STR_ID_SETTINGS_READ_REPORT, GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1366. #ifdef __MMI_UNIFIED_MESSAGE__
  1367.                          left_softkey_property, left_softkey_icon_property,
  1368. #else 
  1369.                          NULL, NULL,
  1370. #endif 
  1371.                          STR_GLOBAL_BACK,
  1372.                          IMG_GLOBAL_BACK, NULL, (U8*) subMenuData, pfnUnicodeStrlen((S8*) subMenuData), gui_buffer);
  1373.     SetRightSoftkeyFunction(mm_jmms_back_from_read_report_properties, KEY_EVENT_UP);
  1374.     SetKeyHandler(mm_jmms_back_from_read_report_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1375. #ifdef __MMI_UNIFIED_MESSAGE__
  1376. if(g_jmms_context->last_scr_id != SCR_ID_JMMS_INBOX_OPTIONS)
  1377. {
  1378. SetKeyHandler(mmi_jmms_pre_entry_inbox_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1379. SetLeftSoftkeyFunction(mmi_jmms_pre_entry_inbox_options_scren, KEY_EVENT_UP);
  1380. }
  1381. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  1382. if (isInCall() == FALSE)
  1383.     SetKeyHandler(mm_jmms_end_from_read_report_properties, KEY_END, KEY_EVENT_DOWN);
  1384.     return;
  1385. }
  1386. /*****************************************************************************
  1387.  * FUNCTION
  1388.  *  mm_jmms_back_from_read_report_properties
  1389.  * DESCRIPTION
  1390.  *  
  1391.  * PARAMETERS
  1392.  *  void
  1393.  * RETURNS
  1394.  *  void
  1395.  *****************************************************************************/
  1396. void mm_jmms_back_from_read_report_properties(void)
  1397. {
  1398.     /*----------------------------------------------------------------*/
  1399.     /* Local Variables                                                */
  1400.     /*----------------------------------------------------------------*/
  1401.     /*----------------------------------------------------------------*/
  1402.     /* Code Body                                                      */
  1403.     /*----------------------------------------------------------------*/
  1404. #ifdef __MMI_UNIFIED_MESSAGE__
  1405. g_jmms_context->last_scr_id = 0;
  1406. #endif
  1407.     mmi_jmms_free_report_report_header();
  1408.     GoBackHistory();
  1409. }
  1410. /*****************************************************************************
  1411.  * FUNCTION
  1412.  *  mm_jmms_end_from_read_report_properties
  1413.  * DESCRIPTION
  1414.  *  
  1415.  * PARAMETERS
  1416.  *  void
  1417.  * RETURNS
  1418.  *  void
  1419.  *****************************************************************************/
  1420. void mm_jmms_end_from_read_report_properties(void)
  1421. {
  1422.     /*----------------------------------------------------------------*/
  1423.     /* Local Variables                                                */
  1424.     /*----------------------------------------------------------------*/
  1425.     /*----------------------------------------------------------------*/
  1426.     /* Code Body                                                      */
  1427.     /*----------------------------------------------------------------*/
  1428. #ifdef __MMI_UNIFIED_MESSAGE__
  1429. g_jmms_context->last_scr_id = 0;
  1430. #endif
  1431.     mmi_jmms_free_report_report_header();
  1432.     DisplayIdleScreen();
  1433. }
  1434. /*****************************************************************************
  1435.  * FUNCTION
  1436.  *  mmi_jmms_entry_wap_not_ready
  1437.  * DESCRIPTION
  1438.  *  
  1439.  * PARAMETERS
  1440.  *  void
  1441.  * RETURNS
  1442.  *  void
  1443.  *****************************************************************************/
  1444. void mmi_jmms_entry_wap_not_ready(void)
  1445. {
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Local Variables                                                */
  1448.     /*----------------------------------------------------------------*/
  1449.     /*----------------------------------------------------------------*/
  1450.     /* Code Body                                                      */
  1451.     /*----------------------------------------------------------------*/
  1452.     EntryNewScreen(SCR_ID_JMMS_WAP_NOT_READY, mmi_jmms_exit_wap_not_ready, NULL, NULL);
  1453.     StartTimer(JMMS_WAP_NOT_READY_TIMER, 2000, mmi_jmms_wait_and_go_back);
  1454.     ShowCategory66Screen(
  1455.         STR_MMS_MENUENTRY,
  1456.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1457.         0,
  1458.         0,
  1459.         STR_GLOBAL_BACK,
  1460.         IMG_GLOBAL_BACK,
  1461.         (U8*) GetString(STR_ID_JMMS_PLEASE_WAIT),
  1462.         IMG_ID_JMMS_PLEASE_WAIT,
  1463.         NULL);
  1464.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1465. }
  1466. /*****************************************************************************
  1467.  * FUNCTION
  1468.  *  mmi_jmms_exit_wap_not_ready
  1469.  * DESCRIPTION
  1470.  *  
  1471.  * PARAMETERS
  1472.  *  void
  1473.  * RETURNS
  1474.  *  void
  1475.  *****************************************************************************/
  1476. void mmi_jmms_exit_wap_not_ready(void)
  1477. {
  1478.     /*----------------------------------------------------------------*/
  1479.     /* Local Variables                                                */
  1480.     /*----------------------------------------------------------------*/
  1481.     /*----------------------------------------------------------------*/
  1482.     /* Code Body                                                      */
  1483.     /*----------------------------------------------------------------*/
  1484.     StopTimer(JMMS_WAP_NOT_READY_TIMER);
  1485. }
  1486. /*****************************************************************************
  1487.  * FUNCTION
  1488.  *  mmi_jmms_wait_and_go_back
  1489.  * DESCRIPTION
  1490.  *  
  1491.  * PARAMETERS
  1492.  *  void
  1493.  * RETURNS
  1494.  *  void
  1495.  *****************************************************************************/
  1496. void mmi_jmms_wait_and_go_back(void)
  1497. {
  1498.     /*----------------------------------------------------------------*/
  1499.     /* Local Variables                                                */
  1500.     /*----------------------------------------------------------------*/
  1501.     /*----------------------------------------------------------------*/
  1502.     /* Code Body                                                      */
  1503.     /*----------------------------------------------------------------*/
  1504.     StopTimer(JMMS_WAP_NOT_READY_TIMER);
  1505.     GoBackHistory();
  1506. }
  1507. /*****************************************************************************
  1508.  * FUNCTION
  1509.  *  mmi_jmms_error_handler
  1510.  * DESCRIPTION
  1511.  *  
  1512.  * PARAMETERS
  1513.  *  error_code      [IN]        
  1514.  * RETURNS
  1515.  *  void
  1516.  *****************************************************************************/
  1517. void mmi_jmms_error_handler(JC_RETCODE error_code)
  1518. {
  1519.     /*----------------------------------------------------------------*/
  1520.     /* Local Variables                                                */
  1521.     /*----------------------------------------------------------------*/
  1522.     /*----------------------------------------------------------------*/
  1523.     /* Code Body                                                      */
  1524.     /*----------------------------------------------------------------*/
  1525. #ifdef __MMI_UNIFIED_MESSAGE__
  1526. g_jmms_context->edit_error_code=error_code;
  1527. #endif
  1528.     switch (error_code)
  1529.     {
  1530.             /* Compose Module Related Errors */
  1531.         case JC_ERR_MSG_INVALID_HANDLE:
  1532.             DisplayPopup(
  1533.                 (PU8) GetString(STR_ID_JMMS_INVALID_MESSAGE_HANDLE),
  1534.                 IMG_GLOBAL_ERROR,
  1535.                 1,
  1536.                 JMMS_POPUP_TIME,
  1537.                 ERROR_TONE);
  1538.             break;
  1539.         case JC_ERR_MSG_INVALID_PAGE_INDEX:
  1540.             DisplayPopup(
  1541.                 (PU8) GetString(STR_ID_JMMS_INVALID_PAGE_INDEX),
  1542.                 IMG_GLOBAL_ERROR,
  1543.                 1,
  1544.                 JMMS_POPUP_TIME,
  1545.                 ERROR_TONE);
  1546.             break;
  1547.             
  1548.         case JC_ERR_MSG_MORE_THAN_MAX_PAGE:
  1549.             DisplayPopup(
  1550.                 (PU8) GetString(STR_ID_JMMS_TOO_MANY_SLIDES),
  1551.                 IMG_GLOBAL_ERROR,
  1552.                 1,
  1553.                 JMMS_POPUP_TIME,
  1554.                 ERROR_TONE);
  1555.             break;
  1556.         case JC_ERR_MSG_INVALID_MEDIA_INDEX:
  1557.             DisplayPopup(
  1558.                 (PU8) GetString(STR_ID_JMMS_INVALID_MEDIA_ID),
  1559.                 IMG_GLOBAL_ERROR,
  1560.                 1,
  1561.                 JMMS_POPUP_TIME,
  1562.                 ERROR_TONE);
  1563.             break;
  1564.         case JC_ERR_MSG_MEDIA_RESTRICTED:
  1565.             DisplayPopup(
  1566.                 (PU8) GetString(STR_ID_JMMS_RESTRICTED_MODE_MEDIA),
  1567.                 IMG_GLOBAL_ERROR,
  1568.                 1,
  1569.                 JMMS_POPUP_TIME,
  1570.                 ERROR_TONE);
  1571.             break;
  1572.         case JC_ERR_MSG_MAX_REACHED:
  1573.             DisplayPopup(
  1574.                 (PU8) GetString(STR_ID_JMMS_MAX_MSG_REACHED),
  1575.                 IMG_GLOBAL_ERROR,
  1576.                 1,
  1577.                 JMMS_POPUP_TIME,
  1578.                 ERROR_TONE);
  1579.             break;
  1580.         case JC_ERR_UNSUPPORTED:
  1581.             DisplayPopup(
  1582.                 (PU8) GetString(STR_GLOBAL_UNSUPPORTED_FORMAT),
  1583.                 IMG_GLOBAL_ERROR,
  1584.                 1,
  1585.                 JMMS_POPUP_TIME,
  1586.                 ERROR_TONE);
  1587.             break;
  1588.         case JC_ERR_MSG_MMS_UNSUPPORTED_TYPE:
  1589.             DisplayPopup(
  1590.                 (PU8) GetString(STR_ID_JMMS_INVALID_MEDIA_TYPE),
  1591.                 IMG_GLOBAL_ERROR,
  1592.                 1,
  1593.                 JMMS_POPUP_TIME,
  1594.                 ERROR_TONE);
  1595.             break;
  1596.         case JC_ERR_MSG_INVALID_MEDIA_INFO:
  1597.             DisplayPopup(
  1598.                 (PU8) GetString(STR_ID_JMMS_INVALID_MEDIA_INFO),
  1599.                 IMG_GLOBAL_ERROR,
  1600.                 1,
  1601.                 JMMS_POPUP_TIME,
  1602.                 ERROR_TONE);
  1603.             break;
  1604.         case JC_ERR_MSG_MMS_CONTENT_RESTRICTED:
  1605.             DisplayPopup(
  1606.                 (PU8) GetString(STR_ID_JMMS_MMS_ERR_RESTRICTED_CONTENT_CLASS),
  1607.                 IMG_GLOBAL_ERROR,
  1608.                 1,
  1609.                 JMMS_POPUP_TIME,
  1610.                 ERROR_TONE);
  1611.             break;
  1612.             /* SMIL-VIEW Module Related Errors */
  1613.         case JC_ERR_MSG_PRESENTATION_NOT_SET:
  1614.         case JC_ERR_PRESENTATION_NOT_SET:
  1615.             DisplayPopup(
  1616.                 (PU8) GetString(STR_ID_JMMS_PRESENTATION_NOT_SET),
  1617.                 IMG_GLOBAL_ERROR,
  1618.                 1,
  1619.                 JMMS_POPUP_TIME,
  1620.                 ERROR_TONE);
  1621.             break;
  1622.         case JC_ERR_SMIL_REGION_NOT_SET:
  1623.             DisplayPopup(
  1624.                 (PU8) GetString(STR_ID_JMMS_SMIL_REGION_NOT_SET),
  1625.                 IMG_GLOBAL_ERROR,
  1626.                 1,
  1627.                 JMMS_POPUP_TIME,
  1628.                 ERROR_TONE);
  1629.             break;
  1630.         case JC_ERR_SMIL_INVALID_ROOTLAYOUT:
  1631.             DisplayPopup(
  1632.                 (PU8) GetString(STR_ID_JMMS_SMIL_INVALID_ROOTLAYOUT),
  1633.                 IMG_GLOBAL_ERROR,
  1634.                 1,
  1635.                 JMMS_POPUP_TIME,
  1636.                 ERROR_TONE);
  1637.             break;
  1638.         case JC_ERR_VIEW_INVALID_RENDERING_RECT:
  1639.             DisplayPopup(
  1640.                 (PU8) GetString(STR_ID_JMMS_INVALID_RENDERING_RECT),
  1641.                 IMG_GLOBAL_ERROR,
  1642.                 1,
  1643.                 JMMS_POPUP_TIME,
  1644.                 ERROR_TONE);
  1645.             break;
  1646.         case JC_ERR_VIEW_CORRUPTED_CONTENT:
  1647.             DisplayPopup(
  1648.                 (PU8) GetString(STR_ID_JMMS_CORRUPTED_CONTENT),
  1649.                 IMG_GLOBAL_ERROR,
  1650.                 1,
  1651.                 JMMS_POPUP_TIME,
  1652.                 ERROR_TONE);
  1653.             break;
  1654.             /* Store Module Related Errors */
  1655.         case JC_ERR_STORE_INVALID_HANDLE:
  1656.             DisplayPopup(
  1657.                 (PU8) GetString(STR_ID_JMMS_STORE_INVALID_HANDLE),
  1658.                 IMG_GLOBAL_ERROR,
  1659.                 1,
  1660.                 JMMS_POPUP_TIME,
  1661.                 ERROR_TONE);
  1662.             break;
  1663.         case JC_ERR_STORE_INVALID_FOLDER_NAME:
  1664.             DisplayPopup(
  1665.                 (PU8) GetString(STR_ID_JMMS_INVALID_FOLDER_NAME),
  1666.                 IMG_GLOBAL_ERROR,
  1667.                 1,
  1668.                 JMMS_POPUP_TIME,
  1669.                 ERROR_TONE);
  1670.             break;
  1671.         case JC_ERR_STORE_FOLDER_ALREADY_EXIST:
  1672.             DisplayPopup(
  1673.                 (PU8) GetString(STR_ID_JMMS_FOLDER_ALREADY_EXIST),
  1674.                 IMG_GLOBAL_WARNING,
  1675.                 1,
  1676.                 JMMS_POPUP_TIME,
  1677.                 WARNING_TONE);
  1678.             break;
  1679.         case JC_ERR_STORE_ACTIVE_FOLDER_NOT_SET:
  1680.             DisplayPopup(
  1681.                 (PU8) GetString(STR_ID_JMMS_ACTIVE_FOLDER_NOT_SET),
  1682.                 IMG_GLOBAL_ERROR,
  1683.                 1,
  1684.                 JMMS_POPUP_TIME,
  1685.                 ERROR_TONE);
  1686.             break;
  1687.         case JC_ERR_STORE_FOLDER_NOT_FOUND:
  1688.             DisplayPopup(
  1689.                 (PU8) GetString(STR_ID_JMMS_FOLDER_NOT_FOUND),
  1690.                 IMG_GLOBAL_ERROR,
  1691.                 1,
  1692.                 JMMS_POPUP_TIME,
  1693.                 ERROR_TONE);
  1694.             break;
  1695.         case JC_ERR_STORE_INVALID_MSG_INDEX:
  1696.             DisplayPopup(
  1697.                 (PU8) GetString(STR_ID_JMMS_INVALID_MSG_INDEX),
  1698.                 IMG_GLOBAL_ERROR,
  1699.                 1,
  1700.                 JMMS_POPUP_TIME,
  1701.                 ERROR_TONE);
  1702.             break;
  1703.         case JC_ERR_STORE_FILE_CORRUPTED:
  1704.         case JC_ERR_FILE_READ:
  1705.         case JC_ERR_NOT_SUPPORTED:
  1706.             DisplayPopup((PU8) GetString(STR_ID_JMMS_FILE_CORRUPTED), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  1707.             break;
  1708.         case JC_ERR_MEMORY_ALLOCATION:
  1709.             DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  1710.             break;
  1711.         case JC_ERR_NULL_POINTER:
  1712.             DisplayPopup(
  1713.                 (PU8) GetString(STR_ID_JMMS_INVALID_POINTER),
  1714.                 IMG_GLOBAL_ERROR,
  1715.                 1,
  1716.                 JMMS_POPUP_TIME,
  1717.                 ERROR_TONE);
  1718.             break;
  1719.         case JC_ERR_MSG_DRM_FORWARD_RESTRICTED:
  1720.             DisplayPopup(
  1721.                 (PU8) GetString(STR_ID_JMMS_FORWARD_LOCK_DRM),
  1722.                 IMG_GLOBAL_WARNING,
  1723.                 1,
  1724.                 JMMS_POPUP_TIME,
  1725.                 WARNING_TONE);
  1726.             break;
  1727.         default:
  1728.             /* DisplayPopup((PU8)GetString(STR_GLOBAL_ERROR),IMG_GLOBAL_ERROR, 1,JMMS_POPUP_TIME,ERROR_TONE); */
  1729.         {
  1730.             U8 error_str[20];
  1731.             S8 temp[10] = {0, };
  1732.             memset(error_str, 0x00, 20);
  1733.             sprintf((S8*) temp, "%d", error_code);
  1734.             AnsiiToUnicodeString((PS8) (error_str), (PS8) temp);
  1735.             DisplayPopup((PU8) (error_str), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  1736.             break;
  1737.         }
  1738.     }
  1739. }
  1740. /*****************************************************************************
  1741.  * FUNCTION
  1742.  *  mmi_jmms_parse_continue_start_timer
  1743.  * DESCRIPTION
  1744.  *  
  1745.  * PARAMETERS
  1746.  *  hMsg        [IN]        
  1747.  *  err_cb      [IN]        
  1748.  * RETURNS
  1749.  *  void
  1750.  *****************************************************************************/
  1751. void mmi_jmms_parse_continue_stop_timer(void)
  1752. {
  1753. StopTimer(JMMS_ASYNC_PARSE_TIMER);
  1754. g_jmms_context->async_parse_context.callback=NULL;
  1755. }
  1756. /*****************************************************************************
  1757.  * FUNCTION
  1758.  *  mmi_jmms_parse_continue_start_timer
  1759.  * DESCRIPTION
  1760.  *  
  1761.  * PARAMETERS
  1762.  *  hMsg        [IN]        
  1763.  *  err_cb      [IN]        
  1764.  * RETURNS
  1765.  *  void
  1766.  *****************************************************************************/
  1767. void mmi_jmms_parse_continue_start_timer(MSG_HANDLE hMsg, error_callback err_cb, abort_callback abort_cb)
  1768. {
  1769.     /*----------------------------------------------------------------*/
  1770.     /* Local Variables                                                */
  1771.     /*----------------------------------------------------------------*/
  1772.     /*----------------------------------------------------------------*/
  1773.     /* Code Body                                                      */
  1774.     /*----------------------------------------------------------------*/
  1775.     g_jmms_context->async_parse_context.is_re_entrant=1;
  1776. if(g_jmms_context->async_parse_context.callback !=NULL && g_jmms_context->async_parse_context.callback!=err_cb)
  1777. {
  1778. g_jmms_context->async_parse_context.callback=NULL;
  1779. if(GetActiveScreenId() == SCR_ID_JMMS_PARSING_PROGRESS)
  1780. {
  1781. mmi_jmms_entry_parse_result_fail();   
  1782. DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
  1783. }
  1784. else if(GetActiveScreenId() == SCR_ID_JMMS_PARSING_SUCCESS_SCREEN)
  1785. {
  1786. mmi_jmms_entry_parse_result_fail();   
  1787. DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_SUCCESS_SCREEN);
  1788. }
  1789. else
  1790. {
  1791. DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_SUCCESS_SCREEN);
  1792. DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_FAIL_SCREEN);
  1793. DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
  1794. }
  1795. if(g_jmms_context->async_parse_context.abort_cb)
  1796. g_jmms_context->async_parse_context.abort_cb();
  1797. }
  1798.     g_jmms_context->async_parse_context.msgHandle = hMsg;
  1799.     g_jmms_context->async_parse_context.callback = err_cb;
  1800. g_jmms_context->async_parse_context.abort_cb = abort_cb;
  1801.     StartTimer(JMMS_ASYNC_PARSE_TIMER, JMMS_ASYNC_EVENT_TIME, mmi_jmms_parse_continue_callback);
  1802. }
  1803. /*****************************************************************************
  1804.  * FUNCTION
  1805.  *  mmi_jmms_parse_call_error_callback
  1806.  * DESCRIPTION
  1807.  *  
  1808.  * PARAMETERS
  1809.  *  void
  1810.  * RETURNS
  1811.  *  void
  1812.  *****************************************************************************/
  1813. void mmi_jmms_parse_call_error_callback(JC_RETCODE eRet)
  1814. {
  1815.     if (g_jmms_context->async_parse_context.callback != NULL)
  1816. {
  1817. g_jmms_context->async_parse_context.is_re_entrant=0;
  1818. g_jmms_context->async_parse_context.callback(eRet);
  1819. if(!g_jmms_context->async_parse_context.is_re_entrant)
  1820. g_jmms_context->async_parse_context.callback=NULL;
  1821. }
  1822. }
  1823. /*****************************************************************************
  1824.  * FUNCTION
  1825.  *  mmi_jmms_parse_continue_callback
  1826.  * DESCRIPTION
  1827.  *  
  1828.  * PARAMETERS
  1829.  *  void
  1830.  * RETURNS
  1831.  *  void
  1832.  *****************************************************************************/
  1833. void mmi_jmms_parse_continue_callback(void)
  1834. {
  1835.     /*----------------------------------------------------------------*/
  1836.     /* Local Variables                                                */
  1837.     /*----------------------------------------------------------------*/
  1838.     JC_RETCODE eRet = JC_OK;
  1839.     /*----------------------------------------------------------------*/
  1840.     /* Code Body                                                      */
  1841.     /*----------------------------------------------------------------*/
  1842.     StopTimer(JMMS_ASYNC_PARSE_TIMER);
  1843.     eRet = mmi_jmms_jdi_msg_parse_continue(g_jmms_context->async_parse_context.msgHandle);
  1844.     if (eRet == JC_ERR_MMS_PARSE_PENDING)
  1845.     {
  1846.         StartTimer(JMMS_ASYNC_PARSE_TIMER, JMMS_ASYNC_EVENT_TIME, mmi_jmms_parse_continue_callback);
  1847.     }
  1848.     else
  1849.     {
  1850.         if (GetActiveScreenId() != SCR_ID_JMMS_PARSING_PROGRESS &&
  1851.             IsScreenPresent(SCR_ID_JMMS_PARSING_PROGRESS) == MMI_TRUE)
  1852.         {
  1853.         historyNode *saved_history;
  1854. if (eRet != JC_OK)
  1855.             {
  1856.                 HistoryReplace(
  1857.                     SCR_ID_JMMS_PARSING_PROGRESS,
  1858.                     SCR_ID_JMMS_PARSING_FAIL_SCREEN,
  1859.                     mmi_jmms_entry_parse_result_fail);
  1860. GetHistoryPointer(SCR_ID_JMMS_PARSING_FAIL_SCREEN,&saved_history);
  1861. if(saved_history->isSmallScreen==1)
  1862. {
  1863. saved_history->isSmallScreen=0;
  1864. }
  1865.             }
  1866.             else
  1867.             {
  1868.                 HistoryReplace(
  1869.                     SCR_ID_JMMS_PARSING_PROGRESS,
  1870.                     SCR_ID_JMMS_PARSING_SUCCESS_SCREEN,
  1871.                     mmi_jmms_entry_parse_result_pass);
  1872. GetHistoryPointer(SCR_ID_JMMS_PARSING_SUCCESS_SCREEN,&saved_history);
  1873. if(saved_history->isSmallScreen==1)
  1874. {
  1875. saved_history->isSmallScreen=0;
  1876. }
  1877.             }
  1878.             return;
  1879.         }
  1880. mmi_jmms_parse_call_error_callback(eRet);
  1881.     }
  1882. }
  1883. /*****************************************************************************
  1884.  * FUNCTION
  1885.  *  mmi_jmms_entry_parse_result_fail
  1886.  * DESCRIPTION
  1887.  *  
  1888.  * PARAMETERS
  1889.  *  void
  1890.  * RETURNS
  1891.  *  void
  1892.  *****************************************************************************/
  1893. void mmi_jmms_entry_parse_result_fail(void)
  1894. {
  1895.     /*----------------------------------------------------------------*/
  1896.     /* Local Variables                                                */
  1897.     /*----------------------------------------------------------------*/
  1898.     /*----------------------------------------------------------------*/
  1899.     /* Code Body                                                      */
  1900.     /*----------------------------------------------------------------*/
  1901.     EntryNewScreen(SCR_ID_JMMS_PARSING_FAIL_SCREEN, NULL, mmi_jmms_entry_parse_result_fail, NULL);
  1902.     ShowCategory2Screen(
  1903.         STR_MMS_MENUENTRY,
  1904.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1905.         0,
  1906.         0,
  1907.         STR_GLOBAL_BACK,
  1908.         IMG_GLOBAL_BACK,
  1909.         STR_ID_MMS_PARSING_FAIL,
  1910.         NULL);
  1911.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1912.     mmi_jmms_parse_call_error_callback(JC_ERR_GENERAL_FAILURE);
  1913.     DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_FAIL_SCREEN);
  1914. }
  1915. /*****************************************************************************
  1916.  * FUNCTION
  1917.  *  mmi_jmms_entry_parse_result_pass
  1918.  * DESCRIPTION
  1919.  *  
  1920.  * PARAMETERS
  1921.  *  void
  1922.  * RETURNS
  1923.  *  void
  1924.  *****************************************************************************/
  1925. void mmi_jmms_entry_parse_result_pass(void)
  1926. {
  1927.     /*----------------------------------------------------------------*/
  1928.     /* Local Variables                                                */
  1929.     /*----------------------------------------------------------------*/
  1930.     /*----------------------------------------------------------------*/
  1931.     /* Code Body                                                      */
  1932.     /*----------------------------------------------------------------*/
  1933.     if(g_jmms_context->msg_handle==NULL)
  1934. {
  1935. mmi_jmms_entry_parse_result_fail();
  1936. return;
  1937. }
  1938. EntryNewScreen(SCR_ID_JMMS_PARSING_SUCCESS_SCREEN, NULL, mmi_jmms_entry_parse_result_pass, NULL);
  1939.     ShowCategory2Screen(
  1940.         STR_MMS_MENUENTRY,
  1941.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1942.         STR_GLOBAL_OK,
  1943.         IMG_GLOBAL_OK,
  1944.         0,
  1945.         0,
  1946.         STR_ID_MMS_PARSING_SUCCESS,
  1947.         NULL);
  1948.     SetLeftSoftkeyFunction(mmi_jmms_entry_parse_result_pass_lsk, KEY_EVENT_UP);
  1949. }
  1950. /*****************************************************************************
  1951.  * FUNCTION
  1952.  *  mmi_jmms_entry_parse_result_pass_lsk
  1953.  * DESCRIPTION
  1954.  *  
  1955.  * PARAMETERS
  1956.  *  void
  1957.  * RETURNS
  1958.  *  void
  1959.  *****************************************************************************/
  1960. void mmi_jmms_entry_parse_result_pass_lsk(void)
  1961. {
  1962.     /*----------------------------------------------------------------*/
  1963.     /* Local Variables                                                */
  1964.     /*----------------------------------------------------------------*/
  1965.     /*----------------------------------------------------------------*/
  1966.     /* Code Body                                                      */
  1967.     /*----------------------------------------------------------------*/
  1968.     if (g_jmms_context->async_parse_context.callback != NULL)
  1969.     {
  1970. mmi_jmms_parse_call_error_callback(JC_OK);
  1971. DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_SUCCESS_SCREEN);
  1972.     }
  1973. else
  1974. {
  1975. GoBackHistory();
  1976. }
  1977. }
  1978. /*****************************************************************************
  1979.  * FUNCTION
  1980.  *  mmi_jmms_send_continue_start_timer
  1981.  * DESCRIPTION
  1982.  *  
  1983.  * PARAMETERS
  1984.  *  hMsg        [IN]        
  1985.  * RETURNS
  1986.  *  void
  1987.  *****************************************************************************/
  1988. void mmi_jmms_send_continue_start_timer(MSG_HANDLE hMsg)
  1989. {
  1990.     /*----------------------------------------------------------------*/
  1991.     /* Local Variables                                                */
  1992.     /*----------------------------------------------------------------*/
  1993.     /*----------------------------------------------------------------*/
  1994.     /* Code Body                                                      */
  1995.     /*----------------------------------------------------------------*/
  1996.     g_jmms_context->async_send_context.msgHandle = hMsg;
  1997.     StartTimer(JMMS_ASYNC_SEND_TIMER, JMMS_ASYNC_EVENT_TIME, mmi_jmms_send_continue_callback);
  1998. }
  1999. /*****************************************************************************
  2000.  * FUNCTION
  2001.  *  mmi_jmms_send_continue_callback
  2002.  * DESCRIPTION
  2003.  *  
  2004.  * PARAMETERS
  2005.  *  void
  2006.  * RETURNS
  2007.  *  void
  2008.  *****************************************************************************/
  2009. void mmi_jmms_send_continue_callback(void)
  2010. {
  2011.     /*----------------------------------------------------------------*/
  2012.     /* Local Variables                                                */
  2013.     /*----------------------------------------------------------------*/
  2014.     JC_RETCODE eRet = JC_OK;
  2015.     /*----------------------------------------------------------------*/
  2016.     /* Code Body                                                      */
  2017.     /*----------------------------------------------------------------*/
  2018.     StopTimer(JMMS_ASYNC_SEND_TIMER);
  2019.     eRet = mmi_jmms_jdi_msg_encapsulate_continue(g_jmms_context->async_send_context.msgHandle);
  2020.     if (eRet == JC_ERR_MMS_ENCODE_PENDING)
  2021.     {
  2022.         StartTimer(JMMS_ASYNC_SEND_TIMER, JMMS_ASYNC_EVENT_TIME, mmi_jmms_send_continue_callback);
  2023.     }
  2024.     else
  2025.     {
  2026.         mmi_jmms_decrement_send_callback_node(eRet);
  2027.     }
  2028. }
  2029. /*****************************************************************************
  2030.  * FUNCTION
  2031.  *  mmi_jmms_clean_send_callback_list
  2032.  * DESCRIPTION
  2033.  *  
  2034.  * PARAMETERS
  2035.  *  void
  2036.  * RETURNS
  2037.  *  void
  2038.  *****************************************************************************/
  2039. void mmi_jmms_clean_send_callback_list(void)
  2040. {
  2041.     /*----------------------------------------------------------------*/
  2042.     /* Local Variables                                                */
  2043.     /*----------------------------------------------------------------*/
  2044.     jmms_async_callback_list *nextHead;
  2045.     /*----------------------------------------------------------------*/
  2046.     /* Code Body                                                      */
  2047.     /*----------------------------------------------------------------*/
  2048.     if (g_jmms_context->async_send_context.callback_list != NULL)
  2049.     {
  2050.         while (g_jmms_context->async_send_context.callback_list->next != NULL)
  2051.         {
  2052.             nextHead = g_jmms_context->async_send_context.callback_list->next;
  2053.             jdd_MemFree(g_jmms_context->async_send_context.callback_list);
  2054.             g_jmms_context->async_send_context.callback_list = nextHead;
  2055.         }
  2056.         jdd_MemFree(g_jmms_context->async_send_context.callback_list);
  2057.         g_jmms_context->async_send_context.callback_list = NULL;
  2058.     }
  2059. }
  2060. /*****************************************************************************
  2061.  * FUNCTION
  2062.  *  mmi_jmms_add_send_callback_node
  2063.  * DESCRIPTION
  2064.  *  
  2065.  * PARAMETERS
  2066.  *  new_err_cb      [IN]        
  2067.  * RETURNS
  2068.  *  void
  2069.  *****************************************************************************/
  2070. void mmi_jmms_add_send_callback_node(error_callback new_err_cb)
  2071. {
  2072.     /*----------------------------------------------------------------*/
  2073.     /* Local Variables                                                */
  2074.     /*----------------------------------------------------------------*/
  2075.     jmms_async_callback_list *newHead;
  2076.     /*----------------------------------------------------------------*/
  2077.     /* Code Body                                                      */
  2078.     /*----------------------------------------------------------------*/
  2079.     newHead = (jmms_async_callback_list*) jdd_MemAlloc(sizeof(jmms_async_callback_list), 1);
  2080.     newHead->err_cb = new_err_cb;
  2081.     if (g_jmms_context->async_send_context.callback_list != NULL)
  2082.     {
  2083.         newHead->next = g_jmms_context->async_send_context.callback_list;
  2084.     }
  2085.     else
  2086.     {
  2087.         newHead->next = NULL;
  2088.     }
  2089.     g_jmms_context->async_send_context.callback_list = newHead;
  2090. }
  2091. /*****************************************************************************
  2092.  * FUNCTION
  2093.  *  mmi_jmms_decrement_send_callback_node
  2094.  * DESCRIPTION
  2095.  *  
  2096.  * PARAMETERS
  2097.  *  eRet        [IN]        
  2098.  * RETURNS
  2099.  *  void
  2100.  *****************************************************************************/
  2101. void mmi_jmms_decrement_send_callback_node(JC_RETCODE eRet)
  2102. {
  2103.     /*----------------------------------------------------------------*/
  2104.     /* Local Variables                                                */
  2105.     /*----------------------------------------------------------------*/
  2106.     jmms_async_callback_list *oldHead;
  2107.     /*----------------------------------------------------------------*/
  2108.     /* Code Body                                                      */
  2109.     /*----------------------------------------------------------------*/
  2110.     if (g_jmms_context->async_send_context.callback_list != NULL)
  2111.     {
  2112.         oldHead = g_jmms_context->async_send_context.callback_list;
  2113.         if (oldHead->next != NULL)
  2114.         {
  2115.             g_jmms_context->async_send_context.callback_list = oldHead->next;
  2116.         }
  2117.         else
  2118.         {
  2119.             g_jmms_context->async_send_context.callback_list = NULL;
  2120.         }
  2121.         oldHead->err_cb(eRet);
  2122.         if (oldHead != NULL)
  2123.         {
  2124.             jdd_MemFree(oldHead);
  2125.         }
  2126.     }
  2127. }
  2128. /*****************************************************************************
  2129.  * FUNCTION
  2130.  *  mmi_jmms_save_continue_start_timer
  2131.  * DESCRIPTION
  2132.  *  
  2133.  * PARAMETERS
  2134.  *  hMsg        [IN]        
  2135.  * RETURNS
  2136.  *  void
  2137.  *****************************************************************************/
  2138. void mmi_jmms_save_continue_start_timer(MSG_HANDLE hMsg)
  2139. {
  2140.     /*----------------------------------------------------------------*/
  2141.     /* Local Variables                                                */
  2142.     /*----------------------------------------------------------------*/
  2143.     /*----------------------------------------------------------------*/
  2144.     /* Code Body                                                      */
  2145.     /*----------------------------------------------------------------*/
  2146.     g_jmms_context->async_save_context.msgHandle = hMsg;
  2147.     StartTimer(JMMS_ASYNC_SAVE_TIMER, JMMS_ASYNC_EVENT_TIME, mmi_jmms_save_continue_callback);
  2148. }
  2149. /*****************************************************************************
  2150.  * FUNCTION
  2151.  *  mmi_jmms_save_continue_callback
  2152.  * DESCRIPTION
  2153.  *  
  2154.  * PARAMETERS
  2155.  *  void
  2156.  * RETURNS
  2157.  *  void
  2158.  *****************************************************************************/
  2159. void mmi_jmms_save_continue_callback(void)
  2160. {
  2161.     /*----------------------------------------------------------------*/
  2162.     /* Local Variables                                                */
  2163.     /*----------------------------------------------------------------*/
  2164.     JC_RETCODE eRet = JC_OK;
  2165.     /*----------------------------------------------------------------*/
  2166.     /* Code Body                                                      */
  2167.     /*----------------------------------------------------------------*/
  2168.     StopTimer(JMMS_ASYNC_SAVE_TIMER);
  2169.     eRet = mmi_jmms_jdi_msg_encapsulate_continue(g_jmms_context->async_save_context.msgHandle);
  2170.     if (eRet == JC_ERR_MMS_ENCODE_PENDING)
  2171.     {
  2172.         StartTimer(JMMS_ASYNC_SAVE_TIMER, JMMS_ASYNC_EVENT_TIME, mmi_jmms_save_continue_callback);
  2173.     }
  2174.     else
  2175.     {
  2176.         mmi_jmms_decrement_save_callback_node(eRet);
  2177.     }
  2178. }
  2179. /*****************************************************************************
  2180.  * FUNCTION
  2181.  *  mmi_jmms_clean_save_callback_list
  2182.  * DESCRIPTION
  2183.  *  
  2184.  * PARAMETERS
  2185.  *  void
  2186.  * RETURNS
  2187.  *  void
  2188.  *****************************************************************************/
  2189. void mmi_jmms_clean_save_callback_list(void)
  2190. {
  2191.     /*----------------------------------------------------------------*/
  2192.     /* Local Variables                                                */
  2193.     /*----------------------------------------------------------------*/
  2194.     jmms_async_callback_list *nextHead;
  2195.     /*----------------------------------------------------------------*/
  2196.     /* Code Body                                                      */
  2197.     /*----------------------------------------------------------------*/
  2198.     if (g_jmms_context->async_save_context.callback_list != NULL)
  2199.     {
  2200.         while (g_jmms_context->async_save_context.callback_list->next != NULL)
  2201.         {
  2202.             nextHead = g_jmms_context->async_save_context.callback_list->next;
  2203.             jdd_MemFree(g_jmms_context->async_save_context.callback_list);
  2204.             g_jmms_context->async_save_context.callback_list = nextHead;
  2205.         }
  2206.         jdd_MemFree(g_jmms_context->async_save_context.callback_list);
  2207.         g_jmms_context->async_save_context.callback_list = NULL;
  2208.     }
  2209. }
  2210. /*****************************************************************************
  2211.  * FUNCTION
  2212.  *  mmi_jmms_add_save_callback_node
  2213.  * DESCRIPTION
  2214.  *  
  2215.  * PARAMETERS
  2216.  *  new_err_cb      [IN]        
  2217.  * RETURNS
  2218.  *  void
  2219.  *****************************************************************************/
  2220. void mmi_jmms_add_save_callback_node(error_callback new_err_cb)
  2221. {
  2222.     /*----------------------------------------------------------------*/
  2223.     /* Local Variables                                                */
  2224.     /*----------------------------------------------------------------*/
  2225.     jmms_async_callback_list *newHead;
  2226.     /*----------------------------------------------------------------*/
  2227.     /* Code Body                                                      */
  2228.     /*----------------------------------------------------------------*/
  2229.     newHead = (jmms_async_callback_list*) jdd_MemAlloc(sizeof(jmms_async_callback_list), 1);
  2230.     newHead->err_cb = new_err_cb;
  2231.     if (g_jmms_context->async_save_context.callback_list != NULL)
  2232.     {
  2233.         newHead->next = g_jmms_context->async_save_context.callback_list;
  2234.     }
  2235.     else
  2236.     {
  2237.         newHead->next = NULL;
  2238.     }
  2239.     g_jmms_context->async_save_context.callback_list = newHead;
  2240. }
  2241. /*****************************************************************************
  2242.  * FUNCTION
  2243.  *  mmi_jmms_decrement_save_callback_node
  2244.  * DESCRIPTION
  2245.  *  
  2246.  * PARAMETERS
  2247.  *  eRet        [IN]        
  2248.  * RETURNS
  2249.  *  void
  2250.  *****************************************************************************/
  2251. void mmi_jmms_decrement_save_callback_node(JC_RETCODE eRet)
  2252. {
  2253.     /*----------------------------------------------------------------*/
  2254.     /* Local Variables                                                */
  2255.     /*----------------------------------------------------------------*/
  2256.     jmms_async_callback_list *oldHead;
  2257.     /*----------------------------------------------------------------*/
  2258.     /* Code Body                                                      */
  2259.     /*----------------------------------------------------------------*/
  2260.     if (g_jmms_context->async_save_context.callback_list != NULL)
  2261.     {
  2262.         oldHead = g_jmms_context->async_save_context.callback_list;
  2263.         if (oldHead->next != NULL)
  2264.         {
  2265.             g_jmms_context->async_save_context.callback_list = oldHead->next;
  2266.         }
  2267.         else
  2268.         {
  2269.             g_jmms_context->async_save_context.callback_list = NULL;
  2270.         }
  2271.         oldHead->err_cb(eRet);
  2272.         if (oldHead != NULL)
  2273.         {
  2274.             jdd_MemFree(oldHead);
  2275.         }
  2276.     }
  2277. }
  2278. /*****************************************************************************
  2279.  * FUNCTION
  2280.  *  mmi_jmms_is_message_to_fwd
  2281.  * DESCRIPTION
  2282.  *  
  2283.  * PARAMETERS
  2284.  *  void
  2285.  * RETURNS
  2286.  *  
  2287.  *****************************************************************************/
  2288. MMI_BOOL mmi_jmms_is_message_to_fwd(void)
  2289. {
  2290.     /*----------------------------------------------------------------*/
  2291.     /* Local Variables                                                */
  2292.     /*----------------------------------------------------------------*/
  2293.     /*----------------------------------------------------------------*/
  2294.     /* Code Body                                                      */
  2295.     /*----------------------------------------------------------------*/
  2296.     return g_jmms_context->message_to_fw;
  2297. }
  2298. /*****************************************************************************
  2299.  * FUNCTION
  2300.  *  mmi_jmms_set_fw_flag_of_message
  2301.  * DESCRIPTION
  2302.  *  
  2303.  * PARAMETERS
  2304.  *  void
  2305.  * RETURNS
  2306.  *  void
  2307.  *****************************************************************************/
  2308. void mmi_jmms_set_fw_flag_of_message(void)
  2309. {
  2310.     /*----------------------------------------------------------------*/
  2311.     /* Local Variables                                                */
  2312.     /*----------------------------------------------------------------*/
  2313.     /*----------------------------------------------------------------*/
  2314.     /* Code Body                                                      */
  2315.     /*----------------------------------------------------------------*/
  2316.     g_jmms_context->message_to_fw = MMI_TRUE;
  2317. }
  2318. /*****************************************************************************
  2319.  * FUNCTION
  2320.  *  mmi_jmms_reset_fw_flag_of_message
  2321.  * DESCRIPTION
  2322.  *  
  2323.  * PARAMETERS
  2324.  *  void
  2325.  * RETURNS
  2326.  *  void
  2327.  *****************************************************************************/
  2328. void mmi_jmms_reset_fw_flag_of_message(void)
  2329. {
  2330.     /*----------------------------------------------------------------*/
  2331.     /* Local Variables                                                */
  2332.     /*----------------------------------------------------------------*/
  2333.     /*----------------------------------------------------------------*/
  2334.     /* Code Body                                                      */
  2335.     /*----------------------------------------------------------------*/
  2336.     g_jmms_context->message_to_fw = MMI_FALSE;
  2337. }
  2338. #ifdef __USB_IN_NORMAL_MODE__
  2339. /*****************************************************************************
  2340.  * FUNCTION
  2341.  *  mmi_jmms_handle_usb_enter_req
  2342.  * DESCRIPTION
  2343.  *  
  2344.  * PARAMETERS
  2345.  *  void
  2346.  *  eRet(?)     [IN]        
  2347.  * RETURNS
  2348.  *  void
  2349.  *****************************************************************************/
  2350. void mmi_jmms_handle_usb_enter_req(void)
  2351. {
  2352.     /*----------------------------------------------------------------*/
  2353.     /* Local Variables                                                */
  2354.     /*----------------------------------------------------------------*/
  2355.     MYQUEUE Message;
  2356.     JC_RETCODE eRet = JC_OK;
  2357.     /*----------------------------------------------------------------*/
  2358.     /* Code Body                                                      */
  2359.     /*----------------------------------------------------------------*/
  2360.     /* sandeep start inorder to fix PMT_*/
  2361.     if(g_jmms_context->msg_handle)
  2362.     {
  2363.         jmms_communication_state_node *comm_node = mmi_jmms_get_comm_state(g_jmms_context, g_jmms_context->uiReferenceID);
  2364.         if(comm_node->mms_communication_state == E_TYPE_NEW_MMS)
  2365.         {
  2366.             eRet = mmi_jmms_send_and_store_mms("Outbox", g_jmms_context->msg_handle, comm_node);
  2367.         }
  2368.     }
  2369.     /* sandeep */
  2370.     /* Himanshu Fix PMTSW00006579 START */
  2371.     mmi_jmms_delete_compose_temp_files();
  2372.     /* Himanshu Fix PMTSW00006579 END */
  2373.     mmi_jmms_usb_create_mms_system_folder();
  2374.     Message.oslSrcId = MOD_WAP;
  2375.     Message.oslDestId = MOD_MMI;
  2376.     Message.oslMsgId = MSG_ID_MMS_ENTER_USB_MODE_RSP;
  2377.     Message.oslDataPtr = NULL;
  2378.     Message.oslPeerBuffPtr = NULL;
  2379.     OslMsgSendExtQueue(&Message);
  2380.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_usb_enter_req"));
  2381. }
  2382. /*****************************************************************************
  2383.  * FUNCTION
  2384.  *  mmi_jmms_handle_usb_exit_req
  2385.  * DESCRIPTION
  2386.  *  
  2387.  * PARAMETERS
  2388.  *  void
  2389.  *  eRet(?)     [IN]        
  2390.  * RETURNS
  2391.  *  void
  2392.  *****************************************************************************/
  2393. void mmi_jmms_handle_usb_exit_req(void)
  2394. {
  2395.     /*----------------------------------------------------------------*/
  2396.     /* Local Variables                                                */
  2397.     /*----------------------------------------------------------------*/
  2398.     MYQUEUE Message;
  2399.     /*----------------------------------------------------------------*/
  2400.     /* Code Body                                                      */
  2401.     /*----------------------------------------------------------------*/
  2402.     
  2403.     if(g_jmms_context) /*  The usb exit can come before the MMS has been initialized. */
  2404.     {
  2405.         jdd_FSCreateWapMmsSysFolders();
  2406. if(mmi_jmms_sys_folders_exist()!=JC_OK)
  2407. {
  2408. mmi_jmms_usb_delete_mms_system_folder();
  2409. mmi_jmms_deinit_shutdown();
  2410. g_jmms_context->init_done = JMMS_READY_WITHOUT_STORE;
  2411.             PRINT_INFORMATION_2((MMI_TRACE_INFO, "mmi_jmms_handle_usb_exit_req: %d",g_jmms_context->init_done ));
  2412. }
  2413. else
  2414. {
  2415. mmi_jmms_cached_pending_mms();
  2416. mmi_jmms_usb_delete_mms_system_folder();
  2417. mmi_jmms_store_jdi_sync_files(g_jmms_context->hStoreHandle);
  2418. }
  2419.     }
  2420.     Message.oslSrcId = MOD_WAP;
  2421.     Message.oslDestId = MOD_MMI;
  2422.     Message.oslMsgId = MSG_ID_MMS_EXIT_USB_MODE_RSP;
  2423.     Message.oslDataPtr = NULL;
  2424.     Message.oslPeerBuffPtr = NULL;
  2425.     OslMsgSendExtQueue(&Message);
  2426.     mmi_jmms_update_status_icon_indicator();
  2427.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_handle_usb_exit_req"));
  2428. }
  2429. /*****************************************************************************
  2430.  * FUNCTION
  2431.  *  mmi_jmms_check_usb_mode
  2432.  * DESCRIPTION
  2433.  *  
  2434.  * PARAMETERS
  2435.  *  void
  2436.  *  eRet(?)     [IN]        
  2437.  * RETURNS
  2438.  *  void
  2439.  *****************************************************************************/
  2440. U8 mmi_jmms_check_usb_mode(void)
  2441. {
  2442.     /*----------------------------------------------------------------*/
  2443.     /* Local Variables                                                */
  2444.     /*----------------------------------------------------------------*/
  2445.     /*----------------------------------------------------------------*/
  2446.     /* Code Body                                                      */
  2447.     /*----------------------------------------------------------------*/
  2448.     if (mmi_usb_is_in_mass_storage_mode() && jdd_FSIsMMSStorageExported())
  2449.     {
  2450.         PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s, return value = 1", "mmi_jmms_check_usb_mode"));
  2451.         return 1;
  2452.     }
  2453.     else
  2454.     {
  2455.         PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s, return value = 0", "mmi_jmms_check_usb_mode"));
  2456.         return 0;
  2457.     }
  2458. }
  2459. /*****************************************************************************
  2460.  * FUNCTION
  2461.  *  mms_delete_uncached_file_from_folder_file
  2462.  * DESCRIPTION
  2463.  *  Deletes the file from folder if it can not be moved.
  2464.  * PARAMETERS
  2465.  *  void
  2466.  *  eRet(?)     [IN]        
  2467.  * RETURNS
  2468.  *  void
  2469.  *****************************************************************************/
  2470. void mms_delete_uncached_file_from_folder_file(JC_CHAR *new_mms_path_src_ucs2)
  2471. {
  2472. int fhandle = -1;
  2473. JC_UINT32 uiExtraBytes;
  2474. U8 total_num_msgs = 0;
  2475. JC_RETCODE eRet = JC_OK;
  2476. jmms_folder_msgs_list *node = NULL;
  2477. fhandle = FS_Open(new_mms_path_src_ucs2, FS_READ_ONLY);
  2478. if(fhandle<0)
  2479. return;
  2480. mmi_jmms_set_active_folder(MMI_JMMS_INBOX);
  2481. mmi_jmms_jdi_get_extrabytes(g_jmms_context->hStoreHandle,fhandle,&uiExtraBytes);
  2482. uiExtraBytes &= 0x00FFFFFF;
  2483. FS_Close(fhandle);
  2484. mmi_jmms_delete_message_as_per_id(uiExtraBytes);
  2485. if(FS_Delete(new_mms_path_src_ucs2)!= FS_NO_ERROR)
  2486. {
  2487. ASSERT(0);
  2488. }
  2489. }
  2490. /*****************************************************************************
  2491.  * FUNCTION
  2492.  *  mmi_jmms_cached_pending_mms
  2493.  * DESCRIPTION
  2494.  *  
  2495.  * PARAMETERS
  2496.  *  void
  2497.  *  eRet(?)     [IN]        
  2498.  * RETURNS
  2499.  *  void
  2500.  *****************************************************************************/
  2501. void mmi_jmms_cached_pending_mms(void)
  2502. {
  2503.     /*----------------------------------------------------------------*/
  2504.     /* Local Variables                                                */
  2505.     /*----------------------------------------------------------------*/
  2506.     JC_INT8 mms_path_ascii[FMGR_MAX_PATH_LEN +1];
  2507.     JC_CHAR mms_path_src_ucs2[(FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH];
  2508.     JC_RETCODE eRet = JC_OK;
  2509.     JC_RETCODE eRet1 = JC_OK;
  2510.     U8 file_index = 0;
  2511.     U16 file_name[(FMGR_MAX_FILE_LEN + 1) * ENCODING_LENGTH];
  2512.     JC_INT32 drive_letter = FS_GetDrive(FS_DRIVE_I_SYSTEM, 1, FS_NO_ALT_DRIVE);
  2513.     JC_UINT32 file_size = 0;
  2514.     JDD_FILE_TYPE_enum file_type;
  2515.     /*----------------------------------------------------------------*/
  2516.     /* Code Body                                                      */
  2517.     /*----------------------------------------------------------------*/
  2518.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_cached_pending_mms"));
  2519.     sprintf(mms_path_ascii, "%c:\@wap\mms_sys\@mms", drive_letter);
  2520.     AnsiiToUnicodeString((S8*) mms_path_src_ucs2, (S8*) mms_path_ascii);
  2521.     if (g_jmms_context->jmms_fs_handle == NULL)
  2522.     {
  2523.         if (jdd_FSInitialize(&g_jmms_context->jmms_fs_handle) != JC_OK)
  2524.         {
  2525.             return;
  2526.         }
  2527.     }
  2528.     while (eRet == JC_OK)
  2529.     {
  2530.         JC_CHAR mms_path_dst_ucs2[(FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH];
  2531.         JC_CHAR new_mms_path_src_ucs2[(FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH];
  2532.         eRet = jdd_FSReadDir(g_jmms_context->jmms_fs_handle,mms_path_src_ucs2, file_index, file_name, FMGR_MAX_FILE_LEN, &file_type, &file_size);
  2533.         if(eRet == JC_OK)
  2534.         {
  2535.             if(file_type == JDD_FILE_TYPE_FOLDER)
  2536.             {
  2537.                 PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "found folder"));
  2538.                 file_index++;
  2539.             }
  2540.             else
  2541.             {
  2542.                 PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "found file"));
  2543.                 pfnUnicodeStrcpy((S8*)new_mms_path_src_ucs2,(S8*)mms_path_src_ucs2);
  2544.                 AnsiiToUnicodeString((S8*) mms_path_dst_ucs2, "\");
  2545.                 pfnUnicodeStrcat((S8*)new_mms_path_src_ucs2, (S8*)mms_path_dst_ucs2);
  2546.                 pfnUnicodeStrcat((S8*)new_mms_path_src_ucs2, (S8*)file_name);
  2547.                 UnicodeToAnsii((S8*)mms_path_ascii, (S8*)new_mms_path_src_ucs2);
  2548.                 PRINT_INFORMATION_2((MMI_TRACE_INFO, "source path: %s", mms_path_ascii));
  2549.             #ifdef MMS_IN_LARGE_STORAGE
  2550.                 drive_letter = FS_GetDrive(FS_DRIVE_I_SYSTEM, 2, FS_DRIVE_V_NORMAL | FS_DRIVE_I_SYSTEM);
  2551.             #endif 
  2552.                 sprintf(mms_path_ascii, "%c:\@mms\", drive_letter);
  2553.                 AnsiiToUnicodeString((S8*) mms_path_dst_ucs2, (S8*) mms_path_ascii);
  2554.                 pfnUnicodeStrcat((S8*)mms_path_dst_ucs2, (S8*)file_name);
  2555.                 UnicodeToAnsii((S8*)mms_path_ascii, (S8*)mms_path_dst_ucs2);
  2556.                 PRINT_INFORMATION_2((MMI_TRACE_INFO, "Destination path: %s", mms_path_ascii));
  2557.                 eRet1 = jdd_FSMove(NULL, new_mms_path_src_ucs2, NULL, mms_path_dst_ucs2);
  2558.                 if(eRet1 != JC_OK)
  2559.                 {
  2560.                     mms_delete_uncached_file_from_folder_file(new_mms_path_src_ucs2);
  2561. PRINT_INFORMATION_2((MMI_TRACE_INFO, "ERROR in caching mms files at file index: %d, ret code: %d", file_index, eRet));
  2562.                 }
  2563. else
  2564. {
  2565. PRINT_INFORMATION_2((MMI_TRACE_INFO, "DELETED FILE in caching mms files at file index: %d", file_index));
  2566. }
  2567.             }
  2568.         }
  2569.     }
  2570.     if (g_jmms_context->jmms_fs_handle != NULL)
  2571.     {
  2572.         jdd_FSDeinitialize(g_jmms_context->jmms_fs_handle);
  2573.         g_jmms_context->jmms_fs_handle = NULL;
  2574.     }
  2575. }
  2576. /*****************************************************************************
  2577.  * FUNCTION
  2578.  *  mmi_jmms_usb_create_mms_system_folder
  2579.  * DESCRIPTION
  2580.  *  
  2581.  * PARAMETERS
  2582.  *  void
  2583.  *  eRet(?)     [IN]        
  2584.  * RETURNS
  2585.  *  void
  2586.  *****************************************************************************/
  2587. void mmi_jmms_usb_create_mms_system_folder(void)
  2588. {
  2589.     /*----------------------------------------------------------------*/
  2590.     /* Local Variables                                                */
  2591.     /*----------------------------------------------------------------*/
  2592.     JDD_FILE fh;
  2593.     JC_INT8 folder_path_ascii[FMGR_MAX_PATH_LEN + 1];
  2594.     JC_CHAR folder_path_ucs2[(FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH];
  2595.     JC_INT32 drive_letter = FS_GetDrive(FS_DRIVE_I_SYSTEM, 1, FS_NO_ALT_DRIVE);
  2596. JDD_FSHANDLE fs_handle = NULL;
  2597.     /*----------------------------------------------------------------*/
  2598.     /* Code Body                                                      */
  2599.     /*----------------------------------------------------------------*/
  2600.    
  2601.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "mmi_jmms_usb_create_mms_system_folder"));
  2602.     if (fs_handle == NULL)
  2603.     {
  2604.         if (jdd_FSInitialize(&fs_handle) != JC_OK)
  2605.         {
  2606.             return;
  2607.         }
  2608.     }
  2609.     sprintf(folder_path_ascii, "%c:\@wap\mms_sys\@mms", drive_letter);
  2610.     AnsiiToUnicodeString((S8*) folder_path_ucs2, (S8*) folder_path_ascii);
  2611.     fh = jdd_FSOpen(fs_handle, (U16*) folder_path_ucs2, E_OPEN_READ_MODE);
  2612.     if (fh == NULL) /* Folder Does Not Exist */
  2613.     {
  2614.         PRINT_INFORMATION_2((MMI_TRACE_INFO, "Creating @wap\mms_sys\@mms folder as it does not exists."));
  2615.         jdd_FSMakeDir(fs_handle, (U16*) folder_path_ucs2);
  2616.         drive_letter = FS_GetDrive(FS_DRIVE_I_SYSTEM, 1, FS_NO_ALT_DRIVE);
  2617.         sprintf(folder_path_ascii, "%c:\@wap\mms_sys\@mms\temp", drive_letter);
  2618.         AnsiiToUnicodeString((S8*) folder_path_ucs2, (S8*) folder_path_ascii);
  2619.         jdd_FSMakeDir(fs_handle, (U16*) folder_path_ucs2);
  2620.     }
  2621.     else
  2622.     {
  2623.         PRINT_INFORMATION_2((MMI_TRACE_INFO, "Folder @wap\mms_sys\@mms already exists."));
  2624.         jdd_FSClose(fh);
  2625.         mmi_jmms_cached_pending_mms();
  2626.     }
  2627.     if (fs_handle != NULL)
  2628.     {
  2629.         jdd_FSDeinitialize(fs_handle);
  2630.         fs_handle = NULL;
  2631.     }
  2632. }
  2633. /*****************************************************************************
  2634.  * FUNCTION
  2635.  *  mmi_jmms_usb_delete_mms_system_folder
  2636.  * DESCRIPTION
  2637.  *  
  2638.  * PARAMETERS
  2639.  *  void
  2640.  *  eRet(?)     [IN]        
  2641.  * RETURNS
  2642.  *  void
  2643.  *****************************************************************************/
  2644. void mmi_jmms_usb_delete_mms_system_folder(void)
  2645. {
  2646.     /*----------------------------------------------------------------*/
  2647.     /* Local Variables                                                */
  2648.     /*----------------------------------------------------------------*/
  2649.     JC_INT8 mms_path_ascii[FMGR_MAX_PATH_LEN];
  2650.     JC_CHAR mms_path_src_ucs2[(FMGR_MAX_PATH_LEN + 1) * ENCODING_LENGTH];
  2651.     JC_INT32 drive_letter = FS_GetDrive(FS_DRIVE_I_SYSTEM, 1, FS_NO_ALT_DRIVE);
  2652.     /*----------------------------------------------------------------*/
  2653.     /* Code Body                                                      */
  2654.     /*----------------------------------------------------------------*/
  2655.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "mmi_jmms_usb_delete_mms_system_folder"));
  2656.     
  2657.     if (g_jmms_context->jmms_fs_handle == NULL)
  2658.     {
  2659.         if (jdd_FSInitialize(&g_jmms_context->jmms_fs_handle) != JC_OK)
  2660.         {
  2661.             return;
  2662.         }
  2663.     }
  2664.     drive_letter = FS_GetDrive(FS_DRIVE_I_SYSTEM, 1, FS_NO_ALT_DRIVE);
  2665.     sprintf(mms_path_ascii, "%c:\@wap\mms_sys\@mms\temp", drive_letter);
  2666.     AnsiiToUnicodeString((S8*) mms_path_src_ucs2, (S8*) mms_path_ascii);
  2667.     jdd_FSDelDir(g_jmms_context->jmms_fs_handle, (U16*) mms_path_src_ucs2);
  2668.     sprintf(mms_path_ascii, "%c:\@wap\mms_sys\@mms", drive_letter);
  2669.     AnsiiToUnicodeString((S8*) mms_path_src_ucs2, (S8*) mms_path_ascii);
  2670.     jdd_FSDelDir(g_jmms_context->jmms_fs_handle, (U16*) mms_path_src_ucs2);
  2671.     if (g_jmms_context->jmms_fs_handle != NULL)
  2672.     {
  2673.         jdd_FSDeinitialize(g_jmms_context->jmms_fs_handle);
  2674.         g_jmms_context->jmms_fs_handle = NULL;
  2675.     }
  2676. }
  2677. #endif /* __USB_IN_NORMAL_MODE__ */ /* #ifdef __USB_IN_NORMAL_MODE__ */
  2678. #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */ 
  2679. #endif /* _MMI_JMMSSECONDARYMMI_C */