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

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