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

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_sent_ui.C
  15.  *
  16.  * Project:
  17.  * --------
  18.  *  MAUI
  19.  *
  20.  * Description:
  21.  * ------------
  22.  *  This file contains the ui for send 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.  * removed!
  99.  * removed!
  100.  * removed!
  101.  *
  102.  * removed!
  103.  * removed!
  104.  * removed!
  105.  *
  106.  *------------------------------------------------------------------------------
  107.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  108.  *============================================================================
  109.  ****************************************************************************/
  110. #ifndef _MMI_JMMSSENTSECMMI_C
  111. #define _MMI_JMMSSENTSECMMI_C
  112. /***************************************************************************** 
  113. * Include
  114. *****************************************************************************/
  115. #include "MMI_features.h"
  116. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  117. #include "PixtelDataTypes.h"
  118. #include "Unicodexdcl.h"
  119. #include "HistoryGprot.h"
  120. #include "GlobalDefs.h"
  121. #include "SettingProfile.h"
  122. #include "DebugInitDef.h"
  123. #include "CommonScreens.h"
  124. #include "EventsGprot.h"
  125. #include "wgui_inputs.h"
  126. #include "wgui_categories.h"
  127. #include "wgui_categories_inputs.h"
  128. #include "JMMSStoreHandling.h"
  129. #include "MainMenuDef.h"
  130. #include <ddl.h>
  131. #include <jcal.h>
  132. #include <jcalnet.h>
  133. #include "jdi_wspdatatype.h"
  134. #include "jdi_transport.h"
  135. #include <jdi_communicator.h>
  136. #include <MessagingDatatypes.h>
  137. #include <MessagingAPI.h>
  138. #include <PrvMessagingDataTypes.h>
  139. #include <MM1DataTypes.h>
  140. #include <ComposeUtils.h>
  141. #include "JMMSConfig.h"
  142. #include "JMMSMessageSettings.h"
  143. #include "JMMSCoreAPI.h"
  144. #include "JMMSDrafts.h"
  145. #include "JMMSExdcl.h"
  146. /* /#include "JMMSGdcl.h" */
  147. #include "JMMSCompose.h"
  148. #include "JMMSGprot.h"
  149. #include "JMMSInbox.h"
  150. #include "JMMSJSRHandler.h"
  151. #include "JMMSMainMMS.h"
  152. #include "JMMSMessageSettingsUtils.h"
  153. #include "JMMSOutbox.h"
  154. #include "JMMSProtocols.h"
  155. #include "JMMSPushHandling.h"
  156. #include "JMMSResEnum.h"
  157. #include "JMMSSent.h"
  158. #include "JMMSStoreHandling.h"
  159. #include "JMMSStructs.h"
  160. #include "JMMSTemplates.h"
  161. #include "JMMSUseDetails.h"
  162. #include "JMMSView.h"
  163. #include "JMMSWriteMMS.h"
  164. #ifdef __MMI_UNIFIED_MESSAGE__
  165. #include "JMMSUMHandling.h"
  166. #include "UnifiedMessageDef.h"
  167. #include "UnifiedMessageProt.h"
  168. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  169. #include "wapadp.h"  // compiler warning removal
  170. /***************************************************************************** 
  171. * Define
  172. *****************************************************************************/
  173. /***************************************************************************** 
  174. * Typedef 
  175. *****************************************************************************/
  176. /***************************************************************************** 
  177. * Local Variable
  178. *****************************************************************************/
  179. /***************************************************************************** 
  180. * Local Function
  181. *****************************************************************************/
  182. /***************************************************************************** 
  183. * Global Variable
  184. *****************************************************************************/
  185. /***************************************************************************** 
  186. * Global Function
  187. *****************************************************************************/
  188. /*****************************************************************************
  189.  * FUNCTION
  190.  *  mmi_jmms_highlight_sent
  191.  * DESCRIPTION
  192.  *  highlight handler of sent menu item in main mms screen
  193.  * PARAMETERS
  194.  *  void
  195.  * RETURNS
  196.  *  void
  197.  *****************************************************************************/
  198. void mmi_jmms_highlight_sent(void)
  199. {
  200.     /*----------------------------------------------------------------*/
  201.     /* Local Variables                                                */
  202.     /*----------------------------------------------------------------*/
  203.     /*----------------------------------------------------------------*/
  204.     /* Code Body                                                      */
  205.     /*----------------------------------------------------------------*/
  206. #ifndef __MMI_UNIFIED_MESSAGE__
  207.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  208.     SetLeftSoftkeyFunction(mmi_jmms_entry_sent, KEY_EVENT_UP);
  209.     SetKeyHandler(mmi_jmms_entry_sent, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  210.     SetKeyHandler(mmi_jmms_entry_sent, KEY_WAP, KEY_EVENT_DOWN);
  211. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  212. }
  213. /*****************************************************************************
  214.  * FUNCTION
  215.  *  mmi_jmms_sent_init
  216.  * DESCRIPTION
  217.  *  This function init the hilight handlers of sent menu items.
  218.  *  This is called at boot up time
  219.  * PARAMETERS
  220.  *  void
  221.  * RETURNS
  222.  *  void
  223.  *****************************************************************************/
  224. void mmi_jmms_sent_init(void)
  225. {
  226.     /*----------------------------------------------------------------*/
  227.     /* Local Variables                                                */
  228.     /*----------------------------------------------------------------*/
  229.     /*----------------------------------------------------------------*/
  230.     /* Code Body                                                      */
  231.     /*----------------------------------------------------------------*/
  232.     /* Sent options Highlight handlers */
  233.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_VIEW, mmi_jmms_highlight_sent_options_view);
  234.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_DELETE, mmi_jmms_highlight_sent_options_delete);
  235.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_DELETE_ALL, mmi_jmms_highlight_sent_options_delete_all);
  236.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_PROPERTIES, mmi_jmms_highlight_sent_options_properties);
  237.     /* Sent use details highlight handlers */
  238.     SetHiliteHandler(
  239.         MENU_ID_JMMS_SENT_USE_DETAILS_ADDRESSES_ADD_TO_CONTACT,
  240.         mmi_jmms_highlight_options_use_details_add_to_contact);
  241.     SetHiliteHandler(MENU_ID_JMMS_SENT_USE_DETAILS_ADDRESSES_CALL, mmi_jmms_highlight_options_use_details_call);
  242. //KP Jerry add on 2007-4-12 start
  243. #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
  244.     SetHiliteHandler(MENU_ID_JMMS_SENT_USE_DETAILS_ADDRESSES_DAILIP, mmi_jmms_highlight_options_use_details_dialIP);
  245.     SetHiliteHandler(MENU_ID_JMMS_SENT_USE_DETAILS_ADDRESSES_SENDSMS, mmi_jmms_highlight_options_use_details_sendsms);
  246.     SetHiliteHandler(MENU_ID_JMMS_SENT_USE_DETAILS_ADDRESSES_SENDMMS, mmi_jmms_highlight_options_use_details_sendmms);
  247. #endif
  248. //KP Jerry add on 2007-4-12 end
  249. #ifdef __MMI_UNIFIED_MESSAGE__
  250.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_EDIT_MESSAGE, mmi_jmms_highlight_sent_options_edit_message);
  251.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_SAVE_OBJECTS, mmi_jmms_highlight_sent_options_save_object);
  252.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_USE_DETAILS_NUMBER, mmi_jmms_highlight_sent_options_use_number);
  253.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_FORWARD, mmi_jmms_highlight_sent_options_forward);
  254. #else /* __MMI_UNIFIED_MESSAGE__ */ 
  255.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_USE_DETAILS, mmi_jmms_highlight_sent_options_use_details);
  256.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_USE_DETAILS_NUMBER, mmi_jmms_highlight_options_use_details_number);
  257.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_USE_DETAILS_EMAIL, mmi_jmms_highlight_options_use_details_email);
  258.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_SENT_TO_OTHERS, mmi_jmms_highlight_sent_options_sent_to_others);
  259.     SetHiliteHandler(MENU_ID_JMMS_SENT_OPTIONS_MOVE_TO_DRAFTS, mmi_jmms_highlight_sent_options_move_to_drafts);
  260. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  261. }
  262. #ifndef __MMI_UNIFIED_MESSAGE__
  263. /*****************************************************************************
  264.  * FUNCTION
  265.  *  mmi_jmms_entry_sent
  266.  * DESCRIPTION
  267.  *  Pre entry fn for sent screen
  268.  * PARAMETERS
  269.  *  void
  270.  * RETURNS
  271.  *  void
  272.  *****************************************************************************/
  273. void mmi_jmms_entry_sent(void)
  274. {
  275.     /*----------------------------------------------------------------*/
  276.     /* Local Variables                                                */
  277.     /*----------------------------------------------------------------*/
  278.     U8 total_num_msgs = 0;
  279.     JC_RETCODE eRet = JC_OK;
  280.     U16 currScrenID = 0;
  281.     /*----------------------------------------------------------------*/
  282.     /* Code Body                                                      */
  283.     /*----------------------------------------------------------------*/
  284.     eRet = mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &total_num_msgs);
  285.     if (eRet != JC_OK)
  286.     {
  287.         ASSERT(0);
  288.     }
  289.     /* set the open msg status- for At delete */
  290.     g_jmms_context->msg_open_status[0] = E_JMMS_SENT;
  291.     g_jmms_context->msg_open_status[1] = 0;
  292.     if (total_num_msgs == 0)
  293.     {
  294.         DisplayPopup((U8*) GetString(STR_GLOBAL_EMPTY), IMG_GLOBAL_EMPTY, 1, JMMS_POPUP_TIME, EMPTY_LIST_TONE);
  295.         return;
  296.     }
  297.     g_jmms_context->store_context->nMsgs_in_Current_folder = total_num_msgs;
  298. g_jmms_context->store_context->update_nmsgs_in_current_folder = 0;
  299.     g_jmms_context->store_context->current_folder_name = E_JMMS_SENT;
  300.     mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
  301.     g_jmms_context->store_context->jmms_start_index = 1;
  302.     mmi_jmms_entry_get_msgs_progress_screen();
  303.     eRet = mmi_jmms_get_folder_msg_list(&(g_jmms_context->store_context->messages_list), MMI_JMMS_SENT, total_num_msgs);
  304.     if (eRet != JC_OK || g_jmms_context->store_context->messages_list == NULL)
  305.     {
  306.         currScrenID = GetActiveScreenId();
  307.         mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
  308.         if (currScrenID == SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN)
  309.         {
  310.             DisplayPopup(
  311.                 (U8*) GetString(STR_ID_JMMS_ERROR_GET_MSG_LIST),
  312.                 IMG_GLOBAL_ERROR,
  313.                 1,
  314.                 JMMS_POPUP_TIME,
  315.                 (U8) ERROR_TONE);
  316.             DeleteUptoScrID(SCR_ID_JMMS_MAIN_MENU);
  317.         }
  318.         else
  319.         {
  320.             /* to avoid the show of pop up over Phone call or some other screen */
  321.             HistoryReplace(
  322.                 SCR_ID_JMMS_GET_MSGS_PROGRESS_SCREEN,
  323.                 SCR_ID_JMMS_GET_MSGS_ERROR_SCREEN,
  324.                 mmi_jmms_entry_msgs_get_error_screen);
  325.         }
  326.     }
  327.     return;
  328. }
  329. /*****************************************************************************
  330.  * FUNCTION
  331.  *  mmi_jmms_entry_sent_screen
  332.  * DESCRIPTION
  333.  *  Entry fn for sent screen
  334.  * PARAMETERS
  335.  *  void
  336.  * RETURNS
  337.  *  void
  338.  *****************************************************************************/
  339. void mmi_jmms_entry_sent_screen(void)
  340. {
  341.     /*----------------------------------------------------------------*/
  342.     /* Local Variables                                                */
  343.     /*----------------------------------------------------------------*/
  344.     PU8 gui_buffer; /* Buffer holding history data */
  345.     U8 num_item;    /* Stores no of children in the submenu */
  346.     JC_RETCODE eRet = JC_OK;
  347.     /*----------------------------------------------------------------*/
  348.     /* Code Body                                                      */
  349.     /*----------------------------------------------------------------*/
  350.     eRet = mmi_mms_get_number_of_messages(MMI_JMMS_SENT, &num_item);
  351.     if (eRet != JC_OK)
  352.     {
  353.         ASSERT(0);
  354.     }
  355.     //if number of msga in fodelr is not same to as in global var then
  356.     //it means some has been recieved as user was in inbox so need to update
  357.     ///the msgs list
  358.     if (g_jmms_context->store_context->update_nmsgs_in_current_folder)
  359.     {
  360.         mmi_jmms_entry_sent();
  361.         return;
  362.     }
  363.     EntryNewScreen(SCR_ID_JMMS_SENT, NULL, mmi_jmms_entry_sent_screen, NULL);
  364.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_SENT);
  365.     SetParentHandler(MENU_ID_JMMS_SENT);
  366.     RegisterHighlightHandler(mmi_jmms_folder_list_highlight_hdlr);
  367.     /* reset the open msg status- for At delete */
  368.     g_jmms_context->msg_open_status[0] = 0;
  369.     g_jmms_context->msg_open_status[1] = 0;
  370.     ShowCategory184Screen(
  371. /* MAUI_00018172 Start */
  372.         STR_ID_JMMS_SENT,
  373. /* MAUI_00018172 End */
  374.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  375.         STR_GLOBAL_OPTIONS,
  376.         IMG_GLOBAL_OPTIONS,
  377.         STR_GLOBAL_BACK,
  378.         IMG_GLOBAL_BACK,
  379.         g_jmms_context->store_context->nMsgs_in_Current_folder,
  380.         mmi_jmms_get_item_data_sent,
  381.         mmi_jmms_get_item_hint_sent,
  382.         g_jmms_context->nCurr_scr_hilited_index,
  383.         gui_buffer);
  384.     SetLeftSoftkeyFunction(mmi_jmms_entry_sent_options_scren, KEY_EVENT_UP);
  385.     SetKeyHandler(mmi_jmms_entry_sent_options_scren, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  386.     SetKeyHandler(mmi_jmms_entry_sent_options_scren, KEY_WAP, KEY_EVENT_DOWN);
  387.     SetRightSoftkeyFunction(mmi_jmms_back_from_msgs_list_screen, KEY_EVENT_UP);
  388.     SetKeyHandler(mmi_jmms_back_from_msgs_list_screen, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  389. }
  390. /*****************************************************************************
  391.  * FUNCTION
  392.  *  mmi_jmms_get_item_data_sent
  393.  * DESCRIPTION
  394.  *  fn retrun the item data
  395.  * PARAMETERS
  396.  *  item_index          [IN]        (index of item to be drawn)
  397.  *  str_buff            [IN]        (string of item)
  398.  *  img_buff_p          [?]         [?]         [?]         (image corrsponding to item
  399.  *  str_img_mask        [IN]        
  400.  * RETURNS
  401.  *  void
  402.  *****************************************************************************/
  403. pBOOL mmi_jmms_get_item_data_sent(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
  404. {
  405.     /*----------------------------------------------------------------*/
  406.     /* Local Variables                                                */
  407.     /*----------------------------------------------------------------*/
  408.     S32 count = 0;
  409.     jmms_folder_msgs_list *msgs_list_node = NULL;
  410.     /*----------------------------------------------------------------*/
  411.     /* Code Body                                                      */
  412.     /*----------------------------------------------------------------*/
  413.     if ((item_index < 0) || (item_index > MAX_POSSIBLE_MESSAGES))
  414.     {
  415.         return FALSE;
  416.     }
  417.     msgs_list_node = g_jmms_context->store_context->messages_list;
  418.     while (count != item_index && msgs_list_node != NULL)
  419.     {
  420.         msgs_list_node = msgs_list_node->next;
  421.         count++;
  422.     }
  423.     if (msgs_list_node == NULL)
  424.     {
  425.         return FALSE;
  426.     }
  427.     pfnUnicodeStrcpy((S8*) str_buff, msgs_list_node->subject_as_caption);
  428.     /* /TODO:: may need to change the icon */
  429.     *img_buff_p = (PU8) GetImage((U16) (IMG_ID_JMMS_SENT_MMS));
  430.     return TRUE;
  431. }
  432. /*****************************************************************************
  433.  * FUNCTION
  434.  *  mmi_jmms_get_item_hint_sent
  435.  * DESCRIPTION
  436.  *  Retrun the hint fot the item to be drawn
  437.  * PARAMETERS
  438.  *  item_index      [IN]        (index of item to be drawn)
  439.  *  hint_array      [?]         [?]         [?]         (hint buufer for the item_index)
  440.  * RETURNS
  441.  *  void
  442.  *****************************************************************************/
  443. S32 mmi_jmms_get_item_hint_sent(S32 item_index, UI_string_type *hint_array)
  444. {
  445.     /*----------------------------------------------------------------*/
  446.     /* Local Variables                                                */
  447.     /*----------------------------------------------------------------*/
  448.     S32 count = 0;
  449.     jmms_folder_msgs_list *msgs_list_node = NULL;
  450.     /*----------------------------------------------------------------*/
  451.     /* Code Body                                                      */
  452.     /*----------------------------------------------------------------*/
  453.     if ((item_index < 0) || (item_index > MAX_POSSIBLE_MESSAGES))
  454.     {
  455.         return FALSE;
  456.     }
  457.     msgs_list_node = g_jmms_context->store_context->messages_list;
  458.     while (count != item_index && msgs_list_node != NULL)
  459.     {
  460.         msgs_list_node = msgs_list_node->next;
  461.         count++;
  462.     }
  463.     if (msgs_list_node == NULL || msgs_list_node->address_as_hint == NULL)
  464.     {
  465.         return 0;
  466.     }
  467.     if (pfnUnicodeStrlen((S8*) (msgs_list_node->address_as_hint)))
  468.     {
  469.         pfnUnicodeStrcpy((S8*) hint_array[0], (S8*) (msgs_list_node->address_as_hint));
  470.     }
  471.     else
  472.     {
  473.         return 0;   /* No Hint Data */
  474.     }
  475.     return TRUE;
  476. }
  477. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  478. /*****************************************************************************
  479.  * FUNCTION
  480.  *  mmi_jmms_entry_sent_options_scren
  481.  * DESCRIPTION
  482.  *  Entry fn for sent options
  483.  * PARAMETERS
  484.  *  void
  485.  * RETURNS
  486.  *  void
  487.  *****************************************************************************/
  488. void mmi_jmms_entry_sent_options_scren(void)
  489. {
  490.     /*----------------------------------------------------------------*/
  491.     /* Local Variables                                                */
  492.     /*----------------------------------------------------------------*/
  493.     PU8 gui_buffer;                     /* Buffer holding history data */
  494.     U16 str_item_list[MAX_SUB_MENUS];   /* Stores the strings id of submenus returned */
  495.     U16 num_item;                       /* Stores no of children in the submenu */
  496. #ifdef __MMI_UNIFIED_MESSAGE__
  497.     U8 curr_page =0;
  498.     MEDIA_INFO *image_info;
  499.     U8 media_count = 0;
  500. #endif 
  501.     /*----------------------------------------------------------------*/
  502.     /* Code Body                                                      */
  503.     /*----------------------------------------------------------------*/
  504.     EntryNewScreen(SCR_ID_JMMS_SENT_OPTIONS, NULL, mmi_jmms_entry_sent_options_scren, NULL);
  505.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_SENT_OPTIONS);
  506. #ifdef __MMI_UNIFIED_MESSAGE__
  507.     DeleteScreenIfPresent(SCR_ID_JMMS_SENT_OPTIONS);
  508. #endif 
  509.     num_item = GetNumOfChild(MENU_ID_JMMS_SENT_OPTIONS);
  510. #ifdef __MMI_UNIFIED_MESSAGE__
  511.     mmi_jmms_jdi_get_media_count(g_jmms_context->msg_handle, 0, &media_count, E_TRUE);
  512.     mmi_jmms_jdi_get_current_page_index(g_jmms_context->msg_handle, &curr_page);
  513.     image_info = mmi_jmms_jdi_get_image_data(curr_page);
  514.     if (g_jmms_context->view_context != NULL)
  515.     {
  516.         if (/*g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_IMAGE ||
  517.             g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_AUDIO ||
  518.             g_jmms_context->view_context->focus_object_type == E_MSG_FOCUS_VIDEO ||
  519.             */
  520.             media_count || g_jmms_context->view_context->view_audio_id || g_jmms_context->view_context->view_video_id || image_info != NULL)
  521.         {
  522.             mmi_frm_unhide_menu_item(MENU_ID_JMMS_SENT_OPTIONS_SAVE_OBJECTS);
  523.         }
  524.         else
  525.         {
  526.             mmi_frm_hide_menu_item(MENU_ID_JMMS_SENT_OPTIONS_SAVE_OBJECTS);
  527.             num_item--;
  528.         }
  529.     }
  530.     else
  531.     {
  532.         mmi_frm_hide_menu_item(MENU_ID_JMMS_SENT_OPTIONS_SAVE_OBJECTS);
  533.         num_item--;
  534.     }
  535. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  536.     GetSequenceStringIds_Ext(MENU_ID_JMMS_SENT_OPTIONS, str_item_list);
  537.     SetParentHandler(MENU_ID_JMMS_SENT_OPTIONS);
  538.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  539.     mmi_jmms_reset_fw_flag_of_message();
  540. #ifndef __MMI_UNIFIED_MESSAGE__
  541.     /* set the open msg status- for At delete */
  542.     g_jmms_context->msg_open_status[0] = E_JMMS_SENT;
  543.     //PMT HIMANSHU START 20060425
  544.     //      g_jmms_context->msg_open_status[1]=(U16)(g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
  545.     g_jmms_context->msg_open_status[1] =
  546.         (U32) mmi_jmms_get_message_id(
  547.                 MMI_JMMS_SENT,
  548.                 (g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index));
  549.     /* PMT HIMANSHU END 20060425 */
  550. #endif
  551.     ShowCategory52Screen(
  552.         STR_GLOBAL_OPTIONS,
  553.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  554.         STR_GLOBAL_OK,
  555.         IMG_GLOBAL_OK,
  556.         STR_GLOBAL_BACK,
  557.         IMG_GLOBAL_BACK,
  558.         num_item,
  559.         str_item_list,
  560.         (U16*) gIndexIconsImageList,
  561.         NULL,
  562.         0,
  563.         0,
  564.         gui_buffer);
  565.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  566.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  567. }
  568. /*****************************************************************************
  569.  * FUNCTION
  570.  *  mmi_jmms_highlight_sent_options_view
  571.  * DESCRIPTION
  572.  *  Highlight hdlr for sent option view
  573.  * PARAMETERS
  574.  *  void
  575.  * RETURNS
  576.  *  void
  577.  *****************************************************************************/
  578. void mmi_jmms_highlight_sent_options_view(void)
  579. {
  580.     /*----------------------------------------------------------------*/
  581.     /* Local Variables                                                */
  582.     /*----------------------------------------------------------------*/
  583.     /*----------------------------------------------------------------*/
  584.     /* Code Body                                                      */
  585.     /*----------------------------------------------------------------*/
  586.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  587. #ifdef __MMI_UNIFIED_MESSAGE__
  588. SetLeftSoftkeyFunction(mmi_jmms_pre_entry_view, KEY_EVENT_UP);
  589. SetKeyHandler(mmi_jmms_pre_entry_view, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  590.     SetKeyHandler(mmi_jmms_pre_entry_view, KEY_WAP, KEY_EVENT_DOWN);
  591. #else
  592. SetLeftSoftkeyFunction(mmi_jmms_sent_view, KEY_EVENT_UP);
  593. /* MAUI_00018463 Start */
  594.    // SetKeyHandler(mmi_jmms_sent_view, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  595. /* MAUI_00018463 End */
  596.     SetKeyHandler(mmi_jmms_sent_view, KEY_WAP, KEY_EVENT_DOWN); 
  597. #endif
  598. }
  599. #ifndef __MMI_UNIFIED_MESSAGE__
  600. /*****************************************************************************
  601.  * FUNCTION
  602.  *  mmi_jmms_highlight_sent_options_sent_to_others
  603.  * DESCRIPTION
  604.  *  Highlight hdlr for sent option sent to others
  605.  * PARAMETERS
  606.  *  void
  607.  * RETURNS
  608.  *  void
  609.  *****************************************************************************/
  610. void mmi_jmms_highlight_sent_options_sent_to_others(void)
  611. {
  612.     /*----------------------------------------------------------------*/
  613.     /* Local Variables                                                */
  614.     /*----------------------------------------------------------------*/
  615.     /*----------------------------------------------------------------*/
  616.     /* Code Body                                                      */
  617.     /*----------------------------------------------------------------*/
  618.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  619.     SetLeftSoftkeyFunction(mmi_jmms_sent_sent_to_others, KEY_EVENT_UP);
  620.     SetKeyHandler(mmi_jmms_sent_sent_to_others, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  621.     SetKeyHandler(mmi_jmms_sent_sent_to_others, KEY_WAP, KEY_EVENT_DOWN);
  622. }
  623. /*****************************************************************************
  624.  * FUNCTION
  625.  *  mmi_jmms_highlight_sent_options_move_to_drafts
  626.  * DESCRIPTION
  627.  *  Highlight hdlr for sent option move to drafts
  628.  * PARAMETERS
  629.  *  void
  630.  * RETURNS
  631.  *  void
  632.  *****************************************************************************/
  633. void mmi_jmms_highlight_sent_options_move_to_drafts(void)
  634. {
  635.     /*----------------------------------------------------------------*/
  636.     /* Local Variables                                                */
  637.     /*----------------------------------------------------------------*/
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  642.     SetLeftSoftkeyFunction(mmi_jmms_sent_move_to_drafts, KEY_EVENT_UP);
  643.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  644.     SetKeyHandler(mmi_jmms_sent_move_to_drafts, KEY_WAP, KEY_EVENT_DOWN);
  645. }
  646. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  647. /*****************************************************************************
  648.  * FUNCTION
  649.  *  mmi_jmms_highlight_sent_options_delete
  650.  * DESCRIPTION
  651.  *  Highlight hdlr for sent option delete
  652.  * PARAMETERS
  653.  *  void
  654.  * RETURNS
  655.  *  void
  656.  *****************************************************************************/
  657. void mmi_jmms_highlight_sent_options_delete(void)
  658. {
  659.     /*----------------------------------------------------------------*/
  660.     /* Local Variables                                                */
  661.     /*----------------------------------------------------------------*/
  662.     /*----------------------------------------------------------------*/
  663.     /* Code Body                                                      */
  664.     /*----------------------------------------------------------------*/
  665.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  666.     SetLeftSoftkeyFunction(mmi_jmms_sent_pre_delete, KEY_EVENT_UP);
  667.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  668.     SetKeyHandler(mmi_jmms_sent_pre_delete, KEY_WAP, KEY_EVENT_DOWN);
  669. }
  670. /*****************************************************************************
  671.  * FUNCTION
  672.  *  mmi_jmms_highlight_sent_options_delete_all
  673.  * DESCRIPTION
  674.  *  Highlight hdlr for sent option delete all
  675.  * PARAMETERS
  676.  *  void
  677.  * RETURNS
  678.  *  void
  679.  *****************************************************************************/
  680. void mmi_jmms_highlight_sent_options_delete_all(void)
  681. {
  682.     /*----------------------------------------------------------------*/
  683.     /* Local Variables                                                */
  684.     /*----------------------------------------------------------------*/
  685.     /*----------------------------------------------------------------*/
  686.     /* Code Body                                                      */
  687.     /*----------------------------------------------------------------*/
  688.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  689.     SetLeftSoftkeyFunction(mmi_jmms_sent_delete_all, KEY_EVENT_UP);
  690.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  691.     SetKeyHandler(mmi_jmms_sent_delete_all, KEY_WAP, KEY_EVENT_DOWN);
  692. }
  693. /*****************************************************************************
  694.  * FUNCTION
  695.  *  mmi_jmms_highlight_sent_options_use_details
  696.  * DESCRIPTION
  697.  *  Highlight hdlr for sent option use details
  698.  * PARAMETERS
  699.  *  void
  700.  * RETURNS
  701.  *  void
  702.  *****************************************************************************/
  703. #ifndef __MMI_UNIFIED_MESSAGE__
  704. void mmi_jmms_highlight_sent_options_use_details(void)
  705. #else 
  706. void mmi_jmms_highlight_sent_options_use_number(void)
  707. #endif 
  708. {
  709.     /*----------------------------------------------------------------*/
  710.     /* Local Variables                                                */
  711.     /*----------------------------------------------------------------*/
  712.     /*----------------------------------------------------------------*/
  713.     /* Code Body                                                      */
  714.     /*----------------------------------------------------------------*/
  715.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  716.     SetLeftSoftkeyFunction(mmi_jmms_sent_use_details, KEY_EVENT_UP);
  717.     SetKeyHandler(mmi_jmms_sent_use_details, KEY_SEND, KEY_EVENT_UP);
  718.     SetKeyHandler(mmi_jmms_sent_use_details, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  719.     SetKeyHandler(mmi_jmms_sent_use_details, KEY_WAP, KEY_EVENT_DOWN);
  720. }
  721. /*****************************************************************************
  722.  * FUNCTION
  723.  *  mmi_jmms_highlight_sent_options_properties
  724.  * DESCRIPTION
  725.  *  Highlight hdlr for sent option properties
  726.  * PARAMETERS
  727.  *  void
  728.  * RETURNS
  729.  *  void
  730.  *****************************************************************************/
  731. void mmi_jmms_highlight_sent_options_properties(void)
  732. {
  733.     /*----------------------------------------------------------------*/
  734.     /* Local Variables                                                */
  735.     /*----------------------------------------------------------------*/
  736.     /*----------------------------------------------------------------*/
  737.     /* Code Body                                                      */
  738.     /*----------------------------------------------------------------*/
  739.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  740.     SetLeftSoftkeyFunction(mmi_jmms_sent_properties, KEY_EVENT_UP);
  741.     SetKeyHandler(mmi_jmms_sent_properties, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  742.     SetKeyHandler(mmi_jmms_sent_properties, KEY_WAP, KEY_EVENT_DOWN);
  743. }
  744. /*****************************************************************************
  745.  * FUNCTION
  746.  *  mmi_jmms_sent_view
  747.  * DESCRIPTION
  748.  *  
  749.  * PARAMETERS
  750.  *  void
  751.  * RETURNS
  752.  *  void
  753.  *****************************************************************************/
  754. void mmi_jmms_sent_view(void)
  755. {
  756.     /*----------------------------------------------------------------*/
  757.     /* Local Variables                                                */
  758.     /*----------------------------------------------------------------*/
  759.     JC_RETCODE eRet = JC_OK;
  760.     CONTENT_DATA Content = {0, };
  761.     U8 msg_index = 0;
  762.     /*----------------------------------------------------------------*/
  763.     /* Code Body                                                      */
  764.     /*----------------------------------------------------------------*/
  765.     msg_index = g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index;
  766.     Content.bIsStream = E_TRUE;
  767.     eRet = mmi_jmms_get_message("Sent", &Content, (msg_index));
  768.     if (eRet != JC_OK)
  769.     {
  770.         goto END;
  771.     }
  772.     mmi_jmms_deinit_mms_context(g_jmms_context);
  773.     #ifdef __MMI_UNIFIED_MESSAGE__
  774. mmi_jmms_deinit_view();
  775.     #endif 
  776.     eRet = mmi_jmms_pre_entry_mms_view(&Content);
  777.     if (eRet == JC_ERR_MMS_PARSE_PENDING)
  778.     {
  779.         return;
  780.     }
  781.   END:
  782.     if (eRet != JC_OK)
  783.     {
  784.         DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  785.     }
  786. }
  787. #ifndef __MMI_UNIFIED_MESSAGE__
  788. /*****************************************************************************
  789.  * FUNCTION
  790.  *  mmi_jmms_sent_sent_to_others
  791.  * DESCRIPTION
  792.  *  
  793.  * PARAMETERS
  794.  *  void
  795.  * RETURNS
  796.  *  void
  797.  *****************************************************************************/
  798. void mmi_jmms_sent_sent_to_others(void)
  799. {
  800.     /*----------------------------------------------------------------*/
  801.     /* Local Variables                                                */
  802.     /*----------------------------------------------------------------*/
  803.     /* CONTENT_DATA Content = {0, }; */
  804.     JC_RETCODE eRet = JC_OK;
  805.     JC_INT32 index = 0;
  806.     /*----------------------------------------------------------------*/
  807.     /* Code Body                                                      */
  808.     /*----------------------------------------------------------------*/
  809.     mmi_jmms_deinit_mms_context(g_jmms_context);
  810.     if (g_jmms_context->pParseContent == NULL)
  811.     {
  812.         g_jmms_context->pParseContent = (CONTENT_DATA*) jdd_MemAlloc(sizeof(CONTENT_DATA), 1);
  813.     }
  814.     g_jmms_context->pParseContent->bIsStream = E_TRUE;
  815.     index =
  816.         (JC_INT32) (g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
  817.     eRet = mmi_jmms_get_message("Sent", g_jmms_context->pParseContent, index);
  818.     if (eRet != JC_OK)
  819.     {
  820.         mmi_jmms_error_handler(eRet);
  821.         goto END;
  822.     }
  823.     mmi_jmms_parsing_progressing_screen();
  824.     eRet = mmi_jmms_jdi_parse_msg_buffer(&g_jmms_context->msg_handle, g_jmms_context->pParseContent, E_TYPE_MMS, E_TRUE);
  825.     /*  */
  826.     if (eRet == JC_ERR_MMS_PARSE_PENDING)
  827.     {
  828.         mmi_jmms_parse_continue_start_timer(g_jmms_context->msg_handle, mmi_jmms_sent_sent_to_others_async_callback, mmi_jmms_only_abort_parsing_progress);
  829.         return;
  830.     };
  831.     /*  */
  832.     mmi_jmms_sent_sent_to_others_async_callback(eRet);
  833.     return;
  834.   END:
  835.     if (g_jmms_context->pParseContent != NULL)
  836.     {
  837.         if (g_jmms_context->pParseContent->pFileName != NULL)
  838.         {
  839.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  840.         }
  841.         jdd_MemFree(g_jmms_context->pParseContent);
  842.         g_jmms_context->pParseContent = NULL;
  843.     }
  844.     if (eRet != JC_OK)
  845.     {
  846.         if (g_jmms_context->msg_handle != NULL)
  847.         {
  848.             mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  849.             g_jmms_context->msg_handle = NULL;
  850.         }
  851.     }
  852.     g_jmms_context->is_add_media_warning = 0;
  853. }
  854. /*****************************************************************************
  855.  * FUNCTION
  856.  *  mmi_jmms_sent_sent_to_others_async_callback
  857.  * DESCRIPTION
  858.  *  
  859.  * PARAMETERS
  860.  *  eRet        [IN]        
  861.  * RETURNS
  862.  *  void
  863.  *****************************************************************************/
  864. void mmi_jmms_sent_sent_to_others_async_callback(JC_RETCODE eRet)
  865. {
  866.     /*----------------------------------------------------------------*/
  867.     /* Local Variables                                                */
  868.     /*----------------------------------------------------------------*/
  869.     MESSAGE_HEADERS *pMsgHeaders = NULL;
  870.     MESSAGE_SEND *send_p;
  871.     S32 len = 0;
  872.     JC_RETCODE eRet_restricted = JC_OK;
  873.     /*----------------------------------------------------------------*/
  874.     /* Code Body                                                      */
  875.     /*----------------------------------------------------------------*/
  876.     if (JC_OK != eRet)
  877.     {
  878.         if (GetActiveScreenId() == SCR_ID_JMMS_PARSING_PROGRESS)
  879.         {
  880.             mmi_jmms_error_handler(eRet);
  881.         }
  882.         goto END;
  883.     }
  884.     eRet = mmi_jmms_jdi_msg_register_callback(g_jmms_context->msg_handle, E_CB_ERROR_IND, (void*)mmi_jmms_error_ind_cb);
  885.     if (eRet != JC_OK)
  886.     {
  887.         mmi_jmms_error_handler(eRet);
  888.         goto END;
  889.     }
  890.     eRet = mmi_jmms_jdi_set_content_class(g_jmms_context->msg_handle, MMS_SUPPORTED_CONTENT_CLASS);
  891.     if (eRet != JC_OK)
  892.     {
  893.         mmi_jmms_error_handler(eRet);
  894.         goto END;
  895.     }
  896.     eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, mmi_jmms_compose_settings_creation_mode());
  897.     if (eRet != JC_OK)
  898.     {
  899.         /********************************************************************
  900.            These lines are added to ask a query if the message contains the 
  901.            invalid media in restricted mode.
  902.             Written By  : RAJ KUMAR GUPTA
  903.             Date        : Augest 08, 2006
  904.          *******************************************************************/
  905.         if (JC_ERR_MSG_MMS_CONTENT_RESTRICTED == eRet)
  906.         {
  907.             eRet_restricted = JC_ERR_MSG_MMS_CONTENT_RESTRICTED;
  908.         }
  909.         else
  910.         {
  911.             mmi_jmms_error_handler(eRet);
  912.             goto END;
  913.         }
  914.         /*******************************************************************/
  915.     }
  916.     eRet = mmi_jmms_jdi_set_msg_type(g_jmms_context->msg_handle, E_TYPE_MMS);
  917.     if (eRet != JC_OK)
  918.     {
  919.         mmi_jmms_error_handler(eRet);
  920.         goto END;
  921.     }
  922.     eRet = mmi_jmms_jdi_set_presentation_type(g_jmms_context->msg_handle, E_PRESENTATION_SMIL);
  923.     if (eRet != JC_OK)
  924.     {
  925.         mmi_jmms_error_handler(eRet);
  926.         goto END;
  927.     }
  928.     eRet = mmi_jmms_jdi_set_max_pages(g_jmms_context->msg_handle, (U8) mmi_jmms_compose_settings_max_no_pages());
  929.     if (eRet != JC_OK)
  930.     {
  931.         mmi_jmms_error_handler(eRet);
  932.         goto END;
  933.     }
  934.     eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
  935.     if (eRet != JC_OK || pMsgHeaders == NULL)
  936.     {
  937.         eRet = JC_ERR_STORE_FILE_CORRUPTED;
  938.         mmi_jmms_error_handler(eRet);
  939.         goto END;
  940.     }
  941.     if (pMsgHeaders->eMsgType != E_MSG_TYPE_SEND)
  942.     {
  943.         DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  944.         goto END;
  945.     }
  946.     send_p = (MESSAGE_SEND*) (pMsgHeaders->pHeaders);
  947.     mmi_jmms_free_addresses_list();
  948.     /* /Make the subject buffer */
  949.     memset(g_jmms_context->subject_input_buffer, 0x00, (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH);
  950.     if (send_p->pSubject != NULL)
  951.     {
  952.         len = (pfnUnicodeStrlen((S8*) (send_p->pSubject))) * ENCODING_LENGTH;
  953.         if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
  954.         {
  955.             memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, (MAX_SUBJECT_LENGTH * ENCODING_LENGTH));
  956.         }
  957.         else
  958.         {
  959.             memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, len);
  960.         }
  961.     }
  962.     g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_DONE;
  963. //    g_jmms_context->g_use_local_send_setings = 0;
  964. /* MAUI_00227929 Start */
  965. g_jmms_context->g_use_local_send_setings = 1;
  966. mmi_jmms_fill_mms_sending_settings();        
  967. /* MAUI_00227929 End */
  968.     if (g_jmms_context->is_add_media_warning == 0)
  969.     {
  970.         if (eRet_restricted == JC_ERR_MSG_MMS_CONTENT_RESTRICTED)
  971.         {
  972.             mmi_jmms_edit_content_restricted_mode_query();
  973.         }
  974.         else
  975.         {
  976.             mmi_jmms_entry_write_message_screen();
  977.         }
  978.     }
  979.     else
  980.     {
  981.         DisplayPopupCallBack(
  982.             (PU8) GetString(STR_ID_JMMS_MMS_ERR_WARNING_CONTENT_CLASS),
  983.             IMG_GLOBAL_WARNING,
  984.             1,
  985.             JMMS_POPUP_TIME,
  986.             WARNING_TONE,
  987.             mmi_jmms_entry_write_message_screen);
  988.     }
  989.   END:
  990.     if (g_jmms_context->pParseContent != NULL)
  991.     {
  992.         if (g_jmms_context->pParseContent->pFileName != NULL)
  993.         {
  994.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  995.         }
  996.         jdd_MemFree(g_jmms_context->pParseContent);
  997.         g_jmms_context->pParseContent = NULL;
  998.     }
  999.     if (eRet != JC_OK)
  1000.     {
  1001.         if (g_jmms_context->msg_handle != NULL)
  1002.         {
  1003.             mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1004.             g_jmms_context->msg_handle = NULL;
  1005.         }
  1006.     }
  1007.     g_jmms_context->is_add_media_warning = 0;
  1008.     DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
  1009.     return;
  1010. }
  1011. /*****************************************************************************
  1012.  * FUNCTION
  1013.  *  mmi_jmms_sent_move_to_drafts
  1014.  * DESCRIPTION
  1015.  *  
  1016.  * PARAMETERS
  1017.  *  void
  1018.  * RETURNS
  1019.  *  void
  1020.  *****************************************************************************/
  1021. void mmi_jmms_sent_move_to_drafts(void)
  1022. {
  1023.     /*----------------------------------------------------------------*/
  1024.     /* Local Variables                                                */
  1025.     /*----------------------------------------------------------------*/
  1026.     JC_UINT32 index = 0;
  1027.     JC_RETCODE eRet = JC_OK;
  1028.     /*----------------------------------------------------------------*/
  1029.     /* Code Body                                                      */
  1030.     /*----------------------------------------------------------------*/
  1031.     index =
  1032.         (JC_INT32) (g_jmms_context->store_context->nMsgs_in_Current_folder - g_jmms_context->nCurr_scr_hilited_index);
  1033.     eRet = mmi_jmms_store_move_message("Sent", "Drafts", &index);
  1034.     if (eRet == JC_OK)
  1035.     {
  1036.         HistoryReplace(SCR_ID_JMMS_SENT, SCR_ID_JMMS_SENT, mmi_jmms_entry_sent);
  1037.         if (g_jmms_context->store_context->nMsgs_in_Current_folder <= 1)        /* /now folder will empty */
  1038.         {
  1039.             GoBackToHistory(SCR_ID_JMMS_MAIN_MENU);
  1040.         }
  1041.         else
  1042.         {
  1043.             GoBackToHistory(SCR_ID_JMMS_SENT);
  1044.         }
  1045.     }
  1046.     else
  1047.     {
  1048.         DisplayPopup(
  1049.             (U8*) GetString(STR_ID_JMMS_ERROR_MMS_MOVE),
  1050.             IMG_GLOBAL_ERROR,
  1051.             1,
  1052.             JMMS_POPUP_TIME,
  1053.             (U8) ERROR_TONE);
  1054.         DeleteUptoScrID(SCR_ID_JMMS_SENT);
  1055.     }
  1056. }
  1057. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  1058. /*****************************************************************************
  1059.  * FUNCTION
  1060.  *  mmi_jmms_sent_pre_delete
  1061.  * DESCRIPTION
  1062.  *  
  1063.  * PARAMETERS
  1064.  *  void
  1065.  * RETURNS
  1066.  *  void
  1067.  *****************************************************************************/
  1068. void mmi_jmms_sent_pre_delete(void)
  1069. {
  1070.     /*----------------------------------------------------------------*/
  1071.     /* Local Variables                                                */
  1072.     /*----------------------------------------------------------------*/
  1073.     /*----------------------------------------------------------------*/
  1074.     /* Code Body                                                      */
  1075.     /*----------------------------------------------------------------*/
  1076.     DisplayConfirm(
  1077.         STR_GLOBAL_YES,
  1078.         IMG_GLOBAL_YES,
  1079.         STR_GLOBAL_NO,
  1080.         IMG_GLOBAL_NO,
  1081.         get_string(STR_GLOBAL_DELETE),
  1082.         IMG_GLOBAL_QUESTION,
  1083.         WARNING_TONE);
  1084.     SetLeftSoftkeyFunction(mmi_jmms_sent_delete, KEY_EVENT_UP);
  1085.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1086. }
  1087. /*****************************************************************************
  1088.  * FUNCTION
  1089.  *  mmi_jmms_post_sent_delete_message
  1090.  * DESCRIPTION
  1091.  *  
  1092.  * PARAMETERS
  1093.  *  void
  1094.  * RETURNS
  1095.  *  void
  1096.  *****************************************************************************/
  1097. void mmi_jmms_post_sent_delete_message(void)
  1098. {
  1099.     U8 number = 0;
  1100.     /*----------------------------------------------------------------*/
  1101.     /* Code Body                                                      */
  1102.     /*----------------------------------------------------------------*/
  1103.     number = g_jmms_context->store_context->nMsgs_in_Current_folder;
  1104. #ifdef __MMI_UNIFIED_MESSAGE__
  1105.          DeleteUptoScrID(SCR_ID_UM_MAIN);
  1106.         mmi_um_jmms_pre_entry_sent();
  1107. #else /* __MMI_UNIFIED_MESSAGE__ */ 
  1108.         HistoryReplace(SCR_ID_JMMS_SENT, SCR_ID_JMMS_SENT, mmi_jmms_entry_sent);
  1109.         if (number <= 1)    /* /now folder will empty */
  1110.         {
  1111.             GoBackToHistory(SCR_ID_JMMS_MAIN_MENU);
  1112.         }
  1113.         else
  1114.         {
  1115.             GoBackToHistory(SCR_ID_JMMS_SENT);
  1116.         }
  1117. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  1118. }
  1119. /*****************************************************************************
  1120.  * FUNCTION
  1121.  *  mmi_jmms_sent_delete
  1122.  * DESCRIPTION
  1123.  *  
  1124.  * PARAMETERS
  1125.  *  void
  1126.  * RETURNS
  1127.  *  void
  1128.  *****************************************************************************/
  1129. void mmi_jmms_sent_delete(void)
  1130. {
  1131.     /*----------------------------------------------------------------*/
  1132.     /* Local Variables                                                */
  1133.     /*----------------------------------------------------------------*/
  1134.     U8 number = 0;
  1135.     JC_RETCODE eRet = JC_OK;
  1136.     /*----------------------------------------------------------------*/
  1137.     /* Code Body                                                      */
  1138.     /*----------------------------------------------------------------*/
  1139.     /* mmi_mms_get_number_of_messages(MMI_JMMS_INBOX, &number); */
  1140.     number = g_jmms_context->store_context->nMsgs_in_Current_folder;
  1141.     mmi_jmms_delete_progresing_screen(STR_ID_JMMS_SENT, IMG_GLOBAL_DELETED);
  1142.     eRet = mmi_jmms_delete_message(MMI_JMMS_SENT, (number - g_jmms_context->nCurr_scr_hilited_index));
  1143.     if (eRet == JC_OK)
  1144.     {
  1145.        DisplayPopupCallBack((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE, mmi_jmms_post_sent_delete_message);
  1146.     }
  1147.     else
  1148.     {
  1149.         DisplayPopup(
  1150.             (U8*) GetString(STR_ID_JMMS_ERROR_MMS_DELETE),
  1151.             IMG_GLOBAL_ERROR,
  1152.             1,
  1153.             JMMS_POPUP_TIME,
  1154.             (U8) ERROR_TONE);
  1155.     #ifdef __MMI_UNIFIED_MESSAGE__
  1156.         DeleteUptoScrID(SCR_ID_UM_SENT);
  1157.     #else 
  1158.         DeleteUptoScrID(SCR_ID_JMMS_SENT);
  1159.     #endif 
  1160.     }
  1161. }
  1162. /*****************************************************************************
  1163.  * FUNCTION
  1164.  *  mmi_jmms_sent_delete_all
  1165.  * DESCRIPTION
  1166.  *  
  1167.  * PARAMETERS
  1168.  *  void
  1169.  * RETURNS
  1170.  *  void
  1171.  *****************************************************************************/
  1172. void mmi_jmms_sent_delete_all(void)
  1173. {
  1174.     /*----------------------------------------------------------------*/
  1175.     /* Local Variables                                                */
  1176.     /*----------------------------------------------------------------*/
  1177.     /*----------------------------------------------------------------*/
  1178.     /* Code Body                                                      */
  1179.     /*----------------------------------------------------------------*/
  1180.     
  1181. #ifdef __MMI_UNIFIED_MESSAGE__
  1182.     /*Dilip 29 Aug 2006 */
  1183.     DisplayConfirm(
  1184.         STR_GLOBAL_YES,
  1185.         IMG_GLOBAL_YES,
  1186.         STR_GLOBAL_NO,
  1187.         IMG_GLOBAL_NO,
  1188.         get_string(STR_ID_JMMS_DELETE_ALL_UM_SENT),
  1189.         IMG_GLOBAL_QUESTION,
  1190.         WARNING_TONE);
  1191.     /*Dilip 29 Aug 2006 */
  1192.     SetLeftSoftkeyFunction(mmi_um_jmms_delete_all, KEY_EVENT_UP);
  1193. #else 
  1194.     /*Dilip 29 Aug 2006 */
  1195.     DisplayConfirm(
  1196.         STR_GLOBAL_YES,
  1197.         IMG_GLOBAL_YES,
  1198.         STR_GLOBAL_NO,
  1199.         IMG_GLOBAL_NO,
  1200. /* MAUI_00018477 Start */
  1201.         get_string(STR_ID_JMMS_DELETE_ALL_UM_SENT),
  1202. /* MAUI_00018477 End */
  1203.         IMG_GLOBAL_QUESTION,
  1204.         WARNING_TONE);
  1205.     /*Dilip 29 Aug 2006 */
  1206.     SetLeftSoftkeyFunction(mmi_jmms_delete_all_message_sent, KEY_EVENT_UP);
  1207. #endif 
  1208.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1209. }
  1210. /*****************************************************************************
  1211.  * FUNCTION
  1212.  *  mmi_jmms_delete_all_message_sent
  1213.  * DESCRIPTION
  1214.  *  Pre entry fn for sent use details option
  1215.  * PARAMETERS
  1216.  *  void
  1217.  * RETURNS
  1218.  *  void
  1219.  *****************************************************************************/
  1220. void mmi_jmms_delete_all_message_sent(void)
  1221. {
  1222.     /*----------------------------------------------------------------*/
  1223.     /* Local Variables                                                */
  1224.     /*----------------------------------------------------------------*/
  1225.     JC_RETCODE eRet = JC_OK;
  1226.     /*----------------------------------------------------------------*/
  1227.     /* Code Body                                                      */
  1228.     /*----------------------------------------------------------------*/
  1229.     mmi_jmms_delete_progresing_screen(STR_ID_JMMS_SENT, IMG_GLOBAL_PROGRESS);
  1230.     eRet = mmi_jmms_delete_all_message(MMI_JMMS_SENT);
  1231.     if (JC_OK != eRet)
  1232.     {
  1233.         DisplayPopup(
  1234.             (U8*) GetString(STR_ID_JMMS_ERROR_MMS_DELETE),
  1235.             IMG_GLOBAL_ERROR,
  1236.             1,
  1237.             JMMS_POPUP_TIME,
  1238.             (U8) ERROR_TONE);
  1239.         DeleteUptoScrID(SCR_ID_JMMS_SENT);
  1240.     }
  1241.     else
  1242.     {
  1243.         DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
  1244.         DeleteUptoScrID(SCR_ID_JMMS_MAIN_MENU);
  1245.         mmi_jmms_free_msgs_list(&(g_jmms_context->store_context->messages_list));
  1246.     }
  1247. }
  1248. /*****************************************************************************
  1249.  * FUNCTION
  1250.  *  mmi_jmms_sent_use_details
  1251.  * DESCRIPTION
  1252.  *  
  1253.  * PARAMETERS
  1254.  *  void
  1255.  * RETURNS
  1256.  *  void
  1257.  *****************************************************************************/
  1258. void mmi_jmms_sent_use_details(void)
  1259. {
  1260.     /*----------------------------------------------------------------*/
  1261.     /* Local Variables                                                */
  1262.     /*----------------------------------------------------------------*/
  1263.     /*----------------------------------------------------------------*/
  1264.     /* Code Body                                                      */
  1265.     /*----------------------------------------------------------------*/
  1266.     mmi_jmms_pre_entry_use_details_screen(MMI_JMMS_SENT);
  1267. }
  1268. /*****************************************************************************
  1269.  * FUNCTION
  1270.  *  mmi_jmms_sent_properties
  1271.  * DESCRIPTION
  1272.  *  
  1273.  * PARAMETERS
  1274.  *  void
  1275.  * RETURNS
  1276.  *  void
  1277.  *****************************************************************************/
  1278. void mmi_jmms_sent_properties(void)
  1279. {
  1280.     /*----------------------------------------------------------------*/
  1281.     /* Local Variables                                                */
  1282.     /*----------------------------------------------------------------*/
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Code Body                                                      */
  1285.     /*----------------------------------------------------------------*/
  1286.     mmi_jmms_show_mms_properties(E_MSG_NEW_MMS_SEND, MMI_JMMS_SENT);
  1287. }
  1288. #ifdef __MMI_UNIFIED_MESSAGE__
  1289. /*****************************************************************************
  1290.  * FUNCTION
  1291.  *  mmi_jmms_highlight_sent_options_edit_message
  1292.  * DESCRIPTION
  1293.  *  
  1294.  * PARAMETERS
  1295.  *  void
  1296.  * RETURNS
  1297.  *  void
  1298.  *****************************************************************************/
  1299. void mmi_jmms_highlight_sent_options_edit_message(void)
  1300. {
  1301.     /*----------------------------------------------------------------*/
  1302.     /* Local Variables                                                */
  1303.     /*----------------------------------------------------------------*/
  1304.     /*----------------------------------------------------------------*/
  1305.     /* Code Body                                                      */
  1306.     /*----------------------------------------------------------------*/
  1307.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1308.     SetLeftSoftkeyFunction(mmi_jmms_pre_sent_edit_message, KEY_EVENT_UP);
  1309.     SetKeyHandler(mmi_jmms_pre_sent_edit_message, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1310.     SetKeyHandler(mmi_jmms_pre_sent_edit_message, KEY_WAP, KEY_EVENT_DOWN);
  1311. }
  1312. /*****************************************************************************
  1313.  * FUNCTION
  1314.  *  mmi_jmms_pre_sent_edit_message
  1315.  * DESCRIPTION
  1316.  *  
  1317.  * PARAMETERS
  1318.  *  void
  1319.  * RETURNS
  1320.  *  void
  1321.  *****************************************************************************/
  1322. void mmi_jmms_pre_sent_edit_message(void)
  1323. {
  1324.     /*----------------------------------------------------------------*/
  1325.     /* Local Variables                                                */
  1326.     /*----------------------------------------------------------------*/
  1327.     /*----------------------------------------------------------------*/
  1328.     /* Code Body                                                      */
  1329.     /*----------------------------------------------------------------*/
  1330. #ifdef __MMI_UNIFIED_MESSAGE__
  1331. U8 curr_page = 0;
  1332. if(g_jmms_context->msg_handle)
  1333.     mmi_jmms_jdi_get_current_page_index(g_jmms_context->msg_handle, &curr_page);
  1334. g_jmms_context->edit_error_code=JC_OK;
  1335. #endif
  1336. #ifdef __DRM_SUPPORT__
  1337.     if (mmi_jmms_is_drm_fwd_lock_media_in_mms(g_jmms_context->msg_handle, E_TRUE) == E_TRUE)
  1338.     {
  1339.        return;
  1340.     }
  1341. #endif    
  1342.     g_jmms_context->g_use_local_send_setings = 1;  // sanjeev    5/1/07
  1343.     mmi_jmms_edit_message(MMI_JMMS_SENT);
  1344. #ifdef __MMI_UNIFIED_MESSAGE__
  1345. if(g_jmms_context->edit_error_code!=JC_OK && curr_page>1 && g_jmms_context->msg_handle)
  1346. {
  1347. gui_lock_double_buffer();
  1348. mmi_jmms_jdi_view_event(g_jmms_context->msg_handle, E_VIEW_SET_ACTIVE_SLIDE, &curr_page);
  1349. gui_unlock_double_buffer();
  1350. }
  1351. #endif
  1352. }
  1353. /*****************************************************************************
  1354.  * FUNCTION
  1355.  *  mmi_jmms_highlight_sent_options_save_object
  1356.  * DESCRIPTION
  1357.  *  
  1358.  * PARAMETERS
  1359.  *  void
  1360.  * RETURNS
  1361.  *  void
  1362.  *****************************************************************************/
  1363. void mmi_jmms_highlight_sent_options_save_object(void)
  1364. {
  1365.     /*----------------------------------------------------------------*/
  1366.     /* Local Variables                                                */
  1367.     /*----------------------------------------------------------------*/
  1368.     /*----------------------------------------------------------------*/
  1369.     /* Code Body                                                      */
  1370.     /*----------------------------------------------------------------*/
  1371.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1372.     SetLeftSoftkeyFunction(mmi_jmms_entry_save_object, KEY_EVENT_UP);
  1373.     SetKeyHandler(mmi_jmms_entry_save_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1374.     SetKeyHandler(mmi_jmms_entry_save_object, KEY_WAP, KEY_EVENT_DOWN);
  1375. }
  1376. /*****************************************************************************
  1377.  * FUNCTION
  1378.  *  mmi_jmms_highlight_sent_options_forward
  1379.  * DESCRIPTION
  1380.  *  highlight hdlr of view menu item in Inbox options
  1381.  * PARAMETERS
  1382.  *  void
  1383.  * RETURNS
  1384.  *  void
  1385.  *****************************************************************************/
  1386. void mmi_jmms_highlight_sent_options_forward(void)
  1387. {
  1388.     /*----------------------------------------------------------------*/
  1389.     /* Local Variables                                                */
  1390.     /*----------------------------------------------------------------*/
  1391.     /*----------------------------------------------------------------*/
  1392.     /* Code Body                                                      */
  1393.     /*----------------------------------------------------------------*/
  1394.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1395.     SetLeftSoftkeyFunction(mmi_jmms_sent_forward, KEY_EVENT_UP);
  1396.     SetKeyHandler(mmi_jmms_sent_forward, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1397.     SetKeyHandler(mmi_jmms_sent_forward, KEY_WAP, KEY_EVENT_DOWN);
  1398. }
  1399. /*****************************************************************************
  1400.  * FUNCTION
  1401.  *  mmi_jmms_sent_forward
  1402.  * DESCRIPTION
  1403.  *  
  1404.  * PARAMETERS
  1405.  *  void
  1406.  * RETURNS
  1407.  *  void
  1408.  *****************************************************************************/
  1409. extern void mmi_jmms_sent_forward_async_callback(JC_RETCODE eRet);
  1410. void mmi_jmms_sent_forward(void)
  1411. {
  1412.     /*----------------------------------------------------------------*/
  1413.     /* Local Variables                                                */
  1414.     /*----------------------------------------------------------------*/
  1415.     U8 number = 0;
  1416.     JC_RETCODE eRet = JC_OK;
  1417.     ECreationMode create_mode;
  1418.     /* CONTENT_DATA Content = {0, }; */
  1419. #ifndef __MMI_UNIFIED_MESSAGE__
  1420.       MSG_HANDLE hTempMsg = NULL;
  1421.   S32 len = 0;
  1422. #else
  1423.   U8 curr_page = 0;
  1424. #endif
  1425.     /*----------------------------------------------------------------*/
  1426.     /* Code Body                                                      */
  1427.     /*----------------------------------------------------------------*/
  1428.     number = g_jmms_context->store_context->nMsgs_in_Current_folder;
  1429. #ifndef __MMI_UNIFIED_MESSAGE__
  1430.     eRet = jdi_MsgInit(&hTempMsg, NULL);
  1431.     if (JC_OK != eRet)
  1432.     {
  1433.         mmi_jmms_error_handler(eRet);
  1434.         goto END;
  1435.     }
  1436.     if (g_jmms_context->pParseContent != NULL)
  1437.     {
  1438.         jdd_MemFree(g_jmms_context->pParseContent);
  1439.         g_jmms_context->pParseContent = NULL;
  1440.     }
  1441.     if (g_jmms_context->pParseContent == NULL)
  1442.     {
  1443.         g_jmms_context->pParseContent = (CONTENT_DATA*) jdd_MemAlloc(sizeof(CONTENT_DATA), 1);
  1444.     }
  1445.     g_jmms_context->pParseContent->bIsStream = E_TRUE;
  1446.     eRet = mmi_jmms_get_message(
  1447.             "Sent",
  1448.             g_jmms_context->pParseContent,
  1449.             (number - g_jmms_context->nCurr_scr_hilited_index));
  1450.     if (eRet != JC_OK)
  1451.     {
  1452.         mmi_jmms_error_handler(eRet);
  1453.         goto END;
  1454.     }
  1455.     if (g_jmms_context->msg_handle != NULL)
  1456.     {
  1457.         eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1458.         g_jmms_context->msg_handle = NULL;
  1459.     }
  1460.     mmi_jmms_parsing_progressing_screen();
  1461.     eRet = mmi_jmms_jdi_msg_forward(hTempMsg, g_jmms_context->pParseContent, &(g_jmms_context->msg_handle));
  1462.     if (hTempMsg != NULL)
  1463.     {
  1464.         mmi_jmms_jdi_msg_deinit(hTempMsg);
  1465.         hTempMsg = NULL;
  1466.     }
  1467.     if (eRet == JC_ERR_MMS_PARSE_PENDING)
  1468.     {
  1469.         mmi_jmms_parse_continue_start_timer(g_jmms_context->msg_handle, mmi_jmms_sent_forward_async_callback, mmi_jmms_only_abort_parsing_progress);
  1470.         return;
  1471.     }
  1472. #else
  1473.     create_mode = mmi_jmms_compose_settings_creation_mode();
  1474.     if(IsMMSRestrictedMode(g_jmms_context->msg_handle, MMS_SUPPORTED_CONTENT_CLASS) != JC_OK)
  1475.     {
  1476.         if(create_mode == E_CREATION_MODE_RESTRICTED)
  1477.         {
  1478.             DisplayPopup(
  1479.                 (PU8) GetString(STR_ID_JMMS_MMS_ERR_RESTRICTED_CONTENT_CLASS),
  1480.                 IMG_GLOBAL_ERROR,
  1481.                 1,
  1482.                 JMMS_POPUP_TIME,
  1483.                 ERROR_TONE);
  1484.             return;
  1485.         }
  1486.         else if(create_mode == E_CREATION_MODE_WARNING)
  1487.         {
  1488.             g_jmms_context->is_add_media_warning = 1;
  1489.         }
  1490. if(g_jmms_context->msg_handle)
  1491. {
  1492. mmi_jmms_jdi_get_current_page_index(g_jmms_context->msg_handle, &curr_page);
  1493. }
  1494. }
  1495. g_jmms_context->edit_error_code=JC_OK;
  1496. eRet= mmi_jmms_jdi_preforwardheader(&g_jmms_context->msg_handle); // Forward parsing
  1497. if(eRet != JC_OK)
  1498. {
  1499. mmi_jmms_error_handler(eRet);
  1500. if(curr_page>1 && g_jmms_context->msg_handle)
  1501. {
  1502. gui_lock_double_buffer();
  1503. mmi_jmms_restore_view_callbacks();
  1504. mmi_jmms_jdi_view_event(g_jmms_context->msg_handle, E_VIEW_SET_ACTIVE_SLIDE, &curr_page);
  1505. gui_unlock_double_buffer();
  1506. }
  1507. goto END;
  1508. }
  1509. #endif 
  1510.     
  1511.     mmi_jmms_sent_forward_async_callback(eRet);
  1512. #ifdef __MMI_UNIFIED_MESSAGE__
  1513. if(g_jmms_context->edit_error_code!=JC_OK && curr_page>1 && g_jmms_context->msg_handle)
  1514. {
  1515. gui_lock_double_buffer();
  1516. mmi_jmms_restore_view_callbacks();
  1517. mmi_jmms_jdi_view_event(g_jmms_context->msg_handle, E_VIEW_SET_ACTIVE_SLIDE, &curr_page);
  1518. gui_unlock_double_buffer();
  1519. }
  1520. #endif
  1521.     return;  
  1522. END:
  1523.     // TODO:: need to check whether this is to do or not
  1524. #ifndef __MMI_UNIFIED_MESSAGE__
  1525.     if (g_jmms_context->pParseContent != NULL)
  1526.     {
  1527.         if (g_jmms_context->pParseContent->pFileName != NULL)
  1528.         {
  1529.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  1530.         }
  1531.         jdd_MemFree(g_jmms_context->pParseContent);
  1532.         g_jmms_context->pParseContent = NULL;
  1533.     }
  1534.     if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
  1535.     {
  1536.         eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1537.         g_jmms_context->msg_handle = NULL;
  1538.     }
  1539. #endif 
  1540.     g_jmms_context->is_add_media_warning = 0;
  1541.     DeleteScreenIfPresent(SCR_ID_JMMS_PROGRESS);    /* sachin to ask */
  1542. }
  1543. /*****************************************************************************
  1544.  * FUNCTION
  1545.  *  mmi_jmms_sent_forward_async_callback
  1546.  * DESCRIPTION
  1547.  *  
  1548.  * PARAMETERS
  1549.  *  eRet        [IN]        
  1550.  * RETURNS
  1551.  *  void
  1552.  *****************************************************************************/
  1553. void mmi_jmms_sent_forward_async_callback(JC_RETCODE eRet)
  1554. {
  1555.     /*----------------------------------------------------------------*/
  1556.     /* Local Variables                                                */
  1557.     /*----------------------------------------------------------------*/
  1558.     MESSAGE_HEADERS *pMsgHeaders = NULL;
  1559.     MESSAGE_SEND *send_p = NULL;
  1560.     S32 len = 0;
  1561.     /*----------------------------------------------------------------*/
  1562.     /* Code Body                                                      */
  1563.     /*----------------------------------------------------------------*/
  1564.     if (eRet != JC_OK)
  1565.     {
  1566.         mmi_jmms_error_handler(eRet);
  1567.         goto END;
  1568.     }
  1569.     if (mmi_jmms_is_corrupted_video_media_in_mms(g_jmms_context->msg_handle) == E_TRUE)
  1570.     {
  1571.         eRet =-1;
  1572.         goto END;
  1573.     }
  1574.     eRet = mmi_jmms_jdi_msg_register_callback(g_jmms_context->msg_handle, E_CB_ERROR_IND, (void*)mmi_jmms_error_ind_cb);
  1575.     if (eRet != JC_OK)
  1576.     {
  1577.         mmi_jmms_error_handler(eRet);
  1578.         goto END;
  1579.     }
  1580.     eRet = mmi_jmms_jdi_set_content_class(g_jmms_context->msg_handle, E_MMS_CONTENT_CLASS_VIDEO_BASIC);
  1581.     if (eRet != JC_OK)
  1582.     {
  1583.         mmi_jmms_error_handler(eRet);
  1584.         goto END;
  1585.     }
  1586.     eRet = mmi_jmms_jdi_set_creation_mode(g_jmms_context->msg_handle, mmi_jmms_compose_settings_creation_mode());
  1587.     if (eRet != JC_OK)
  1588.     {
  1589.         mmi_jmms_error_handler(eRet);
  1590.         goto END;
  1591.     }
  1592.     eRet = mmi_jmms_jdi_set_msg_type(g_jmms_context->msg_handle, E_TYPE_MMS);
  1593.     if (eRet != JC_OK)
  1594.     {
  1595.         mmi_jmms_error_handler(eRet);
  1596.         goto END;
  1597.     }
  1598.     eRet = mmi_jmms_jdi_set_presentation_type(g_jmms_context->msg_handle, E_PRESENTATION_SMIL);
  1599.     if (eRet != JC_OK)
  1600.     {
  1601.         mmi_jmms_error_handler(eRet);
  1602.         goto END;
  1603.     }
  1604.     eRet = mmi_jmms_jdi_set_max_pages(g_jmms_context->msg_handle, (U8) mmi_jmms_compose_settings_max_no_pages());
  1605.     if (eRet != JC_OK)
  1606.     {
  1607.         mmi_jmms_error_handler(eRet);
  1608.         goto END;
  1609.     }
  1610.     eRet = mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
  1611.     if (eRet != JC_OK || pMsgHeaders == NULL)
  1612.     {
  1613.         eRet = JC_ERR_STORE_FILE_CORRUPTED;
  1614.         mmi_jmms_error_handler(eRet);
  1615.         goto END;
  1616.     }
  1617.     if (pMsgHeaders->eMsgType != E_MSG_TYPE_SEND)
  1618.     {
  1619.         DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  1620.         goto END;
  1621.     }
  1622.     send_p = (MESSAGE_SEND*) (pMsgHeaders->pHeaders);
  1623.     mmi_jmms_free_addresses_list();
  1624.     /* /Make the subject buffer */
  1625.     memset(g_jmms_context->subject_input_buffer, 0x00, (MAX_SUBJECT_LENGTH + 1) * ENCODING_LENGTH);
  1626.     if (send_p->pSubject != NULL)
  1627.     {
  1628.         len = (pfnUnicodeStrlen((S8*) (send_p->pSubject))) * ENCODING_LENGTH;
  1629.         if (len > (MAX_SUBJECT_LENGTH * ENCODING_LENGTH))
  1630.         {
  1631.             memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, (MAX_SUBJECT_LENGTH * ENCODING_LENGTH));
  1632.         }
  1633.         else
  1634.         {
  1635.             memcpy(g_jmms_context->subject_input_buffer, send_p->pSubject, len);
  1636.         }
  1637.     }
  1638.     g_jmms_context->g_write_mms_right_soft_key = STR_GLOBAL_DONE;
  1639.     /* PMT VIKAS START 20060405 */
  1640.     mmi_jmms_set_fw_flag_of_message();
  1641.     /* PMT VIKAS END 20060405 */
  1642. //    g_jmms_context->g_use_local_send_setings = 0;
  1643. /* MAUI_00227929 Start */
  1644. g_jmms_context->g_use_local_send_setings = 1;
  1645. mmi_jmms_fill_mms_sending_settings();        
  1646. /* MAUI_00227929 End */
  1647.     if (g_jmms_context->is_add_media_warning == 0)
  1648.     {
  1649.         mmi_jmms_entry_write_message_screen();
  1650.     }
  1651.     else
  1652.     {
  1653.         DisplayPopupCallBack(
  1654.             (PU8) GetString(STR_ID_JMMS_MMS_ERR_WARNING_CONTENT_CLASS),
  1655.             IMG_GLOBAL_WARNING,
  1656.             1,
  1657.             JMMS_POPUP_TIME,
  1658.             WARNING_TONE,
  1659.             mmi_jmms_entry_write_message_screen);
  1660.     }
  1661.   END:
  1662.     // TODO:: need to check whether this is to do or not
  1663. #ifndef __MMI_UNIFIED_MESSAGE__
  1664.     if (g_jmms_context->pParseContent != NULL)
  1665.     {
  1666.         if (g_jmms_context->pParseContent->pFileName != NULL)
  1667.         {
  1668.             jdd_MemFree(g_jmms_context->pParseContent->pFileName);
  1669.             g_jmms_context->pParseContent->pFileName = NULL;
  1670.         }
  1671.         jdd_MemFree(g_jmms_context->pParseContent);
  1672.         g_jmms_context->pParseContent = NULL;
  1673.     }
  1674.     if (eRet != JC_OK && g_jmms_context->msg_handle != NULL)
  1675.     {
  1676.         eRet = mmi_jmms_jdi_msg_deinit(g_jmms_context->msg_handle);
  1677.         g_jmms_context->msg_handle = NULL;
  1678.     }
  1679. #endif 
  1680.     g_jmms_context->is_add_media_warning = 0;
  1681.     DeleteScreenIfPresent(SCR_ID_JMMS_PARSING_PROGRESS);
  1682. }
  1683. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  1684. #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */ 
  1685. #endif /* _MMI_JMMSSENTSECMMI_C */