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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2002
  8. *
  9. *****************************************************************************/
  10. /*****************************************************************************
  11.  *
  12.  * Filename:
  13.  * ---------
  14.  *  jmms_templates_ui.C
  15.  *
  16.  * Project:
  17.  * --------
  18.  *  MAUI
  19.  *
  20.  * Description:
  21.  * ------------
  22.  *  This file contains the ui for template folder in mms
  23.  *
  24.  * Author:
  25.  * -------
  26.  * -------
  27.  *
  28.  *============================================================================
  29.  *             HISTORY
  30.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  31.  *------------------------------------------------------------------------------
  32.  * removed!
  33.  *
  34.  * removed!
  35.  * removed!
  36.  * removed!
  37.  *
  38.  * removed!
  39.  * removed!
  40.  * removed!
  41.  *
  42.  * removed!
  43.  * removed!
  44.  * removed!
  45.  *
  46.  * removed!
  47.  * removed!
  48.  * removed!
  49.  *
  50.  * removed!
  51.  * removed!
  52.  * removed!
  53.  *
  54.  * removed!
  55.  * removed!
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  * removed!
  91.  * removed!
  92.  * removed!
  93.  *
  94.  * removed!
  95.  * removed!
  96.  * removed!
  97.  *
  98.  *------------------------------------------------------------------------------
  99.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  100.  *============================================================================
  101.  ****************************************************************************/
  102. // #if 0 //Pranav Commeneted
  103. #ifndef _MMI_JMMSTEMPLATESSECMMI_C
  104. #define _MMI_JMMSTEMPLATESSECMMI_C
  105. /***************************************************************************** 
  106. * Include
  107. *****************************************************************************/
  108. #include "MMI_features.h"
  109. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  110. #include "PixtelDataTypes.h"
  111. #include "Unicodexdcl.h"
  112. #include "HistoryGprot.h"
  113. #include "GlobalDefs.h"
  114. #include "SettingProfile.h"
  115. #include "DebugInitDef.h"
  116. #include "CommonScreens.h"
  117. #include "EventsGprot.h"
  118. #include "wgui_inputs.h"
  119. #include "wgui_categories.h"
  120. #include "wgui_categories_inputs.h"
  121. #include "MainMenuDef.h"
  122. #include "JMMSConfig.h"
  123. #include "JMMSMessageSettings.h"
  124. #include "JMMSDrafts.h"
  125. #include "JMMSExdcl.h"
  126. #include "JMMSCompose.h"
  127. #include "JMMSGprot.h"
  128. #include "JMMSInbox.h"
  129. #include "JMMSJSRHandler.h"
  130. #include "JMMSMainMMS.h"
  131. #include "JMMSMessageSettingsUtils.h"
  132. #include "JMMSOutbox.h"
  133. #include "JMMSProtocols.h"
  134. #include "JMMSPushHandling.h"
  135. #include "JMMSResEnum.h"
  136. #include "JMMSSent.h"
  137. #include "JMMSStoreHandling.h"
  138. #include "JMMSStructs.h"
  139. #include "JMMSTemplates.h"
  140. #include "JMMSUseDetails.h"
  141. #include "JMMSView.h"
  142. #include "JMMSWriteMMS.h"
  143. #include "TimerEvents.h"
  144. #include "wapadp.h"
  145. #ifdef __MMI_UNIFIED_MESSAGE__
  146. #include "JMMSUMHandling.h"
  147. #endif
  148. #include <PrvMessagingDataTypes.h>
  149. #include <MM1DataTypes.h>
  150. #include <ComposeUtils.h>
  151. #ifdef _MUTILANG_TEMPLATE_
  152. #include "NVRAMType.h"
  153. #include "NVRAMProt.h"
  154. #include "NVRAMEnum.h"
  155.     extern U16 gCurrLangIndex;
  156. #endif
  157. #include "JMMSCoreAPI.h"
  158. #include "custom_wap_config.h"
  159. #include "resource_audio.h"
  160. #include "MessagesResourceData.h"
  161. /***************************************************************************** 
  162. * Define
  163. *****************************************************************************/
  164. /***************************************************************************** 
  165. * Typedef 
  166. *****************************************************************************/
  167. /***************************************************************************** 
  168. * Local Variable
  169. *****************************************************************************/
  170. U8 gtemplate_count = 0;
  171. /***************************************************************************** 
  172. * Local Function
  173. *****************************************************************************/
  174. /***************************************************************************** 
  175. * Global Variable
  176. *****************************************************************************/
  177. /* extern audio_resource_struct* resource_mms_sounds; */
  178. extern audio_resource_struct *resource_mms_sounds;
  179. extern JC_RETCODE mmi_jdd_ui_get_image_buffer_size(JC_IMAGE_INFO *image_info);
  180. mmi_jmms_template_info_struct mms_templates[] = 
  181. {
  182.     {STR_ID_JMMS_TEMPLATES_TITLE_01, IMG_ID_JMMS_TEMPLATES_01, 0},      /* MMS Template 1 */
  183.     {STR_ID_JMMS_TEMPLATES_TITLE_02, IMG_ID_JMMS_TEMPLATES_02, 1},      /* MMS Template 2 */
  184.     {STR_ID_JMMS_TEMPLATES_TITLE_03, IMG_ID_JMMS_TEMPLATES_03, 2},      /* MMS Template 3 */
  185.     {STR_ID_JMMS_TEMPLATES_TITLE_04, IMG_ID_JMMS_TEMPLATES_04, 3},      /* MMS Template 4 */
  186.     {STR_ID_JMMS_TEMPLATES_TITLE_05, IMG_ID_JMMS_TEMPLATES_05, 4},      /* MMS Template 5 */
  187.     {STR_ID_JMMS_TEMPLATES_TITLE_06, IMG_ID_JMMS_TEMPLATES_06, 5},      /* MMS Template 6 */
  188.     {STR_ID_JMMS_TEMPLATES_TITLE_07, IMG_ID_JMMS_TEMPLATES_07, 6},      /* MMS Template 7 */
  189.     {STR_ID_JMMS_TEMPLATES_TITLE_08, IMG_ID_JMMS_TEMPLATES_08, 7},      /* MMS Template 8 */
  190.     {STR_ID_JMMS_TEMPLATES_TITLE_09, IMG_ID_JMMS_TEMPLATES_09, 8},      /* MMS Template 9 */
  191.     {STR_ID_JMMS_TEMPLATES_TITLE_10, IMG_ID_JMMS_TEMPLATES_10, 9},      /* MMS Template 10 */
  192. };
  193. /***************************************************************************** 
  194. * Global Function
  195. *****************************************************************************/
  196. extern void wap_send_fmt_format_rsp(void);
  197. /*****************************************************************************
  198.  * FUNCTION
  199.  *  mmi_jmms_highlight_templates
  200.  * DESCRIPTION
  201.  *  This function is to get the msg list from a folder
  202.  * PARAMETERS
  203.  *  void
  204.  *  Highlight hdlr of Template menu item in main mms screeen(?)(?)
  205.  * RETURNS
  206.  *  void
  207.  *****************************************************************************/
  208. void mmi_jmms_highlight_templates(void)
  209. {
  210.     /*----------------------------------------------------------------*/
  211.     /* Local Variables                                                */
  212.     /*----------------------------------------------------------------*/
  213.     /*----------------------------------------------------------------*/
  214.     /* Code Body                                                      */
  215.     /*----------------------------------------------------------------*/
  216.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  217.     SetLeftSoftkeyFunction(mmi_jmms_entry_templates, KEY_EVENT_UP);
  218.     SetKeyHandler(mmi_jmms_entry_templates, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  219.     SetKeyHandler(mmi_jmms_entry_templates, KEY_WAP, KEY_EVENT_DOWN);
  220. }
  221. /*****************************************************************************
  222.  * FUNCTION
  223.  *  mmi_jmms_templates_init
  224.  * DESCRIPTION
  225.  *  This function init the hilight handlers of templates menu items.
  226.  *  This is called at boot up time
  227.  * PARAMETERS
  228.  *  void
  229.  * RETURNS
  230.  *  void
  231.  *****************************************************************************/
  232. void mmi_jmms_templates_init(void)
  233. {
  234.     /*----------------------------------------------------------------*/
  235.     /* Local Variables                                                */
  236.     /*----------------------------------------------------------------*/
  237.     /*----------------------------------------------------------------*/
  238.     /* Code Body                                                      */
  239.     /*----------------------------------------------------------------*/
  240.     /* Templates options Highlight handlers */
  241.     SetHiliteHandler(MENU_ID_JMMS_TEMPLATES_OPTIONS_VIEW, mmi_jmms_highlight_templates_options_view);
  242.     SetHiliteHandler(MENU_ID_JMMS_TEMPLATES_OPTIONS_WRITE_MESSAGE, mmi_jmms_highlight_templates_options_write_message);
  243.     SetHiliteHandler(MENU_ID_JMMS_TEMPLATES_OPTIONS_PROPERTIES, mmi_jmms_highlight_templates_options_properties);
  244. #ifdef __MMI_UNIFIED_MESSAGE__
  245.     SetHiliteHandler(MENU_ID_JMMS_TEMPLATES_OPTIONS_VIEW_VIEW_AS, mmi_jmms_highlight_templates_options_view_view_as);
  246.     SetHiliteHandler(
  247.         MENU_ID_JMMS_TEMPLATES_OPTIONS_VIEW_SAVE_OBJECT,
  248.         mmi_jmms_highlight_templates_view_options_save_objects);
  249.     SetHiliteHandler(
  250.         MENU_ID_JMMS_TEMPLATES_OPTIONS_VIEW_USE_NUMBER,
  251.         mmi_jmms_highlight_templates_view_options_use_number);
  252. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  253.     gtemplate_count = 0;
  254. }
  255. /*****************************************************************************
  256.  * FUNCTION
  257.  *  mmi_jmms_entry_template_progress_screen
  258.  * DESCRIPTION
  259.  *  
  260.  * PARAMETERS
  261.  *  void
  262.  * RETURNS
  263.  *  void
  264.  *****************************************************************************/
  265. void mmi_jmms_entry_template_progress_screen(void)
  266. {
  267.     /*----------------------------------------------------------------*/
  268.     /* Local Variables                                                */
  269.     /*----------------------------------------------------------------*/
  270.   //  U32 len = 0;  // COMPILER WARNING REMOVAL
  271.     /*----------------------------------------------------------------*/
  272.     /* Code Body                                                      */
  273.     /*----------------------------------------------------------------*/
  274.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "mmi_jmms_entry_template_progress_screen"));
  275.     EntryNewScreen(SCR_ID_JMMS_PROGRESS, NULL, mmi_jmms_entry_template_progress_screen, NULL);
  276.     ShowCategory66Screen(
  277.         STR_MMS_MENUENTRY,
  278.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  279.         0,
  280.         0,
  281.         0,
  282.         0,
  283.         //STR_GLOBAL_BACK,
  284.         //IMG_GLOBAL_BACK,
  285.         (U8*) GetString(STR_ID_JMMS_PLEASE_WAIT),
  286.         IMG_ID_JMMS_PLEASE_WAIT,
  287.         NULL);
  288. }
  289. /*****************************************************************************
  290.  * FUNCTION
  291.  *  mmi_jmms_entry_templates
  292.  * DESCRIPTION
  293.  *  
  294.  * PARAMETERS
  295.  *  void
  296.  * RETURNS
  297.  *  void
  298.  *****************************************************************************/
  299. void mmi_jmms_entry_templates(void)
  300. {
  301.     /*----------------------------------------------------------------*/
  302.     /* Local Variables                                                */
  303.     /*----------------------------------------------------------------*/
  304.     U8 total_num_msgs = 0;
  305.     JC_RETCODE eRet = JC_OK;
  306. #ifdef _MUTILANG_TEMPLATE_  
  307.     U16 language_change =0;
  308.     S16 error;
  309. #endif
  310.     /*----------------------------------------------------------------*/
  311.     /* Code Body                                                      */
  312.     /*----------------------------------------------------------------*/
  313. if(g_jmms_context->init_done == JMMS_READY_WITHOUT_STORE)
  314. {
  315.         DisplayPopup((U8*) GetString(STR_GLOBAL_EMPTY), IMG_GLOBAL_EMPTY, 1, JMMS_POPUP_TIME, EMPTY_LIST_TONE);
  316. PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s", "JMMS: Store is not ready"));
  317.         return;
  318. }
  319.     eRet = mmi_mms_get_number_of_messages(MMI_JMMS_TEMPLATES, &total_num_msgs);
  320.     if (eRet != JC_OK)
  321.     {
  322.        DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  323.        PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "Error for Templates=",eRet));
  324.        return;
  325.     }
  326.     g_jmms_context->store_context->nMsgs_in_Current_folder = total_num_msgs;
  327. g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
  328.     g_jmms_context->store_context->current_folder_name = E_JMMS_TEMPLATES;
  329. #ifdef _MUTILANG_TEMPLATE_    
  330.      ReadValue(NVRAM_JMMS_LANGUAGE_CHANGE, &language_change, DS_SHORT, &error);
  331. //PMT SUKRIT START PMTSW00005844
  332. #if 0
  333. /* under construction !*/
  334. /* under construction !*/
  335. /* under construction !*/
  336. /* under construction !*/
  337. /* under construction !*/
  338. /* under construction !*/
  339. /* under construction !*/
  340. /* under construction !*/
  341. #endif
  342. //PMT SUKRIT END PMTSW00005844
  343.     if ((total_num_msgs < __MMI_MMS_TEMPLATES_NUM__)   || (language_change != gCurrLangIndex))
  344. #else
  345.     if (total_num_msgs < __MMI_MMS_TEMPLATES_NUM__)
  346. #endif
  347.     {
  348.         mmi_jmms_entry_template_progress_screen();
  349.         eRet = mmi_jmms_delete_all_message("Templates");
  350.         if (eRet != JC_OK && total_num_msgs > 0)
  351.         {
  352.             DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  353.             PRINT_INFORMATION_2((MMI_TRACE_INFO, "%s%d", "Error for Templates Deletion=",eRet));
  354.             DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
  355.             return;
  356.         }
  357.         else
  358.         {
  359.             gtemplate_count = 0;
  360.             mmi_jmms_create_template_messages();
  361.         }
  362.     }
  363.     else
  364.     {    
  365.         mmi_jmms_entry_templates_screen();
  366.     }
  367.     return;
  368. }
  369. /*****************************************************************************
  370.  * FUNCTION
  371.  *  mmi_jmms_entry_templates_screen
  372.  * DESCRIPTION
  373.  *  Entry fn for templates screeen
  374.  * PARAMETERS
  375.  *  void
  376.  *  Highlight hdlr of Template menu item in main mms screeen(?)(?)
  377.  * RETURNS
  378.  *  void
  379.  *****************************************************************************/
  380. void mmi_jmms_entry_templates_screen(void)
  381. {
  382.     /*----------------------------------------------------------------*/
  383.     /* Local Variables                                                */
  384.     /*----------------------------------------------------------------*/
  385.     PU8 gui_buffer; /* Buffer holding history data */
  386.     /*----------------------------------------------------------------*/
  387.     /* Code Body                                                      */
  388.     /*----------------------------------------------------------------*/
  389.     EntryNewScreen(SCR_ID_JMMS_TEMPLATES, NULL, mmi_jmms_entry_templates_screen, NULL);
  390.     DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
  391.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_TEMPLATES);
  392.     SetParentHandler(MENU_ID_JMMS_TEMPLATES);
  393.     RegisterHighlightHandler(mmi_jmms_folder_list_highlight_hdlr);
  394.     ShowCategory184Screen(
  395.         STR_ID_JMMS_TEMPLATES,
  396.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  397.         STR_GLOBAL_OPTIONS,
  398.         IMG_GLOBAL_OPTIONS,
  399.         STR_GLOBAL_BACK,
  400.         IMG_GLOBAL_BACK,
  401.         g_jmms_context->store_context->nMsgs_in_Current_folder,
  402.         mmi_jmms_get_item_data_templates,
  403.         0,
  404.         0,
  405.         gui_buffer);
  406.     SetLeftSoftkeyFunction(mmi_jmms_entry_templates_options_scren, KEY_EVENT_UP);
  407.     SetKeyHandler(mmi_jmms_entry_templates_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  408.     SetKeyHandler(mmi_jmms_entry_templates_options_scren, KEY_WAP, KEY_EVENT_DOWN);
  409.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  410.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  411. }
  412. /*****************************************************************************
  413.  * FUNCTION
  414.  *  mmi_jmms_get_item_data_templates
  415.  * DESCRIPTION
  416.  *  fn retrun the item data
  417.  * PARAMETERS
  418.  *  item_index          [IN]        (index of item to be drawn)
  419.  *  str_buff            [IN]        (string of item)
  420.  *  img_buff_p          [?]         [?]         (image corrsponding to item
  421.  *  str_img_mask        [IN]        
  422.  * RETURNS
  423.  *  void
  424.  *****************************************************************************/
  425. pBOOL mmi_jmms_get_item_data_templates(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
  426. {
  427.     /*----------------------------------------------------------------*/
  428.     /* Local Variables                                                */
  429.     /*----------------------------------------------------------------*/
  430.     /*----------------------------------------------------------------*/
  431.     /* Code Body                                                      */
  432.     /*----------------------------------------------------------------*/
  433.     if ((item_index < 0) || (item_index > MAX_POSSIBLE_MESSAGES))
  434.     {
  435.         return FALSE;
  436.     }
  437.     if (pfnUnicodeStrlen((S8*) GetString(mms_templates[item_index].strId)))
  438.     {
  439.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) GetString(mms_templates[item_index].strId));
  440.     }
  441.     else
  442.     {
  443.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) GetString(STR_ID_NO_SUBJECT));
  444.     }
  445.     *img_buff_p = (PU8) GetImage((U16) IMG_ID_JMMS_TEMPLATE_MMS);
  446.     return TRUE;
  447. }
  448. /*****************************************************************************
  449.  * FUNCTION
  450.  *  mmi_jmms_entry_templates_options_scren
  451.  * DESCRIPTION
  452.  *  Entry fn for templates options screen
  453.  * PARAMETERS
  454.  *  void
  455.  * RETURNS
  456.  *  void
  457.  *****************************************************************************/
  458. void mmi_jmms_entry_templates_options_scren(void)
  459. {
  460.     /*----------------------------------------------------------------*/
  461.     /* Local Variables                                                */
  462.     /*----------------------------------------------------------------*/
  463.     PU8 gui_buffer;                     /* Buffer holding history data */
  464.     U16 str_item_list[MAX_SUB_MENUS];   /* Stores the strings id of submenus returned */
  465.     U16 num_item;                       /* Stores no of children in the submenu */
  466.     /*----------------------------------------------------------------*/
  467.     /* Code Body                                                      */
  468.     /*----------------------------------------------------------------*/
  469.     EntryNewScreen(SCR_ID_JMMS_TEMPLATES_OPTIONS, NULL, mmi_jmms_entry_templates_options_scren, NULL);
  470.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_TEMPLATES_OPTIONS);
  471.     num_item = GetNumOfChild(MENU_ID_JMMS_TEMPLATES_OPTIONS);
  472.     GetSequenceStringIds_Ext(MENU_ID_JMMS_TEMPLATES_OPTIONS, str_item_list);
  473.     SetParentHandler(MENU_ID_JMMS_TEMPLATES_OPTIONS);
  474.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  475.     ShowCategory52Screen(
  476.         STR_GLOBAL_OPTIONS,
  477.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  478.         STR_GLOBAL_OK,
  479.         IMG_GLOBAL_OK,
  480.         STR_GLOBAL_BACK,
  481.         IMG_GLOBAL_BACK,
  482.         num_item,
  483.         str_item_list,
  484.         (U16*) gIndexIconsImageList,
  485.         NULL,
  486.         0,
  487.         0,
  488.         gui_buffer);
  489.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  490.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  491. }
  492. /*****************************************************************************
  493.  * FUNCTION
  494.  *  mmi_jmms_highlight_templates_options_view
  495.  * DESCRIPTION
  496.  *  Highlight hdlr of templates option view
  497.  * PARAMETERS
  498.  *  void
  499.  * RETURNS
  500.  *  void
  501.  *****************************************************************************/
  502. void mmi_jmms_highlight_templates_options_view(void)
  503. {
  504.     /*----------------------------------------------------------------*/
  505.     /* Local Variables                                                */
  506.     /*----------------------------------------------------------------*/
  507.     /*----------------------------------------------------------------*/
  508.     /* Code Body                                                      */
  509.     /*----------------------------------------------------------------*/
  510.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  511.     SetLeftSoftkeyFunction(mmi_jmms_templates_view, KEY_EVENT_UP);
  512.     SetKeyHandler(mmi_jmms_templates_view, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  513.     SetKeyHandler(mmi_jmms_templates_view, KEY_WAP, KEY_EVENT_DOWN);
  514. }
  515. /*****************************************************************************
  516.  * FUNCTION
  517.  *  mmi_jmms_highlight_templates_options_write_message
  518.  * DESCRIPTION
  519.  *  Highlight hdlr of templates option write mms
  520.  * PARAMETERS
  521.  *  void
  522.  * RETURNS
  523.  *  void
  524.  *****************************************************************************/
  525. void mmi_jmms_highlight_templates_options_write_message(void)
  526. {
  527.     /*----------------------------------------------------------------*/
  528.     /* Local Variables                                                */
  529.     /*----------------------------------------------------------------*/
  530.     /*----------------------------------------------------------------*/
  531.     /* Code Body                                                      */
  532.     /*----------------------------------------------------------------*/
  533.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  534.     SetLeftSoftkeyFunction(mmi_jmms_templates_write_message, KEY_EVENT_UP);
  535.     SetKeyHandler(mmi_jmms_templates_write_message, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  536.     SetKeyHandler(mmi_jmms_templates_write_message, KEY_WAP, KEY_EVENT_DOWN);
  537. }
  538. /*****************************************************************************
  539.  * FUNCTION
  540.  *  mmi_jmms_highlight_templates_options_properties
  541.  * DESCRIPTION
  542.  *  Highlight hdlr of templates option properties
  543.  * PARAMETERS
  544.  *  void
  545.  * RETURNS
  546.  *  void
  547.  *****************************************************************************/
  548. void mmi_jmms_highlight_templates_options_properties(void)
  549. {
  550.     /*----------------------------------------------------------------*/
  551.     /* Local Variables                                                */
  552.     /*----------------------------------------------------------------*/
  553.     /*----------------------------------------------------------------*/
  554.     /* Code Body                                                      */
  555.     /*----------------------------------------------------------------*/
  556.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  557.     SetLeftSoftkeyFunction(mmi_jmms_templates_properties, KEY_EVENT_UP);
  558.     SetKeyHandler(mmi_jmms_templates_properties, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  559.     SetKeyHandler(mmi_jmms_templates_properties, KEY_WAP, KEY_EVENT_DOWN);
  560. }
  561. #ifdef __MMI_UNIFIED_MESSAGE__
  562. /*****************************************************************************
  563.  * FUNCTION
  564.  *  mmi_jmms_highlight_templates_view_options_save_objects
  565.  * DESCRIPTION
  566.  *  Highlight hdlr of templates View option Save Object
  567.  * PARAMETERS
  568.  *  void
  569.  * RETURNS
  570.  *  void
  571.  *****************************************************************************/
  572. void mmi_jmms_highlight_templates_options_view_view_as(void)
  573. {
  574.     /*----------------------------------------------------------------*/
  575.     /* Local Variables                                                */
  576.     /*----------------------------------------------------------------*/
  577.     /*----------------------------------------------------------------*/
  578.     /* Code Body                                                      */
  579.     /*----------------------------------------------------------------*/
  580.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  581.     SetLeftSoftkeyFunction(mmi_jmms_view_mms, KEY_EVENT_UP);
  582.     SetKeyHandler(mmi_jmms_view_mms, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  583.     SetKeyHandler(mmi_jmms_view_mms, KEY_WAP, KEY_EVENT_DOWN);
  584. }
  585. /*****************************************************************************
  586.  * FUNCTION
  587.  *  mmi_jmms_highlight_templates_view_options_save_objects
  588.  * DESCRIPTION
  589.  *  Highlight hdlr of templates View option Save Object
  590.  * PARAMETERS
  591.  *  void
  592.  * RETURNS
  593.  *  void
  594.  *****************************************************************************/
  595. void mmi_jmms_highlight_templates_view_options_save_objects(void)
  596. {
  597.     /*----------------------------------------------------------------*/
  598.     /* Local Variables                                                */
  599.     /*----------------------------------------------------------------*/
  600.     /*----------------------------------------------------------------*/
  601.     /* Code Body                                                      */
  602.     /*----------------------------------------------------------------*/
  603.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  604.     SetLeftSoftkeyFunction(mmi_jmms_entry_save_object, KEY_EVENT_UP);
  605.     SetKeyHandler(mmi_jmms_entry_save_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  606.     SetKeyHandler(mmi_jmms_entry_save_object, KEY_WAP, KEY_EVENT_DOWN);
  607. }
  608. /*****************************************************************************
  609.  * FUNCTION
  610.  *  mmi_jmms_highlight_templates_view_options_use_number
  611.  * DESCRIPTION
  612.  *  Highlight hdlr of templates View option Use Number
  613.  * PARAMETERS
  614.  *  void
  615.  * RETURNS
  616.  *  void
  617.  *****************************************************************************/
  618. void mmi_jmms_highlight_templates_view_options_use_number(void)
  619. {
  620.     /*----------------------------------------------------------------*/
  621.     /* Local Variables                                                */
  622.     /*----------------------------------------------------------------*/
  623.     /*----------------------------------------------------------------*/
  624.     /* Code Body                                                      */
  625.     /*----------------------------------------------------------------*/
  626.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  627.     SetLeftSoftkeyFunction(mmi_jmms_template_use_number, KEY_EVENT_UP);
  628.     SetKeyHandler(mmi_jmms_template_use_number, KEY_SEND, KEY_EVENT_UP);
  629.     SetKeyHandler(mmi_jmms_template_use_number, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  630.     SetKeyHandler(mmi_jmms_template_use_number, KEY_WAP, KEY_EVENT_DOWN);
  631. }
  632. /*****************************************************************************
  633.  * FUNCTION
  634.  *  mmi_jmms_template_use_number
  635.  * DESCRIPTION
  636.  *  Pre entry fn for use details screen
  637.  * PARAMETERS
  638.  *  void
  639.  * RETURNS
  640.  *  void
  641.  *****************************************************************************/
  642. void mmi_jmms_template_use_number(void)
  643. {
  644.     /*----------------------------------------------------------------*/
  645.     /* Local Variables                                                */
  646.     /*----------------------------------------------------------------*/
  647.     /*----------------------------------------------------------------*/
  648.     /* Code Body                                                      */
  649.     /*----------------------------------------------------------------*/
  650.     mmi_jmms_pre_entry_use_details_screen(MMI_JMMS_TEMPLATES);
  651. }
  652. /*****************************************************************************
  653.  * FUNCTION
  654.  *  mmi_jmms_entry_templates_view_options_scren
  655.  * DESCRIPTION
  656.  *  Entry fn for templates options screen
  657.  * PARAMETERS
  658.  *  void
  659.  * RETURNS
  660.  *  void
  661.  *****************************************************************************/
  662. void mmi_jmms_entry_templates_view_options_scren(void)
  663. {
  664.     /*----------------------------------------------------------------*/
  665.     /* Local Variables                                                */
  666.     /*----------------------------------------------------------------*/
  667.     PU8 gui_buffer;                     /* Buffer holding history data */
  668.     U16 str_item_list[MAX_SUB_MENUS];   /* Stores the strings id of submenus returned */
  669.     U16 num_item;                       /* Stores no of children in the submenu */
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673.     EntryNewScreen(SCR_ID_JMMS_TEMPLATES_VIEW_OPTIONS, NULL, mmi_jmms_entry_templates_view_options_scren, NULL);
  674.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_TEMPLATES_VIEW_OPTIONS);
  675.     num_item = GetNumOfChild(MENU_ID_JMMS_TEMPLATES_VIEW_OPTIONS);
  676.     GetSequenceStringIds_Ext(MENU_ID_JMMS_TEMPLATES_VIEW_OPTIONS, str_item_list);
  677.     SetParentHandler(MENU_ID_JMMS_TEMPLATES_VIEW_OPTIONS);
  678.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  679.     ShowCategory52Screen(
  680.         STR_GLOBAL_OPTIONS,
  681.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  682.         STR_GLOBAL_OK,
  683.         IMG_GLOBAL_OK,
  684.         STR_GLOBAL_BACK,
  685.         IMG_GLOBAL_BACK,
  686.         num_item,
  687.         str_item_list,
  688.         (U16*) gIndexIconsImageList,
  689.         NULL,
  690.         0,
  691.         0,
  692.         gui_buffer);
  693.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  694.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  695. }
  696. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  697. /*****************************************************************************
  698.  * FUNCTION
  699.  *  mmi_jmms_templates_view
  700.  * DESCRIPTION
  701.  *  
  702.  * PARAMETERS
  703.  *  void
  704.  * RETURNS
  705.  *  void
  706.  *****************************************************************************/
  707. void mmi_jmms_templates_view(void)
  708. {
  709.     /*----------------------------------------------------------------*/
  710.     /* Local Variables                                                */
  711.     /*----------------------------------------------------------------*/
  712.     JC_RETCODE eRet = JC_OK;
  713.     CONTENT_DATA Content = {0, };
  714.     /*----------------------------------------------------------------*/
  715.     /* Code Body                                                      */
  716.     /*----------------------------------------------------------------*/
  717.     Content.bIsStream = E_TRUE;
  718.     eRet = mmi_jmms_get_message("Templates", &Content, (g_jmms_context->nCurr_scr_hilited_index + 1));
  719.     if (eRet != JC_OK)
  720.     {
  721.         mmi_jmms_error_handler(eRet);
  722.         goto END;
  723.     }
  724.   g_jmms_context->last_scr_id = SCR_ID_JMMS_TEMPLATES_OPTIONS;
  725. #ifdef __MMI_UNIFIED_MESSAGE__
  726. mmi_jmms_deinit_view();
  727. #endif 
  728.     eRet = mmi_jmms_pre_entry_mms_view(&Content);
  729.     if (eRet == JC_ERR_MMS_PARSE_PENDING)
  730.     {
  731.         return;
  732.     }
  733.   END:
  734.     if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
  735.     {
  736.         eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  737.         g_jmms_context->msg_handle = NULL;
  738.     }
  739. }
  740. /*****************************************************************************
  741.  * FUNCTION
  742.  *  mmi_jmms_templates_write_message
  743.  * DESCRIPTION
  744.  *  
  745.  * PARAMETERS
  746.  *  void
  747.  * RETURNS
  748.  *  void
  749.  *****************************************************************************/
  750. void mmi_jmms_templates_write_message(void)
  751. {
  752.     /*----------------------------------------------------------------*/
  753.     /* Local Variables                                                */
  754.     /*----------------------------------------------------------------*/
  755.     JC_RETCODE eRet = JC_OK;
  756.     /*----------------------------------------------------------------*/
  757.     /* Code Body                                                      */
  758.     /*----------------------------------------------------------------*/
  759.     mmi_jmms_deinit_mms_context(g_jmms_context);
  760.     if (g_jmms_context->pParseContent == NULL)
  761.     {
  762.         g_jmms_context->pParseContent = (CONTENT_DATA*) jdd_MemAlloc(sizeof(CONTENT_DATA), 1);
  763.     }
  764.     g_jmms_context->pParseContent->bIsStream = E_TRUE;
  765.     eRet = mmi_jmms_get_message("Templates", g_jmms_context->pParseContent, (g_jmms_context->nCurr_scr_hilited_index + 1));
  766.     if (eRet != JC_OK)
  767.     {
  768.         mmi_jmms_error_handler(eRet);
  769.         goto END;
  770.     }
  771.     mmi_jmms_parsing_progressing_screen();
  772.     eRet = mmi_jmms_jdi_parse_msg_buffer(&g_jmms_context->msg_handle, g_jmms_context->pParseContent, E_TYPE_MMS, E_TRUE);
  773.     if (eRet == JC_ERR_MMS_PARSE_PENDING)
  774.     {
  775.         mmi_jmms_parse_continue_start_timer(
  776.             g_jmms_context->msg_handle,
  777.             mmi_jmms_templates_write_message_async_callback, mmi_jmms_only_abort_parsing_progress);
  778.         return;
  779.     }
  780.     mmi_jmms_templates_write_message_async_callback(eRet);
  781.     return;
  782.   END:
  783.     if (g_jmms_context->pParseContent != NULL)
  784.     {
  785.         if (g_jmms_context->pParseContent->pFileName != NULL)
  786.         {
  787.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  788.             g_jmms_context->pParseContent->pFileName = NULL;
  789.         }
  790.         jdd_MemFree(g_jmms_context->pParseContent);
  791.         g_jmms_context->pParseContent = NULL;
  792.     }
  793.     if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
  794.     {
  795.         eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  796.         g_jmms_context->msg_handle = NULL;
  797.     }
  798.     g_jmms_context->is_add_media_warning = 0;
  799. }
  800. /*****************************************************************************
  801.  * FUNCTION
  802.  *  mmi_jmms_templates_write_message_async_callback
  803.  * DESCRIPTION
  804.  *  
  805.  * PARAMETERS
  806.  *  eRet        [IN]        
  807.  * RETURNS
  808.  *  void
  809.  *****************************************************************************/
  810. void mmi_jmms_templates_write_message_async_callback(JC_RETCODE eRet)
  811. {
  812.     /*----------------------------------------------------------------*/
  813.     /* Local Variables                                                */
  814.     /*----------------------------------------------------------------*/
  815.     MESSAGE_HEADERS *pMsgHeaders = NULL;
  816.     MESSAGE_SEND *send_p = NULL;
  817.     S32 len = 0;
  818.     ECreationMode create_mode;
  819.     JC_RETCODE eRet_restricted = JC_OK;
  820.     /*----------------------------------------------------------------*/
  821.     /* Code Body                                                      */
  822.     /*----------------------------------------------------------------*/
  823.     if (JC_OK != eRet)
  824.     {
  825.         if (GetActiveScreenId() == SCR_ID_JMMS_PARSING_PROGRESS)
  826.         {
  827.             mmi_jmms_error_handler(eRet);
  828.         }
  829.         goto END;
  830.     }
  831.     eRet = mmi_jmms_jdi_msg_register_callback(g_jmms_context->msg_handle, E_CB_ERROR_IND, (void*)mmi_jmms_error_ind_cb);
  832.     if (eRet != JC_OK)
  833.     {
  834.         mmi_jmms_error_handler(eRet);
  835.         goto END;
  836.     }
  837.     eRet = mmi_jmms_jdi_set_content_class(g_jmms_context->msg_handle, MMS_SUPPORTED_CONTENT_CLASS);
  838.     if (eRet != JC_OK)
  839.     {
  840.         mmi_jmms_error_handler(eRet);
  841.         goto END;
  842.     }
  843.     create_mode = mmi_jmms_compose_settings_creation_mode();
  844.     eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, create_mode);
  845.     if (eRet != JC_OK)
  846.     {
  847.         /********************************************************************
  848.            These lines are added to ask a query if the message contains the 
  849.            invalid media in restricted mode.
  850.             Written By  : RAJ KUMAR GUPTA
  851.             Date        : Augest 08, 2006
  852.          *******************************************************************/
  853.         if (JC_ERR_MSG_MMS_CONTENT_RESTRICTED == eRet)
  854.         {
  855.             eRet_restricted = JC_ERR_MSG_MMS_CONTENT_RESTRICTED;
  856.         }
  857.         else
  858.         {
  859.             mmi_jmms_error_handler(eRet);
  860.             goto END;
  861.         }
  862.         /*******************************************************************/
  863.     }
  864.     eRet = mmi_jmms_jdi_set_msg_type(g_jmms_context->msg_handle, E_TYPE_MMS);
  865.     if (eRet != JC_OK)
  866.     {
  867.         mmi_jmms_error_handler(eRet);
  868.         goto END;
  869.     }
  870.     eRet = mmi_jmms_jdi_set_presentation_type(g_jmms_context->msg_handle, E_PRESENTATION_SMIL);
  871.     if (eRet != JC_OK)
  872.     {
  873.         mmi_jmms_error_handler(eRet);
  874.         goto END;
  875.     }
  876.     eRet = mmi_jmms_jdi_set_max_pages(g_jmms_context->msg_handle, (U8) mmi_jmms_compose_settings_max_no_pages());
  877.     if (eRet != JC_OK)
  878.     {
  879.         mmi_jmms_error_handler(eRet);
  880.         goto END;
  881.     }
  882.     eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
  883.     if (eRet != JC_OK || pMsgHeaders == NULL)
  884.     {
  885.         eRet = JC_ERR_STORE_FILE_CORRUPTED;
  886.         mmi_jmms_error_handler(eRet);
  887.         goto END;
  888.     }
  889.     if (pMsgHeaders->eMsgType != E_MSG_TYPE_SEND)
  890.     {
  891.         DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  892.         goto END;
  893.     }
  894.     send_p = (MESSAGE_SEND*) (pMsgHeaders->pHeaders);
  895.     mmi_jmms_free_addresses_list();
  896.     /* /Make the subject buffer */
  897.     memset(g_jmms_context->subject_input_buffer, 0x00, (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH);
  898.     if (send_p->pSubject != NULL)
  899.     {
  900.         len = (pfnUnicodeStrlen((S8*) (send_p->pSubject)) + 1) * ENCODING_LENGTH;
  901.         if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
  902.         {
  903.             memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, (MAX_SUBJECT_LENGTH * ENCODING_LENGTH));
  904.         }
  905.         else
  906.         {
  907.             memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, len);
  908.         }
  909.     }
  910.     g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_DONE;
  911.     g_jmms_context->g_use_local_send_setings = 0;
  912. mmi_jmms_fill_mms_sending_settings();
  913.     if (g_jmms_context->is_add_media_warning == 0)
  914.     {
  915.         if (eRet_restricted == JC_ERR_MSG_MMS_CONTENT_RESTRICTED)
  916.         {
  917.             mmi_jmms_edit_content_restricted_mode_query();
  918.         }
  919.         else
  920.         {
  921.             mmi_jmms_entry_write_message_screen();
  922.         }
  923.     }
  924.     else
  925.     {
  926.         DisplayPopupCallBack(
  927.             (PU8) GetString(STR_ID_JMMS_MMS_ERR_WARNING_CONTENT_CLASS),
  928.             IMG_GLOBAL_WARNING,
  929.             1,
  930.             JMMS_POPUP_TIME,
  931.             WARNING_TONE,
  932.             mmi_jmms_entry_write_message_screen);
  933.     }
  934.   END:
  935.     if (g_jmms_context->pParseContent != NULL)
  936.     {
  937.         if (g_jmms_context->pParseContent->pFileName != NULL)
  938.         {
  939.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  940.             g_jmms_context->pParseContent->pFileName = NULL;
  941.         }
  942.         jdd_MemFree(g_jmms_context->pParseContent);
  943.         g_jmms_context->pParseContent = NULL;
  944.     }
  945.     if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
  946.     {
  947.         eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  948.         g_jmms_context->msg_handle = NULL;
  949.     }
  950.     g_jmms_context->is_add_media_warning = 0;
  951.     DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
  952. }
  953. /*****************************************************************************
  954.  * FUNCTION
  955.  *  mmi_jmms_templates_properties
  956.  * DESCRIPTION
  957.  *  
  958.  * PARAMETERS
  959.  *  void
  960.  * RETURNS
  961.  *  void
  962.  *****************************************************************************/
  963. void mmi_jmms_templates_properties(void)
  964. {
  965.     /*----------------------------------------------------------------*/
  966.     /* Local Variables                                                */
  967.     /*----------------------------------------------------------------*/
  968.     /*----------------------------------------------------------------*/
  969.     /* Code Body                                                      */
  970.     /*----------------------------------------------------------------*/
  971.     mmi_jmms_show_mms_properties(E_MSG_NEW_MMS_TEMPLATES, MMI_JMMS_TEMPLATES);
  972. }
  973. /*****************************************************************************
  974.  * FUNCTION
  975.  *  mmi_jmms_show_template_properties
  976.  * DESCRIPTION
  977.  *  
  978.  * PARAMETERS
  979.  *  void
  980.  * RETURNS
  981.  *  void
  982.  *****************************************************************************/
  983. void mmi_jmms_show_template_properties(void)
  984. {
  985.     /*----------------------------------------------------------------*/
  986.     /* Local Variables                                                */
  987.     /*----------------------------------------------------------------*/
  988.     PU8 gui_buffer; /* Buffer holding history data */
  989.     S8 temp[14];
  990.     S32 size_kb = 0, size_bytes = 0;
  991.     JC_UINT32 size = 0;
  992.     JC_RETCODE eRet = JC_OK;
  993.     /*----------------------------------------------------------------*/
  994.     /* Code Body                                                      */
  995.     /*----------------------------------------------------------------*/
  996.     EntryNewScreen(SCR_ID_JMMS_NOTIFICATION_PROPERTIES, NULL, mmi_jmms_show_template_properties, NULL);
  997.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_NOTIFICATION_PROPERTIES);
  998.     /* /Subject */
  999.     pfnUnicodeStrcpy((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SUBJECT));
  1000.     memset(temp, 0x00, 14);
  1001.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1002.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1003.     if (((MESSAGE_SEND*) g_jmms_context->MsgHeader_type_p)->pSubject == NULL)
  1004.     {
  1005.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_GLOBAL_EMPTY_LIST));
  1006.     }
  1007.     else
  1008.     {
  1009.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) ((MESSAGE_SEND*) g_jmms_context->MsgHeader_type_p)->pSubject);
  1010.     }
  1011.     /* /Size of MMS */
  1012.     /* /size is returned in Bytes */
  1013.     eRet = mmi_jmms_jdi_get_size(g_jmms_context->msg_handle, 0, &size);
  1014.     if (eRet != JC_OK)
  1015.     {
  1016.         if (g_jmms_context->msg_handle != NULL)
  1017.         {
  1018.             mmi_jmms_deinit_mms_context(g_jmms_context);
  1019.         }
  1020.     }
  1021.     memset(temp, 0x00, 14);
  1022.     AnsiiToUnicodeString((PS8) temp, (PS8) "nn");
  1023.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1024.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_SIZE));
  1025.     memset(temp, 0x00, 14);
  1026.     AnsiiToUnicodeString((PS8) temp, (PS8) "n----n");
  1027.     pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1028.     size_kb = size / 1024;
  1029.     size_bytes = size % 1024;
  1030.     if (size_kb >= 1)
  1031.     {
  1032.         size_kb++;
  1033.         memset(temp, 0x00, 14);
  1034.         gui_itoa((S32) size_kb, (UI_string_type) temp, 10);
  1035.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1036.         memset(temp, 0x00, 4);
  1037.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  1038.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1039.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_KB));
  1040.     }
  1041.     else
  1042.     {
  1043.         memset(temp, 0x00, 14);
  1044.         gui_itoa((S32) size_bytes, (UI_string_type) temp, 10);
  1045.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1046.         memset(temp, 0x00, 4);
  1047.         AnsiiToUnicodeString((PS8) temp, (PS8) " ");
  1048.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) temp);
  1049.         pfnUnicodeStrcat((S8*) subMenuData, (S8*) GetString(STR_ID_JMMS_BYTES));
  1050.     }
  1051.     ShowCategory78Screen(
  1052.         STR_MMS_MENUENTRY,
  1053.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1054.         NULL,
  1055.         NULL,
  1056.         STR_GLOBAL_BACK,
  1057.         IMG_GLOBAL_BACK,
  1058.         NULL,
  1059.         (U8*) subMenuData,
  1060.         pfnUnicodeStrlen((S8*) subMenuData),
  1061.         gui_buffer);
  1062.     SetRightSoftkeyFunction(mm_jmms_back_from_template_properties, KEY_EVENT_UP);
  1063.     SetKeyHandler(mm_jmms_back_from_template_properties, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1064. if (isInCall() == FALSE)
  1065. SetKeyHandler(mm_jmms_end_from_template_properties, KEY_END, KEY_EVENT_DOWN);
  1066.     return;
  1067. }
  1068. /*****************************************************************************
  1069.  * FUNCTION
  1070.  *  mm_jmms_back_from_template_properties
  1071.  * DESCRIPTION
  1072.  *  
  1073.  * PARAMETERS
  1074.  *  void
  1075.  * RETURNS
  1076.  *  void
  1077.  *****************************************************************************/
  1078. void mm_jmms_back_from_template_properties(void)
  1079. {
  1080.     /*----------------------------------------------------------------*/
  1081.     /* Local Variables                                                */
  1082.     /*----------------------------------------------------------------*/
  1083.     /*----------------------------------------------------------------*/
  1084.     /* Code Body                                                      */
  1085.     /*----------------------------------------------------------------*/
  1086.     mmi_jmms_deinit_mms_context(g_jmms_context);
  1087.     GoBackHistory();
  1088. }
  1089. /*****************************************************************************
  1090.  * FUNCTION
  1091.  *  mm_jmms_end_from_template_properties
  1092.  * DESCRIPTION
  1093.  *  
  1094.  * PARAMETERS
  1095.  *  void
  1096.  * RETURNS
  1097.  *  void
  1098.  *****************************************************************************/
  1099. void mm_jmms_end_from_template_properties(void)
  1100. {
  1101.     /*----------------------------------------------------------------*/
  1102.     /* Local Variables                                                */
  1103.     /*----------------------------------------------------------------*/
  1104.     /*----------------------------------------------------------------*/
  1105.     /* Code Body                                                      */
  1106.     /*----------------------------------------------------------------*/
  1107.     mmi_jmms_deinit_mms_context(g_jmms_context);
  1108.     DisplayIdleScreen();
  1109. }
  1110. /*****************************************************************************
  1111.  * FUNCTION
  1112.  *  mmi_jmms_create_template_messages
  1113.  * DESCRIPTION
  1114.  *  
  1115.  * PARAMETERS
  1116.  *  void
  1117.  * RETURNS
  1118.  *  void
  1119.  *****************************************************************************/
  1120. void mmi_jmms_create_template_messages(void)
  1121. {
  1122.     /*----------------------------------------------------------------*/
  1123.     /* Local Variables                                                */
  1124.     /*----------------------------------------------------------------*/
  1125.     /* U8 i = 0; */
  1126.     PU8 img_buff_p;
  1127.     S8 *title;
  1128.     /* JC_RETCODE eRet = JC_OK; */
  1129.     U32 audio_len = 0, image_len = 0;
  1130.     U8 *audio_buff = NULL;
  1131.     /*----------------------------------------------------------------*/
  1132.     /* Code Body                                                      */
  1133.     /*----------------------------------------------------------------*/
  1134.     /*
  1135.      * for (i = 0; i < __MMI_MMS_TEMPLATES_NUM__; i++)
  1136.      * {
  1137.      */
  1138.     title = (S8*) GetString(mms_templates[gtemplate_count].strId);
  1139.     img_buff_p = (PU8) GetImage((U16) (mms_templates[gtemplate_count].imageId));
  1140.     audio_len = resource_mms_sounds[mms_templates[gtemplate_count].audioId].len;
  1141.     audio_buff = (U8*) (resource_mms_sounds[mms_templates[gtemplate_count].audioId].data);
  1142.     mmi_jmms_create_template_mms(title, (U8*) (img_buff_p), image_len, audio_buff, audio_len);
  1143.     /* } */
  1144. }
  1145. /*****************************************************************************
  1146.  * FUNCTION
  1147.  *  mmi_jmms_create_template_mms
  1148.  * DESCRIPTION
  1149.  *  
  1150.  * PARAMETERS
  1151.  *  subject         [?]         [?]
  1152.  *  image_buff      [?]         [?]
  1153.  *  image_len       [IN]        
  1154.  *  audio_buff      [?]         [?]
  1155.  *  audio_len       [IN]        
  1156.  * RETURNS
  1157.  *  
  1158.  *****************************************************************************/
  1159. JC_RETCODE mmi_jmms_create_template_mms(S8 *subject, U8 *image_buff, U32 image_len, U8 *audio_buff, U32 audio_len)
  1160. {
  1161.     /*----------------------------------------------------------------*/
  1162.     /* Local Variables                                                */
  1163.     /*----------------------------------------------------------------*/
  1164.     JC_RETCODE eRet = JC_OK;
  1165.     MESSAGE_SEND *pMessageSend = NULL;
  1166.     MESSAGE_HEADERS *pMsgHeaders = NULL;
  1167.     S32 len = 0;
  1168.     JMMS_COMP_ERRCODE err_code;
  1169.     U8 content_type_audio[] = "audio/midi";
  1170.     JC_IMAGE_INFO img_info = {0, };
  1171.     /*----------------------------------------------------------------*/
  1172.     /* Code Body                                                      */
  1173.     /*----------------------------------------------------------------*/
  1174.     /* free any allocated memory */
  1175.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "Enters mmi_jmms_create_template_mms"));
  1176.     if (g_jmms_context->msg_handle != NULL)
  1177.     {
  1178.         mmi_jmms_deinit_mms_context(g_jmms_context);
  1179.     }
  1180.     if (g_jmms_context->compose_context == NULL)
  1181.     {
  1182.         g_jmms_context->compose_context =
  1183.             (jmms_compose_context_struct*) jdd_MemAlloc(sizeof(jmms_compose_context_struct), 1);
  1184.         if (g_jmms_context->compose_context == NULL)
  1185.         {
  1186.             eRet = JC_ERR_MEMORY_ALLOCATION;
  1187.             goto END;
  1188.         }
  1189.     }
  1190.     mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1191.     g_jmms_context->MsgHeaders_p = (MESSAGE_HEADERS*) jdd_MemAlloc(sizeof(MESSAGE_HEADERS), 1);
  1192.     if (NULL == g_jmms_context->MsgHeaders_p)
  1193.     {
  1194.         eRet = JC_ERR_MEMORY_ALLOCATION;
  1195.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1196.         goto END;
  1197.     }
  1198.     g_jmms_context->MsgHeader_type_p = (MESSAGE_SEND*) jdd_MemAlloc(sizeof(MESSAGE_SEND), 1);
  1199.     if (NULL == g_jmms_context->MsgHeader_type_p)
  1200.     {
  1201.         eRet = JC_ERR_MEMORY_ALLOCATION;
  1202.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1203.         goto END;
  1204.     }
  1205.     eRet = mmi_jmms_set_mmsc_version();
  1206.     if (eRet != JC_OK)
  1207.     {
  1208.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1209.         goto END;
  1210.     }
  1211.     pMsgHeaders = g_jmms_context->MsgHeaders_p;
  1212.     pMessageSend = g_jmms_context->MsgHeader_type_p;
  1213.     pMessageSend->pVersion = (JC_INT8*) g_jmms_context->version;
  1214.     pMessageSend->bDeliveryReport = DEFAULT_DELIVERY_REPORT_DURING_SENDING;
  1215.     pMessageSend->bReadReport = DEFAULT_READ_REPORT_DURING_SENDING;
  1216.     pMessageSend->bHideSender = E_OFF;
  1217.     pMessageSend->uiExpiryTime = MAX_VALIDITY_PERIOD_VALUE;
  1218.     pMessageSend->uiDeliveryTime = 0;
  1219.     pMessageSend->eMsgPriority = E_MSG_PRIORITY_NORMAL;
  1220.     pMessageSend->pReplyChargingInfo = NULL;
  1221.     pMessageSend->eMsgClass = E_MSG_PERSONAL_CLASS;
  1222.     pMessageSend->pTo = NULL;
  1223.     pMessageSend->pCc = NULL;
  1224.     pMessageSend->pBcc = NULL;
  1225.     len = 0;
  1226.     len = pfnUnicodeStrlen((S8*) subject);
  1227.     g_jmms_context->subject = (S8*) jdd_MemAlloc(sizeof(S8), (len + 1) * ENCODING_LENGTH);
  1228.     if ((g_jmms_context->subject == NULL) && (len != 0))
  1229.     {
  1230.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1231.         eRet = JC_ERR_MEMORY_ALLOCATION;
  1232.         goto END;
  1233.     }
  1234.     if (g_jmms_context->subject)
  1235.     {
  1236.         pfnUnicodeStrcpy((S8*) g_jmms_context->subject, (S8*) subject);
  1237.         pMessageSend->pSubject = (JC_CHAR*) g_jmms_context->subject;
  1238.     }
  1239.     pMessageSend->uiDate = 0;
  1240.     pMessageSend->pFrom = NULL;
  1241.     pMsgHeaders->eMsgType = E_MSG_TYPE_SEND;
  1242.     pMsgHeaders->pHeaders = pMessageSend;
  1243.     if (JMMS_COMP_OK == mmi_jmms_compose_new_mms())
  1244.     {
  1245.         g_jmms_context->compose_context->mms_bg_color = g_jmms_color_RGB_list[COLOR_WHITE];
  1246.         /* Added by Deepali for root layout. */
  1247.         err_code = mmi_jmms_set_bg_color(g_jmms_context->compose_context->mms_bg_color);
  1248.         if ((err_code == JMMS_COMP_OUT_MEMORY) || (err_code == JMMS_COMP_FAIL))
  1249.         {
  1250.             eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1251.             g_jmms_context->msg_handle = NULL;
  1252.             eRet = JC_ERR_MEMORY_ALLOCATION;
  1253.             goto END;
  1254.         }
  1255.         g_jmms_context->compose_context->curr_page_index = 0;
  1256.         err_code = mmi_jmms_compose_insert_slide();
  1257.         /* PMT HIMANSHU END 20060425 */
  1258.         if ((err_code == JMMS_COMP_OUT_MEMORY) || (err_code == JMMS_COMP_FAIL))
  1259.         {
  1260.             eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1261.             g_jmms_context->msg_handle = NULL;
  1262.             eRet = JC_ERR_MEMORY_ALLOCATION;
  1263.             goto END;
  1264.         }
  1265.     }
  1266.     else
  1267.     {
  1268.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1269.         goto END;
  1270.     }
  1271.     eRet = mmi_jmms_jdi_set_msg_headers(g_jmms_context->msg_handle, pMsgHeaders);
  1272.     if (JC_OK != eRet)
  1273.     {
  1274.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1275.         goto END;
  1276.     }
  1277. g_jmms_context->layout=CUSTOM_LAYOUT;
  1278.     jc_tcscpy(
  1279.         (UI_character_type*) g_jmms_context->compose_context->curr_slide_info.edit_content_buffer,
  1280.         (UI_character_type*) subject);
  1281.     mmi_jmms_compose_add_text(
  1282.         1,
  1283.         &g_jmms_context->compose_context->curr_slide_info.slide_prop.text_font,
  1284.         g_jmms_context->compose_context->curr_slide_info.slide_prop.text_color,1);
  1285. /* TODO: Need to see if the image is out of content class */
  1286.     img_info.pImgBuffer = image_buff;
  1287.     mmi_jdd_ui_get_image_buffer_size(&img_info);
  1288.     /* mmi_jmms_compose_add_media_buffer(U8 *buffer, U32 size, U8 type,U8 is_attachment, U8 page_index) */
  1289.     mmi_jmms_compose_add_media_template(
  1290.         img_info.pImgBuffer,
  1291.         (U8*) img_info.psMimeType,
  1292.         img_info.uiImgSize,
  1293.         E_MEDIA_IMAGE,
  1294.         E_FALSE,
  1295.         1);
  1296.     if (img_info.psMimeType != NULL)
  1297.     {
  1298.         jdd_MemFree(img_info.psMimeType);
  1299.     }
  1300. if(WAP_MMS_CONTENT_CLASS_IMAGE_BASIC != wap_get_mms_content_class())
  1301. {
  1302. mmi_jmms_compose_add_media_template(audio_buff, (U8*) content_type_audio, audio_len, E_MEDIA_AUDIO, E_FALSE, 1);
  1303. }
  1304.     eRet = mmi_jmms_save_mms(
  1305.             "Templates",
  1306.             g_jmms_context->msg_handle,
  1307.             MMI_FALSE,
  1308.             0,
  1309.             mmi_jmms_create_template_mms_return_callback);
  1310.     if (eRet == JC_ERR_MMS_ENCODE_PENDING)
  1311.     {
  1312.         return eRet;
  1313.     }
  1314.     else if(eRet!= JC_OK)
  1315.     {
  1316.         PRINT_INFORMATION_2((MMI_TRACE_INFO, "Parsing Failed: mmi_jmms_create_template_mms"));
  1317.         if(g_jmms_context->is_in_format_mode)
  1318.         {
  1319.             g_jmms_context->init_done = JMMS_TEMPLATES_INITIALIZED;
  1320.             PRINT_INFORMATION_2((MMI_TRACE_INFO, "mmi_jmms_create_template_mms: %d",g_jmms_context->init_done ));
  1321.         }
  1322.     }
  1323.   END:
  1324.     mmi_jmms_create_template_mms_return_callback(eRet);
  1325.     return eRet;
  1326. }
  1327. /*****************************************************************************
  1328.  * FUNCTION
  1329.  *  mmi_jmms_create_template_mms_return_callback
  1330.  * DESCRIPTION
  1331.  *  
  1332.  * PARAMETERS
  1333.  *  eRet        [IN]        
  1334.  * RETURNS
  1335.  *  void
  1336.  *****************************************************************************/
  1337. void mmi_jmms_create_template_mms_return_callback(JC_RETCODE eRet)
  1338. {
  1339.     /*----------------------------------------------------------------*/
  1340.     /* Local Variables                                                */
  1341.     /*----------------------------------------------------------------*/
  1342.     U8 total_num_msgs = 0;
  1343. #ifdef _MUTILANG_TEMPLATE_  
  1344.     U16 language_change =0;
  1345.     S16 error;
  1346. #endif
  1347.     /*----------------------------------------------------------------*/
  1348.     /* Code Body                                                      */
  1349.     /*----------------------------------------------------------------*/
  1350.     PRINT_INFORMATION_2((MMI_TRACE_INFO, "create_template_mms_return_callback: %d count:%d", eRet, gtemplate_count));
  1351.     if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
  1352.     {
  1353.         mmi_jmms_deinit_mms_context(g_jmms_context);
  1354.         mmi_jmms_free_mms_pdu_memory(g_jmms_context);
  1355.     }
  1356.     if (eRet != JC_OK)
  1357.     {
  1358.         g_jmms_context->init_done = JMMS_INITIALIZED;
  1359.         mmi_jmms_delete_all_message("Templates");
  1360.         if(GetActiveScreenId() == SCR_ID_JMMS_PROGRESS)
  1361.         {
  1362.             DisplayPopup((U8*) GetString(STR_ID_JMMS_MEMORY_FULL), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  1363.             DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
  1364.         }
  1365.         else
  1366.         {
  1367.             DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
  1368.         }
  1369.     }
  1370.     else
  1371.     {
  1372.         gtemplate_count++;
  1373.         if (gtemplate_count < __MMI_MMS_TEMPLATES_NUM__)
  1374.         {
  1375.             mmi_jmms_create_template_messages();
  1376.             g_jmms_context->layout = DEFAULT_LAYOUT;
  1377.             return;
  1378.         }
  1379.         else
  1380.         {
  1381.             eRet = mmi_mms_get_number_of_messages(MMI_JMMS_TEMPLATES, &total_num_msgs);
  1382.             if (eRet != JC_OK)
  1383.             {
  1384.                 ASSERT(0);
  1385.             }
  1386.             if (total_num_msgs == 0)
  1387.             {
  1388.                 if(GetActiveScreenId() == SCR_ID_JMMS_PROGRESS)
  1389.                 {
  1390.                     DisplayPopup((U8*) GetString(STR_GLOBAL_EMPTY), IMG_GLOBAL_EMPTY, 1, JMMS_POPUP_TIME, EMPTY_LIST_TONE);
  1391.                 }
  1392.                 if (g_jmms_context->init_done == JMMS_INITIALIZED)
  1393.                 {
  1394.                     g_jmms_context->init_done = JMMS_READY;
  1395.                     PRINT_INFORMATION_2((MMI_TRACE_INFO, "mmi_jmms_create_template_mms_return_callback: 0 MMS"));
  1396.                     if(g_jmms_context->is_in_format_mode)
  1397.                     {
  1398.                         wap_send_fmt_format_rsp();
  1399.                         g_jmms_context->is_in_format_mode = 0;
  1400.                     }
  1401.                     #ifdef __MMI_UNIFIED_MESSAGE__
  1402.                     mmi_um_jmms_ready_ind();
  1403.                     #endif
  1404.                 }
  1405.                 return;
  1406.             }
  1407.             g_jmms_context->store_context->nMsgs_in_Current_folder = total_num_msgs;
  1408.             if(GetActiveScreenId() == SCR_ID_JMMS_PROGRESS)
  1409.             {
  1410.                 mmi_jmms_entry_templates_screen();
  1411.             }
  1412.             else
  1413.             {
  1414.                 DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);
  1415.             }
  1416.             #ifdef _MUTILANG_TEMPLATE_    
  1417.             ReadValue(NVRAM_JMMS_LANGUAGE_CHANGE, &language_change, DS_SHORT, &error);
  1418.             if (language_change == 0xFFFF)
  1419.             {
  1420.                 WriteValue(NVRAM_JMMS_LANGUAGE_CHANGE, &gCurrLangIndex, DS_SHORT, &error);
  1421.             }
  1422.             else if(language_change != gCurrLangIndex)
  1423.             {
  1424.                 WriteValue(NVRAM_JMMS_LANGUAGE_CHANGE, &gCurrLangIndex, DS_SHORT, &error);
  1425.             }  
  1426.             #endif
  1427.         }
  1428.     }
  1429. if (g_jmms_context->init_done == JMMS_INITIALIZED)
  1430.     {
  1431.      g_jmms_context->init_done = JMMS_READY;
  1432.         PRINT_INFORMATION_2((MMI_TRACE_INFO, "create_template_mms_return_callback UM Ready: %d", g_jmms_context->init_done));
  1433.         if(g_jmms_context->is_in_format_mode)
  1434.         {
  1435.             wap_send_fmt_format_rsp();
  1436.             g_jmms_context->is_in_format_mode = 0;
  1437.         }
  1438.         #ifdef __MMI_UNIFIED_MESSAGE__
  1439.         mmi_um_jmms_ready_ind();
  1440.         #endif
  1441.     }
  1442. }
  1443. /*****************************************************************************
  1444.  * FUNCTION
  1445.  *  mmi_jmms_parsing_progressing_screen
  1446.  * DESCRIPTION
  1447.  *  
  1448.  * PARAMETERS
  1449.  *  void
  1450.  * RETURNS
  1451.  *  void
  1452.  *****************************************************************************/
  1453. void mmi_jmms_parsing_progressing_screen(void)
  1454. {
  1455.     /*----------------------------------------------------------------*/
  1456.     /* Local Variables                                                */
  1457.     /*----------------------------------------------------------------*/
  1458.     /*----------------------------------------------------------------*/
  1459.     /* Code Body                                                      */
  1460.     /*----------------------------------------------------------------*/
  1461.     EntryNewScreen(SCR_ID_JMMS_PARSING_PROGRESS, NULL, mmi_jmms_parsing_progressing_screen, NULL);
  1462.     ShowCategory154Screen(
  1463.         STR_MMS_MENUENTRY,
  1464.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1465.         0,
  1466.         0,
  1467.         STR_GLOBAL_CANCEL,
  1468.         0,
  1469.         (PU8)GetString(STR_ID_JMMS_PARSING_MMS),
  1470. NULL,
  1471.         IMG_GLOBAL_PROGRESS,
  1472.         NULL);
  1473.     SetRightSoftkeyFunction(mmi_jmms_abort_parsing_progress, KEY_EVENT_UP);
  1474. }
  1475. /*****************************************************************************
  1476.  * FUNCTION
  1477.  *  mmi_jmms_only_abort_parsing_progress
  1478.  * DESCRIPTION
  1479.  *  
  1480.  * PARAMETERS
  1481.  *  void
  1482.  * RETURNS
  1483.  *  void
  1484.  *****************************************************************************/
  1485. void mmi_jmms_only_abort_parsing_progress(void)
  1486. {
  1487.     /*----------------------------------------------------------------*/
  1488.     /* Local Variables                                                */
  1489.     /*----------------------------------------------------------------*/
  1490.     /*----------------------------------------------------------------*/
  1491.     /* Code Body                                                      */
  1492.     /*----------------------------------------------------------------*/
  1493. mmi_jmms_parse_continue_stop_timer();
  1494.     if (g_jmms_context->pParseContent != NULL)
  1495.     {
  1496.         if (g_jmms_context->pParseContent->pFileName != NULL)
  1497.         {
  1498.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  1499.             g_jmms_context->pParseContent->pFileName = NULL;
  1500.         }
  1501.         jdd_MemFree(g_jmms_context->pParseContent);
  1502.         g_jmms_context->pParseContent = NULL;
  1503.     }
  1504. }
  1505. /*****************************************************************************
  1506.  * FUNCTION
  1507.  *  mmi_jmms_abort_parsing_progress
  1508.  * DESCRIPTION
  1509.  *  
  1510.  * PARAMETERS
  1511.  *  void
  1512.  * RETURNS
  1513.  *  void
  1514.  *****************************************************************************/
  1515. void mmi_jmms_abort_parsing_progress(void)
  1516. {
  1517.     /*----------------------------------------------------------------*/
  1518.     /* Local Variables                                                */
  1519.     /*----------------------------------------------------------------*/
  1520.     /*----------------------------------------------------------------*/
  1521.     /* Code Body                                                      */
  1522.     /*----------------------------------------------------------------*/
  1523. mmi_jmms_only_abort_parsing_progress();
  1524.     if (g_jmms_context->msg_handle != NULL)
  1525.     {
  1526.         mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1527.         g_jmms_context->msg_handle = NULL;
  1528.     }
  1529.     g_jmms_context->is_add_media_warning = 0;
  1530.     GoBackHistory();
  1531. }
  1532. #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */ 
  1533. #endif /* _MMI_JMMSTEMPLATESSECMMI_C */ 
  1534. // #endif //#if 0 //Pranav Commeneted