UnifiedMessageMsg.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) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * UnifiedMessageMsg.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  * MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  * This file implements handlers to process primitives.
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  *------------------------------------------------------------------------------
  116.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  117.  *============================================================================
  118.  ****************************************************************************/
  119. #ifndef _MMI_UNIFIED_MESSAGE_MSG_C
  120. #define _MMI_UNIFIED_MESSAGE_MSG_C
  121. #include "MMI_features.h"
  122. #ifdef __MMI_UNIFIED_MESSAGE__
  123. #include "stdC.h"
  124. #include "L4Dr1.h"
  125. #include "FileSystemDef.h"
  126. #include "FileMgr.h"
  127. #include "mdi_datatype.h"
  128. /* micha1230 */
  129. #include "custom_nvram_editor_data_item.h"
  130. #include "custom_data_account.h"
  131. #include "MessagesResourceData.h"
  132. /* other files */
  133. #include "GlobalDefs.h"
  134. #include "QueueGprot.h"
  135. #include "Unicodexdcl.h"
  136. #include "DebugInitDef.h"
  137. #include "ProtocolEvents.h"
  138. #include "PixtelDataTypes.h"
  139. #include "EventsGprot.h"
  140. #include "CustDataRes.h"
  141. #include "SettingProfile.h"
  142. #include "IdleAppProt.h"
  143. #include "FrameworkStruct.h"
  144. #include "AlarmFrameWorkProt.h"
  145. #include "HistoryGprot.h"
  146. #include "Conversions.h"
  147. #include "DataAccount.h"
  148. #include "PhoneBookGprot.h"
  149. #include "GpioInc.h"
  150. #include "ProfileGprots.h"
  151. #include "MemPoolContainerProt.h"
  152. #include "CommonScreens.h"
  153. #include "mmi_trc.h"
  154. #include "MessagesMiscell.h"
  155. #include "SmsPsHandler.h"
  156. #include "UnifiedMessageDef.h"
  157. #include "UnifiedMessageGProt.h"
  158. #include "UnifiedMessageProt.h"
  159. /*****************************************************************************
  160.  * FUNCTION
  161.  *  mmi_um_set_protocol_event_handler
  162.  * DESCRIPTION
  163.  *  Set protocol event handler
  164.  * PARAMETERS
  165.  *  void
  166.  * RETURNS
  167.  *  void
  168.  *****************************************************************************/
  169. void mmi_um_set_protocol_event_handler(void)
  170. {
  171.     /*----------------------------------------------------------------*/
  172.     /* Local Variables                                                */
  173.     /*----------------------------------------------------------------*/
  174.     /*----------------------------------------------------------------*/
  175.     /* Code Body                                                      */
  176.     /*----------------------------------------------------------------*/
  177.     SetProtocolEventHandler(mmi_um_handle_ready_ind, PRT_MSG_ID_MMI_UM_READY_IND);
  178.     SetProtocolEventHandler(mmi_um_get_msg_num_rsp, PRT_MSG_ID_MMI_UM_GET_MSG_NUM_RSP);
  179.     SetProtocolEventHandler(mmi_um_get_list_info_rsp, PRT_MSG_ID_MMI_UM_GET_LIST_RSP);
  180.     SetProtocolEventHandler(mmi_um_get_msg_info_rsp, PRT_MSG_ID_MMI_UM_GET_MSG_INFO_RSP);
  181.     SetProtocolEventHandler(mmi_um_delete_folder_rsp, PRT_MSG_ID_MMI_UM_DELETE_FOLDER_RSP);
  182.     SetProtocolEventHandler(mmi_um_handle_new_msg_ind, PRT_MSG_ID_MMI_UM_NEW_MSG_IND);
  183.     SetProtocolEventHandler(mmi_um_handle_delete_all_ind, PRT_MSG_ID_MMI_UM_DELETE_ALL_IND);
  184.     SetProtocolEventHandler(mmi_um_handle_highlight_msg_ind, PRT_MSG_ID_MMI_UM_HIGHLIGHT_MSG_IND);
  185.     SetProtocolEventHandler(mmi_um_handle_refresh_ind, PRT_MSG_ID_MMI_UM_REFRESH_IND);
  186. }
  187. /*****************************************************************************
  188.  * FUNCTION
  189.  *  mmi_um_handle_ready_ind
  190.  * DESCRIPTION
  191.  *  Handle msg ready indication
  192.  * PARAMETERS
  193.  *  inMsg       [IN]        Input message
  194.  * RETURNS
  195.  *  void
  196.  *****************************************************************************/
  197. void mmi_um_handle_ready_ind(void *inMsg)
  198. {
  199.     /*----------------------------------------------------------------*/
  200.     /* Local Variables                                                */
  201.     /*----------------------------------------------------------------*/
  202.     mmi_um_ready_ind_struct *msg = (mmi_um_ready_ind_struct*) inMsg;
  203.     /*----------------------------------------------------------------*/
  204.     /* Code Body                                                      */
  205.     /*----------------------------------------------------------------*/
  206.     mmi_um_ready_ind(msg->result, msg->msg_type);
  207. }
  208. /*****************************************************************************
  209.  * FUNCTION
  210.  *  mmi_um_handle_new_msg_ind
  211.  * DESCRIPTION
  212.  *  Handle new msg indication
  213.  * PARAMETERS
  214.  *  inMsg       [IN]        Input message
  215.  * RETURNS
  216.  *  void
  217.  *****************************************************************************/
  218. void mmi_um_handle_new_msg_ind(void *inMsg)
  219. {
  220.     /*----------------------------------------------------------------*/
  221.     /* Local Variables                                                */
  222.     /*----------------------------------------------------------------*/
  223.     mmi_um_new_msg_ind_struct *msg = (mmi_um_new_msg_ind_struct*) inMsg;
  224.     /*----------------------------------------------------------------*/
  225.     /* Code Body                                                      */
  226.     /*----------------------------------------------------------------*/
  227.     mmi_um_new_msg_ind(msg->msg_type, msg->msg_box_type, msg->msg_index, msg->timestamp);
  228. }
  229. /*****************************************************************************
  230.  * FUNCTION
  231.  *  mmi_um_handle_highlight_msg_ind
  232.  * DESCRIPTION
  233.  *  Handle highlight msg indication
  234.  * PARAMETERS
  235.  *  inMsg       [IN]        Input message
  236.  * RETURNS
  237.  *  void
  238.  *****************************************************************************/
  239. void mmi_um_handle_highlight_msg_ind(void *inMsg)
  240. {
  241.     /*----------------------------------------------------------------*/
  242.     /* Local Variables                                                */
  243.     /*----------------------------------------------------------------*/
  244.     mmi_um_highlight_msg_ind_struct *msg = (mmi_um_highlight_msg_ind_struct*) inMsg;
  245.     /*----------------------------------------------------------------*/
  246.     /* Code Body                                                      */
  247.     /*----------------------------------------------------------------*/
  248.     mmi_um_highlight_msg_ind(msg->msg_type, msg->msg_box_type, msg->msg_index);
  249. }
  250. /*****************************************************************************
  251.  * FUNCTION
  252.  *  mmi_um_handle_refresh_ind
  253.  * DESCRIPTION
  254.  *  Handle refresh indication
  255.  * PARAMETERS
  256.  *  inMsg       [IN]        Input message
  257.  * RETURNS
  258.  *  void
  259.  *****************************************************************************/
  260. void mmi_um_handle_refresh_ind(void *inMsg)
  261. {
  262.     /*----------------------------------------------------------------*/
  263.     /* Local Variables                                                */
  264.     /*----------------------------------------------------------------*/
  265.     mmi_um_refresh_ind_struct *msg = (mmi_um_refresh_ind_struct*) inMsg;
  266.     U16 current_screen_id = GetExitScrnID();
  267.     /*----------------------------------------------------------------*/
  268.     /* Code Body                                                      */
  269.     /*----------------------------------------------------------------*/
  270.     switch (current_screen_id)
  271.     {
  272.         case (SCR_ID_UM_MAIN):
  273.         {
  274.             g_um_p->main.is_refresh = KAL_TRUE;
  275.             mmi_um_pre_entry_main();
  276.             g_um_p->main.is_refresh = KAL_FALSE;
  277.             break;
  278.         }
  279.         case (SCR_ID_UM_INBOX):
  280.         {
  281.             if (msg->msg_box_type & UM_MSG_BOX_TYPE_INBOX)
  282.             {
  283.                 g_um_p->main.is_refresh = KAL_TRUE;
  284.                 g_um_p->main.is_reset_folder_info = KAL_TRUE;
  285.                 mmi_um_pre_entry_inbox();
  286.                 DeleteScreenIfPresent(SCR_ID_UM_INBOX);
  287.                 g_um_p->main.is_refresh = KAL_FALSE;
  288.             }
  289.             break;
  290.         }
  291.         case (SCR_ID_UM_UNSENT):
  292.         {
  293.             if (msg->msg_box_type & UM_MSG_BOX_TYPE_UNSENT)
  294.             {
  295.                 g_um_p->main.is_refresh = KAL_TRUE;
  296.                 g_um_p->main.is_reset_folder_info = KAL_TRUE;
  297.                 mmi_um_pre_entry_unsent();
  298.                 DeleteScreenIfPresent(SCR_ID_UM_UNSENT);
  299.                 g_um_p->main.is_refresh = KAL_FALSE;
  300.             }
  301.             break;
  302.         }
  303.         case (SCR_ID_UM_SENT):
  304.         {
  305.             if (msg->msg_box_type & UM_MSG_BOX_TYPE_SENT)
  306.             {
  307.                 g_um_p->main.is_refresh = KAL_TRUE;
  308.                 g_um_p->main.is_reset_folder_info = KAL_TRUE;
  309.                 mmi_um_pre_entry_sent();
  310.                 DeleteScreenIfPresent(SCR_ID_UM_SENT);
  311.                 g_um_p->main.is_refresh = KAL_FALSE;
  312.             }
  313.             break;
  314.         }
  315.         case (SCR_ID_UM_DRAFT):
  316.         {
  317.             if (msg->msg_box_type & UM_MSG_BOX_TYPE_DRAFT)
  318.             {
  319.                 g_um_p->main.is_refresh = KAL_TRUE;
  320.                 g_um_p->main.is_reset_folder_info = KAL_TRUE;
  321.                 mmi_um_pre_entry_draft();
  322.                 DeleteScreenIfPresent(SCR_ID_UM_DRAFT);
  323.                 g_um_p->main.is_refresh = KAL_FALSE;
  324.             }
  325.             break;
  326.         }
  327.         case (SCR_ID_UM_DELETE_FOLDER):
  328.         {
  329.             g_um_p->main.is_refresh = KAL_TRUE;
  330.             mmi_um_pre_entry_delete_folder();
  331.             g_um_p->main.is_refresh = KAL_FALSE;
  332.             break;
  333.         }
  334.         case (SCR_ID_UM_NEW_MSG_IND):
  335.         {
  336.             /* If the new msg is deleted by AT, the new msg indication screen should not be displayed. */
  337.             EntryIdleScreen();
  338.             break;
  339.         }
  340.         default:
  341.         {
  342.             break;
  343.         }
  344.     }
  345. }
  346. /*****************************************************************************
  347.  * FUNCTION
  348.  *  mmi_um_handle_delete_all_ind
  349.  * DESCRIPTION
  350.  *  Handle delete all indication
  351.  * PARAMETERS
  352.  *  inMsg       [IN]        Input message
  353.  * RETURNS
  354.  *  void
  355.  *****************************************************************************/
  356. void mmi_um_handle_delete_all_ind(void *inMsg)
  357. {
  358.     /*----------------------------------------------------------------*/
  359.     /* Local Variables                                                */
  360.     /*----------------------------------------------------------------*/
  361.     mmi_um_delete_all_ind_struct *msg = (mmi_um_delete_all_ind_struct*) inMsg;
  362.     /*----------------------------------------------------------------*/
  363.     /* Code Body                                                      */
  364.     /*----------------------------------------------------------------*/
  365.     g_um_p->delete_folder.folders_to_delete = msg->msg_box_type;
  366.     switch (msg->msg_box_type)
  367.     {
  368.         case UM_MSG_BOX_TYPE_INBOX:
  369.         {
  370.             mmi_um_set_processing_screen(STR_UM_INBOX_ID, STR_UM_DELETING_ID, IMG_GLOBAL_PROGRESS, 0);
  371.             break;
  372.         }
  373.         case UM_MSG_BOX_TYPE_UNSENT:
  374.         {
  375.             mmi_um_set_processing_screen(STR_UM_UNSENT_ID, STR_UM_DELETING_ID, IMG_GLOBAL_PROGRESS, 0);
  376.             break;
  377.         }
  378.         case UM_MSG_BOX_TYPE_SENT:
  379.         {
  380.             mmi_um_set_processing_screen(STR_UM_SENT_ID, STR_UM_DELETING_ID, IMG_GLOBAL_PROGRESS, 0);
  381.             break;
  382.         }
  383.         case UM_MSG_BOX_TYPE_DRAFT:
  384.         {
  385.             mmi_um_set_processing_screen(STR_UM_DRAFT_ID, STR_UM_DELETING_ID, IMG_GLOBAL_PROGRESS, 0);
  386.             break;
  387.         }
  388.         default:
  389.         {
  390.             MMI_ASSERT(0);
  391.             break;
  392.         }
  393.     }
  394.     mmi_um_entry_processing_generic();
  395.     switch (msg->msg_type)
  396.     {
  397.         case UM_MSG_TYPE_SMS:
  398.         {
  399.             mmi_um_delete_all_res_struct *msgRes;
  400.             msgRes = (mmi_um_delete_all_res_struct*) OslConstructDataPtr(sizeof(*msgRes));
  401.             msgRes->result = KAL_TRUE;
  402.             msgRes->msg_type = UM_MSG_TYPE_SMS;
  403.             mmi_um_send_message(MOD_MMI, MOD_MMI, 0, PRT_MSG_ID_MMI_UM_DELETE_ALL_RES, (oslParaType*) msgRes, NULL);
  404.             break;
  405.         }
  406.         case UM_MSG_TYPE_MMS:
  407.         {
  408.             mmi_um_delete_all_res_struct *msgRes;
  409.             msgRes = (mmi_um_delete_all_res_struct*) OslConstructDataPtr(sizeof(*msgRes));
  410.             msgRes->result = KAL_TRUE;
  411.             msgRes->msg_type = UM_MSG_TYPE_MMS;
  412.             mmi_um_send_message(MOD_MMI, MOD_WAP, 0, PRT_MSG_ID_MMI_UM_DELETE_ALL_RES, (oslParaType*) msgRes, NULL);
  413.             break;
  414.         }
  415.         case UM_MSG_TYPE_WAP_PUSH:
  416.         {
  417.             mmi_um_delete_all_res_struct *msgRes;
  418.             msgRes = (mmi_um_delete_all_res_struct*) OslConstructDataPtr(sizeof(*msgRes));
  419.             msgRes->result = KAL_TRUE;
  420.             msgRes->msg_type = UM_MSG_TYPE_WAP_PUSH;
  421.             mmi_um_send_message(MOD_MMI, MOD_WAP, 0, PRT_MSG_ID_MMI_UM_DELETE_ALL_RES, (oslParaType*) msgRes, NULL);
  422.             break;
  423.         }
  424.         default:
  425.         {
  426.             MMI_ASSERT(0);
  427.             break;
  428.         }
  429.     }
  430.     mmi_um_delete_folder_req();
  431. }
  432. /*****************************************************************************
  433.  * FUNCTION
  434.  *  mmi_um_get_msg_num_req
  435.  * DESCRIPTION
  436.  *  get number of msg for each msg type
  437.  * PARAMETERS
  438.  *  void
  439.  *  inMsg(?)        [IN]        Input message
  440.  * RETURNS
  441.  *  void
  442.  *****************************************************************************/
  443. void mmi_um_get_msg_num_req(void)
  444. {
  445.     /*----------------------------------------------------------------*/
  446.     /* Local Variables                                                */
  447.     /*----------------------------------------------------------------*/
  448.     U8 i = 0;
  449.     U8 type = 0x01;
  450.     /*----------------------------------------------------------------*/
  451.     /* Code Body                                                      */
  452.     /*----------------------------------------------------------------*/
  453.     g_um_p->main.pending_req_type = g_um_p->main.support_type;
  454.     g_um_p->main.current_action = UM_ACTION_GET_MSG_NUM;
  455.     g_um_p->msg_number.inbox_msg_number = 0;
  456.     g_um_p->msg_number.inbox_unread_msg_number = 0;
  457.     g_um_p->msg_number.unsent_msg_number = 0;
  458.     g_um_p->msg_number.sent_msg_number = 0;
  459.     g_um_p->msg_number.draft_msg_number = 0;
  460.     for (; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  461.     {
  462.         if (mmi_um_check_support_type(type))
  463.         {
  464.             switch (type)
  465.             {
  466.                 case UM_MSG_TYPE_SMS:
  467.                 {
  468.                     mmi_um_get_msg_num_req_struct *msgReq;
  469.                     msgReq = (mmi_um_get_msg_num_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  470.                     msgReq->msg_type = UM_MSG_TYPE_SMS;
  471.                     mmi_um_send_message(
  472.                         MOD_MMI,
  473.                         MOD_MMI,
  474.                         0,
  475.                         PRT_MSG_ID_MMI_UM_GET_MSG_NUM_REQ,
  476.                         (oslParaType*) msgReq,
  477.                         NULL);
  478.                     return;
  479.                 }
  480.                 case UM_MSG_TYPE_MMS:
  481.                 {
  482.                     mmi_um_get_msg_num_req_struct *msgReq;
  483.                     msgReq = (mmi_um_get_msg_num_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  484.                     msgReq->msg_type = UM_MSG_TYPE_MMS;
  485.                     mmi_um_send_message(
  486.                         MOD_MMI,
  487.                         MOD_WAP,
  488.                         0,
  489.                         PRT_MSG_ID_MMI_UM_GET_MSG_NUM_REQ,
  490.                         (oslParaType*) msgReq,
  491.                         NULL);
  492.                     return;
  493.                 }
  494.                 case UM_MSG_TYPE_WAP_PUSH:
  495.                 {
  496.                     mmi_um_get_msg_num_req_struct *msgReq;
  497.                     msgReq = (mmi_um_get_msg_num_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  498.                     msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  499.                     mmi_um_send_message(
  500.                         MOD_MMI,
  501.                         MOD_WAP,
  502.                         0,
  503.                         PRT_MSG_ID_MMI_UM_GET_MSG_NUM_REQ,
  504.                         (oslParaType*) msgReq,
  505.                         NULL);
  506.                     return;
  507.                 }
  508.                 default:
  509.                     MMI_ASSERT(0);
  510.                     return;
  511.             }
  512.         }
  513.     }
  514. }
  515. /*****************************************************************************
  516.  * FUNCTION
  517.  *  mmi_um_get_msg_num_rsp
  518.  * DESCRIPTION
  519.  *  get number of msg for each msg type
  520.  * PARAMETERS
  521.  *  inMsg       [IN]        Input message
  522.  * RETURNS
  523.  *  void
  524.  *****************************************************************************/
  525. void mmi_um_get_msg_num_rsp(void *inMsg)
  526. {
  527.     /*----------------------------------------------------------------*/
  528.     /* Local Variables                                                */
  529.     /*----------------------------------------------------------------*/
  530.     mmi_um_get_msg_num_rsp_struct *msg = (mmi_um_get_msg_num_rsp_struct*) inMsg;
  531.     /*----------------------------------------------------------------*/
  532.     /* Code Body                                                      */
  533.     /*----------------------------------------------------------------*/
  534.     if (g_um_p->main.current_action != UM_ACTION_GET_MSG_NUM)
  535.     {
  536.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  537.                              "*[UnifiedMessageMsg.c] mmi_um_get_msg_num_rsp Ignore obsolete response *n"));
  538.         return;
  539.     }
  540.     MMI_ASSERT(msg->result);
  541.     MMI_ASSERT(mmi_um_check_support_type(msg->msg_type));
  542.     if (!(g_um_p->main.pending_req_type & msg->msg_type))
  543.     {
  544.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  545.                              "*[UnifiedMessageMsg.c] mmi_um_get_msg_num_rsp Unexpected message type *n"));
  546.         return;
  547.     }
  548.     if (g_um_p->main.state == UM_STATE_IDLE)
  549.     {
  550.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  551.                              "*[UnifiedMessageMsg.c] mmi_um_get_msg_num_rsp UM_STATE_IDLE *n"));
  552.         return;
  553.     }
  554.     g_um_p->main.pending_req_type &= ~(msg->msg_type);
  555.     g_um_p->msg_number.inbox_msg_number += msg->inbox_unread_msg_number + msg->inbox_read_msg_number;
  556.     g_um_p->msg_number.inbox_unread_msg_number += msg->inbox_unread_msg_number;
  557.     g_um_p->msg_number.unsent_msg_number += msg->unsent_msg_number;
  558.     g_um_p->msg_number.sent_msg_number += msg->sent_msg_number;
  559.     g_um_p->msg_number.draft_msg_number += msg->draft_msg_number;
  560.     mmi_um_handle_get_msg_num_rsp();
  561. }
  562. /*****************************************************************************
  563.  * FUNCTION
  564.  *  mmi_um_get_list_info_req
  565.  * DESCRIPTION
  566.  *  get list info request funtion
  567.  * PARAMETERS
  568.  *  void
  569.  * RETURNS
  570.  *  void
  571.  *****************************************************************************/
  572. void mmi_um_get_list_info_req(void)
  573. {
  574.     /*----------------------------------------------------------------*/
  575.     /* Local Variables                                                */
  576.     /*----------------------------------------------------------------*/
  577.     U8 i = 0;
  578.     U8 type = 0x01;
  579.     /*----------------------------------------------------------------*/
  580.     /* Code Body                                                      */
  581.     /*----------------------------------------------------------------*/
  582.     g_um_p->main.pending_req_type = g_um_p->main.support_type;
  583.     g_um_p->folder.msg_number_in_list = 0;
  584.     g_um_p->main.current_action = UM_ACTION_GET_LIST_INFO;
  585.     memset(g_um_p->folder.msg_list, 0, sizeof(mmi_um_msg_box_info_struct) * MMI_UM_MAX_MSG_NUM);
  586.     for (; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  587.     {
  588.         if (mmi_um_check_support_type(type))
  589.         {
  590.             switch (type)
  591.             {
  592.                 case UM_MSG_TYPE_SMS:
  593.                 {
  594.                     mmi_um_get_list_req_struct *msgReq;
  595.                     msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  596.                     msgReq->msg_type = UM_MSG_TYPE_SMS;
  597.                     msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  598.                     msgReq->start_entry = 0;
  599.                     mmi_um_send_message(
  600.                         MOD_MMI,
  601.                         MOD_MMI,
  602.                         0,
  603.                         PRT_MSG_ID_MMI_UM_GET_LIST_REQ,
  604.                         (oslParaType*) msgReq,
  605.                         NULL);
  606.                     return;
  607.                 }
  608.                 case UM_MSG_TYPE_MMS:
  609.                 {
  610.                     mmi_um_get_list_req_struct *msgReq;
  611.                     msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  612.                     msgReq->msg_type = UM_MSG_TYPE_MMS;
  613.                     msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  614.                     msgReq->start_entry = 0;
  615.                     mmi_um_send_message(
  616.                         MOD_MMI,
  617.                         MOD_WAP,
  618.                         0,
  619.                         PRT_MSG_ID_MMI_UM_GET_LIST_REQ,
  620.                         (oslParaType*) msgReq,
  621.                         NULL);
  622.                     return;
  623.                 }
  624.                 case UM_MSG_TYPE_WAP_PUSH:
  625.                 {
  626.                     mmi_um_get_list_req_struct *msgReq;
  627.                     msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  628.                     msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  629.                     msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  630.                     msgReq->start_entry = 0;
  631.                     mmi_um_send_message(
  632.                         MOD_MMI,
  633.                         MOD_WAP,
  634.                         0,
  635.                         PRT_MSG_ID_MMI_UM_GET_LIST_REQ,
  636.                         (oslParaType*) msgReq,
  637.                         NULL);
  638.                     return;
  639.                 }
  640.                 default:
  641.                     MMI_ASSERT(0);
  642.                     return;
  643.             }
  644.         }
  645.     }
  646. }
  647. /*****************************************************************************
  648.  * FUNCTION
  649.  *  mmi_um_get_list_info_rsp
  650.  * DESCRIPTION
  651.  *  get number of msg for each msg type
  652.  * PARAMETERS
  653.  *  inMsg       [IN]        Input message
  654.  * RETURNS
  655.  *  void
  656.  *****************************************************************************/
  657. void mmi_um_get_list_info_rsp(void *inMsg)
  658. {
  659.     /*----------------------------------------------------------------*/
  660.     /* Local Variables                                                */
  661.     /*----------------------------------------------------------------*/
  662.     mmi_um_get_list_rsp_struct *msg = (mmi_um_get_list_rsp_struct*) inMsg;
  663.     /*----------------------------------------------------------------*/
  664.     /* Code Body                                                      */
  665.     /*----------------------------------------------------------------*/
  666.     if (g_um_p->main.current_action != UM_ACTION_GET_LIST_INFO)
  667.     {
  668.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  669.                              "*[UnifiedMessageMsg.c] mmi_um_get_list_info_rsp Ignore obsolete response *n"));
  670.         return;
  671.     }
  672.     if (g_um_p->main.state == UM_STATE_IDLE)
  673.     {
  674.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  675.                              "*[UnifiedMessageMsg.c] mmi_um_get_list_info_rsp UM_STATE_IDLE *n"));
  676.         return;
  677.     }
  678.     MMI_ASSERT(msg->result);
  679.     MMI_ASSERT(mmi_um_check_support_type(msg->msg_type));
  680.     mmi_um_insert_list_info(msg->msg_type, msg->msg_number, msg->list_info);
  681.     if (msg->more)
  682.     {
  683.         switch (msg->msg_type)
  684.         {
  685.             case UM_MSG_TYPE_SMS:
  686.             {
  687.                 mmi_um_get_list_req_struct *msgReq;
  688.                 msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  689.                 msgReq->msg_type = UM_MSG_TYPE_SMS;
  690.                 msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  691.                 msgReq->start_entry = msg->start_entry + msg->msg_number;
  692.                 mmi_um_send_message(MOD_MMI, MOD_MMI, 0, PRT_MSG_ID_MMI_UM_GET_LIST_REQ, (oslParaType*) msgReq, NULL);
  693.                 return;
  694.             }
  695.             case UM_MSG_TYPE_MMS:
  696.             {
  697.                 mmi_um_get_list_req_struct *msgReq;
  698.                 msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  699.                 msgReq->msg_type = UM_MSG_TYPE_MMS;
  700.                 msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  701.                 msgReq->start_entry = msg->start_entry + msg->msg_number;
  702.                 mmi_um_send_message(MOD_MMI, MOD_WAP, 0, PRT_MSG_ID_MMI_UM_GET_LIST_REQ, (oslParaType*) msgReq, NULL);
  703.                 return;
  704.             }
  705.             case UM_MSG_TYPE_WAP_PUSH:
  706.             {
  707.                 mmi_um_get_list_req_struct *msgReq;
  708.                 msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  709.                 msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  710.                 msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  711.                 msgReq->start_entry = msg->start_entry + msg->msg_number;
  712.                 mmi_um_send_message(MOD_MMI, MOD_WAP, 0, PRT_MSG_ID_MMI_UM_GET_LIST_REQ, (oslParaType*) msgReq, NULL);
  713.                 return;
  714.             }
  715.             default:
  716.                 MMI_ASSERT(0);
  717.         }
  718.     }
  719.     g_um_p->main.pending_req_type &= ~(msg->msg_type);
  720.     mmi_um_handle_get_list_info_rsp();
  721. }
  722. /*****************************************************************************
  723.  * FUNCTION
  724.  *  mmi_um_get_msg_info_req
  725.  * DESCRIPTION
  726.  *  get msg detail information
  727.  * PARAMETERS
  728.  *  void
  729.  *  inMsg(?)        [IN]        Input message
  730.  * RETURNS
  731.  *  void
  732.  *****************************************************************************/
  733. void mmi_um_get_msg_info_req()
  734. {
  735.     /*----------------------------------------------------------------*/
  736.     /* Local Variables                                                */
  737.     /*----------------------------------------------------------------*/
  738.     U16 i = 0;
  739.     U16 start_index = g_um_p->mem_pool_info.not_avail_pool * MMI_UM_MAX_MSG_PER_PAGE;
  740.     U16 end_index = ((g_um_p->mem_pool_info.not_avail_pool + 1) * MMI_UM_MAX_MSG_PER_PAGE) - 1;
  741.     U16 msg_num = 0;
  742.     UmMsgType type = 0;
  743.     /*----------------------------------------------------------------*/
  744.     /* Code Body                                                      */
  745.     /*----------------------------------------------------------------*/
  746.     g_um_p->get_msg_detail.start_index_sms = 0;
  747.     g_um_p->get_msg_detail.msg_num_to_get_sms = 0;
  748.     g_um_p->get_msg_detail.start_index_mms = 0;
  749.     g_um_p->get_msg_detail.msg_num_to_get_mms = 0;
  750.     g_um_p->get_msg_detail.start_index_wap_push = 0;
  751.     g_um_p->get_msg_detail.msg_num_to_get_wap_push = 0;
  752.     g_um_p->get_msg_detail.num_in_temp_buffer = 0;
  753.     g_um_p->main.pending_req_type = 0;
  754.     g_um_p->main.current_action = UM_ACTION_GET_MSG_INFO;
  755.     memset(&g_um_p->get_msg_detail.temp_buffer, 0, sizeof(mmi_um_msg_detail_struct) * MMI_UM_MAX_MSG_PER_PAGE);
  756.     for (i = start_index; (i <= end_index) && (i < g_um_p->folder.msg_number_in_list); i++)
  757.     {
  758.         type = g_um_p->folder.msg_list[i].msg_type;
  759.         switch (type)
  760.         {
  761.             case UM_MSG_TYPE_SMS:
  762.             {
  763.                 if (g_um_p->get_msg_detail.msg_num_to_get_sms == 0)
  764.                 {
  765.                     g_um_p->main.pending_req_type |= UM_MSG_TYPE_SMS;
  766.                     g_um_p->get_msg_detail.start_index_sms = g_um_p->folder.msg_list[i].list_info.msg_index;
  767.                 }
  768.                 g_um_p->get_msg_detail.msg_num_to_get_sms++;
  769.                 g_um_p->get_msg_detail.temp_buffer[msg_num].msg_type = UM_MSG_TYPE_SMS;
  770.                 break;
  771.             }
  772.             case UM_MSG_TYPE_MMS:
  773.             {
  774.                 if (g_um_p->get_msg_detail.msg_num_to_get_mms == 0)
  775.                 {
  776.                     g_um_p->main.pending_req_type |= UM_MSG_TYPE_MMS;
  777.                     g_um_p->get_msg_detail.start_index_mms = g_um_p->folder.msg_list[i].list_info.msg_index;
  778.                 }
  779.                 g_um_p->get_msg_detail.msg_num_to_get_mms++;
  780.                 g_um_p->get_msg_detail.temp_buffer[msg_num].msg_type = UM_MSG_TYPE_MMS;
  781.                 break;
  782.             }
  783.             case UM_MSG_TYPE_WAP_PUSH:
  784.             {
  785.                 if (g_um_p->get_msg_detail.msg_num_to_get_wap_push == 0)
  786.                 {
  787.                     g_um_p->main.pending_req_type |= UM_MSG_TYPE_WAP_PUSH;
  788.                     g_um_p->get_msg_detail.start_index_wap_push = g_um_p->folder.msg_list[i].list_info.msg_index;
  789.                 }
  790.                 g_um_p->get_msg_detail.msg_num_to_get_wap_push++;
  791.                 g_um_p->get_msg_detail.temp_buffer[msg_num].msg_type = UM_MSG_TYPE_WAP_PUSH;
  792.                 break;
  793.             }
  794.             default:
  795.                 MMI_ASSERT(0);
  796.                 break;
  797.         }
  798.         msg_num++;
  799.     }
  800.     /* If no message needed to get, enter current folder */
  801.     if (g_um_p->get_msg_detail.msg_num_to_get_sms == 0 && 
  802.         g_um_p->get_msg_detail.msg_num_to_get_mms == 0 &&
  803.         g_um_p->get_msg_detail.msg_num_to_get_wap_push == 0)
  804.     {
  805.         mmi_um_enter_curr_folder();
  806.         return;
  807.     }
  808.     type = 0x01;
  809.     for (i = 0; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  810.     {
  811.         if (mmi_um_check_support_type(type))
  812.         {
  813.             switch (type)
  814.             {
  815.                 case UM_MSG_TYPE_SMS:
  816.                 {
  817.                     if (g_um_p->get_msg_detail.msg_num_to_get_sms > 0)
  818.                     {
  819.                         mmi_um_get_msg_info_req_struct *msgReq;
  820.                         msgReq = (mmi_um_get_msg_info_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  821.                         msgReq->msg_type = UM_MSG_TYPE_SMS;
  822.                         msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  823.                         msgReq->start_entry = g_um_p->get_msg_detail.start_index_sms;
  824.                         msgReq->msg_number = g_um_p->get_msg_detail.msg_num_to_get_sms;
  825.                         mmi_um_send_message(
  826.                             MOD_MMI,
  827.                             MOD_MMI,
  828.                             0,
  829.                             PRT_MSG_ID_MMI_UM_GET_MSG_INFO_REQ,
  830.                             (oslParaType*) msgReq,
  831.                             NULL);
  832.                         return;
  833.                     }
  834.                     break;
  835.                 }
  836.                 case UM_MSG_TYPE_MMS:
  837.                 {
  838.                     if (g_um_p->get_msg_detail.msg_num_to_get_mms > 0)
  839.                     {
  840.                         mmi_um_get_msg_info_req_struct *msgReq;
  841.                         msgReq = (mmi_um_get_msg_info_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  842.                         msgReq->msg_type = UM_MSG_TYPE_MMS;
  843.                         msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  844.                         msgReq->start_entry = g_um_p->get_msg_detail.start_index_mms;
  845.                         msgReq->msg_number = g_um_p->get_msg_detail.msg_num_to_get_mms;
  846.                         mmi_um_send_message(
  847.                             MOD_MMI,
  848.                             MOD_WAP,
  849.                             0,
  850.                             PRT_MSG_ID_MMI_UM_GET_MSG_INFO_REQ,
  851.                             (oslParaType*) msgReq,
  852.                             NULL);
  853.                         return;
  854.                     }
  855.                     break;
  856.                 }
  857.                 case UM_MSG_TYPE_WAP_PUSH:
  858.                 {
  859.                     mmi_um_get_msg_info_req_struct *msgReq;
  860.                     if (g_um_p->get_msg_detail.msg_num_to_get_wap_push > 0)
  861.                     {
  862.                         msgReq = (mmi_um_get_msg_info_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  863.                         msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  864.                         msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  865.                         msgReq->start_entry = g_um_p->get_msg_detail.start_index_wap_push;
  866.                         msgReq->msg_number = g_um_p->get_msg_detail.msg_num_to_get_wap_push;
  867.                         mmi_um_send_message(
  868.                             MOD_MMI,
  869.                             MOD_WAP,
  870.                             0,
  871.                             PRT_MSG_ID_MMI_UM_GET_MSG_INFO_REQ,
  872.                             (oslParaType*) msgReq,
  873.                             NULL);
  874.                         return;
  875.                     }
  876.                     break;
  877.                 }
  878.                 default:
  879.                     MMI_ASSERT(0);
  880.                     return;
  881.             }
  882.         }
  883.     }
  884. }
  885. /*****************************************************************************
  886.  * FUNCTION
  887.  *  mmi_um_get_msg_info_rsp
  888.  * DESCRIPTION
  889.  *  get number of msg for each msg type
  890.  * PARAMETERS
  891.  *  inMsg       [IN]        Input message
  892.  * RETURNS
  893.  *  void
  894.  *****************************************************************************/
  895. void mmi_um_get_msg_info_rsp(void *inMsg)
  896. {
  897.     /*----------------------------------------------------------------*/
  898.     /* Local Variables                                                */
  899.     /*----------------------------------------------------------------*/
  900.     mmi_um_get_msg_info_rsp_struct *msg = (mmi_um_get_msg_info_rsp_struct*) inMsg;
  901.     /*----------------------------------------------------------------*/
  902.     /* Code Body                                                      */
  903.     /*----------------------------------------------------------------*/
  904.     if (g_um_p->main.current_action != UM_ACTION_GET_MSG_INFO)
  905.     {
  906.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  907.                              "*[UnifiedMessageMsg.c] mmi_um_get_msg_info_rsp Ignore obsolete response *n"));
  908.         return;
  909.     }
  910.     if (g_um_p->main.state == UM_STATE_IDLE)
  911.     {
  912.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  913.                              "*[UnifiedMessageMsg.c] mmi_um_get_msg_info_rsp UM_STATE_IDLE *n"));
  914.         return;
  915.     }
  916.     MMI_ASSERT(msg->result);
  917.     MMI_ASSERT(mmi_um_check_support_type(msg->msg_type));
  918.     g_um_p->main.pending_req_type &= ~(msg->msg_type);
  919.     mmi_um_insert_msg_info(msg->msg_type, msg->msg_number, msg->msg_info);
  920.     mmi_um_handle_get_msg_info_rsp();
  921. }
  922. /*****************************************************************************
  923.  * FUNCTION
  924.  *  mmi_um_delete_folder_req
  925.  * DESCRIPTION
  926.  *  Delete function of delete folder for unified message.
  927.  * PARAMETERS
  928.  *  void
  929.  * RETURNS
  930.  *  void
  931.  *****************************************************************************/
  932. void mmi_um_delete_folder_req(void)
  933. {
  934.     /*----------------------------------------------------------------*/
  935.     /* Local Variables                                                */
  936.     /*----------------------------------------------------------------*/
  937.     U8 i = 0;
  938.     U8 type = 0x01;
  939.     /*----------------------------------------------------------------*/
  940.     /* Code Body                                                      */
  941.     /*----------------------------------------------------------------*/
  942.     g_um_p->main.pending_req_type = 0;
  943.     g_um_p->main.pending_req_type = g_um_p->main.support_type;
  944.     g_um_p->delete_folder.result = KAL_TRUE;
  945.     g_um_p->main.current_action = UM_ACTION_DELETE_FOLDER;
  946.     for (; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  947.     {
  948.         if (mmi_um_check_support_type(type))
  949.         {
  950.             switch (type)
  951.             {
  952.                 case UM_MSG_TYPE_SMS:
  953.                 {
  954.                     mmi_um_delete_folder_req_struct *msgReq;
  955.                     msgReq = (mmi_um_delete_folder_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  956.                     msgReq->msg_type = UM_MSG_TYPE_SMS;
  957.                     msgReq->msg_box_type = g_um_p->delete_folder.folders_to_delete;
  958.                     mmi_um_send_message(
  959.                         MOD_MMI,
  960.                         MOD_MMI,
  961.                         0,
  962.                         PRT_MSG_ID_MMI_UM_DELETE_FOLDER_REQ,
  963.                         (oslParaType*) msgReq,
  964.                         NULL);
  965.                     return;
  966.                 }
  967.                 case UM_MSG_TYPE_MMS:
  968.                 {
  969.                     mmi_um_delete_folder_req_struct *msgReq;
  970.                     msgReq = (mmi_um_delete_folder_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  971.                     msgReq->msg_type = UM_MSG_TYPE_MMS;
  972.                     msgReq->msg_box_type = g_um_p->delete_folder.folders_to_delete;
  973.                     mmi_um_send_message(
  974.                         MOD_MMI,
  975.                         MOD_WAP,
  976.                         0,
  977.                         PRT_MSG_ID_MMI_UM_DELETE_FOLDER_REQ,
  978.                         (oslParaType*) msgReq,
  979.                         NULL);
  980.                     return;
  981.                 }
  982.                 case UM_MSG_TYPE_WAP_PUSH:
  983.                 {
  984.                     mmi_um_delete_folder_req_struct *msgReq;
  985.                     msgReq = (mmi_um_delete_folder_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  986.                     msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  987.                     msgReq->msg_box_type = g_um_p->delete_folder.folders_to_delete;
  988.                     mmi_um_send_message(
  989.                         MOD_MMI,
  990.                         MOD_WAP,
  991.                         0,
  992.                         PRT_MSG_ID_MMI_UM_DELETE_FOLDER_REQ,
  993.                         (oslParaType*) msgReq,
  994.                         NULL);
  995.                     return;
  996.                 }
  997.                 default:
  998.                     MMI_ASSERT(0);
  999.                     return;
  1000.             }
  1001.         }
  1002.     }
  1003. }
  1004. /*****************************************************************************
  1005.  * FUNCTION
  1006.  *  mmi_um_delete_folder_rsp
  1007.  * DESCRIPTION
  1008.  *  Delete function of delete folder for unified message.
  1009.  * PARAMETERS
  1010.  *  inMsg       [IN]        Input message
  1011.  * RETURNS
  1012.  *  void
  1013.  *****************************************************************************/
  1014. void mmi_um_delete_folder_rsp(void *inMsg)
  1015. {
  1016.     /*----------------------------------------------------------------*/
  1017.     /* Local Variables                                                */
  1018.     /*----------------------------------------------------------------*/
  1019.     mmi_um_delete_folder_rsp_struct *msg = (mmi_um_delete_folder_rsp_struct*) inMsg;
  1020.     /*----------------------------------------------------------------*/
  1021.     /* Code Body                                                      */
  1022.     /*----------------------------------------------------------------*/
  1023.     if (g_um_p->main.current_action != UM_ACTION_DELETE_FOLDER)
  1024.     {
  1025.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  1026.                              "*[UnifiedMessageMsg.c] mmi_um_delete_folder_rsp Ignore obsolete response *n"));
  1027.         return;
  1028.     }
  1029.     if (g_um_p->main.state == UM_STATE_IDLE)
  1030.     {
  1031.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  1032.                              "*[UnifiedMessageMsg.c] mmi_um_delete_folder_rsp UM_STATE_IDLE *n"));
  1033.         return;
  1034.     }
  1035.     MMI_ASSERT(mmi_um_check_support_type(msg->msg_type));
  1036.     mmi_um_handle_delete_folder_rsp(msg->msg_type, msg->result);
  1037. }
  1038. /*****************************************************************************
  1039.  * FUNCTION
  1040.  *  mmi_um_handle_get_msg_num_rsp
  1041.  * DESCRIPTION
  1042.  *  handle screen flow after getting msg number rsp
  1043.  * PARAMETERS
  1044.  *  void
  1045.  * RETURNS
  1046.  *  void
  1047.  *****************************************************************************/
  1048. void mmi_um_handle_get_msg_num_rsp(void)
  1049. {
  1050.     /*----------------------------------------------------------------*/
  1051.     /* Local Variables                                                */
  1052.     /*----------------------------------------------------------------*/
  1053.     /*----------------------------------------------------------------*/
  1054.     /* Code Body                                                      */
  1055.     /*----------------------------------------------------------------*/
  1056.     if (g_um_p->main.pending_req_type == 0)
  1057.     {
  1058.         switch (g_um_p->main.state)
  1059.         {
  1060.             case UM_STATE_ENTRY_MAIN_MENU:
  1061.             {
  1062.                 mmi_um_entry_main();
  1063.                 break;
  1064.             }
  1065.             case UM_STATE_ENTRY_INBOX:
  1066.             {
  1067.                 if (g_um_p->msg_number.inbox_msg_number == 0)
  1068.                 {
  1069.                     DisplayPopup(
  1070.                         (U8*) GetString(STR_GLOBAL_EMPTY),
  1071.                         IMG_GLOBAL_EMPTY,
  1072.                         1,
  1073.                         MESSAGES_POPUP_TIME_OUT,
  1074.                         (U8) EMPTY_LIST_TONE);
  1075.                     /* If the new msg is deleted by AT, is_new_msg should be reset. */
  1076.                     g_um_p->main.is_new_msg = KAL_FALSE;
  1077.                     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1078.                 }
  1079.                 else
  1080.                 {
  1081.                     mmi_um_get_list_info_req();
  1082.                 }
  1083.                 break;
  1084.             }
  1085.             case UM_STATE_ENTRY_UNSENT:
  1086.             {
  1087.                 if (g_um_p->msg_number.unsent_msg_number == 0)
  1088.                 {
  1089.                     DisplayPopup(
  1090.                         (U8*) GetString(STR_GLOBAL_EMPTY),
  1091.                         IMG_GLOBAL_EMPTY,
  1092.                         1,
  1093.                         MESSAGES_POPUP_TIME_OUT,
  1094.                         (U8) EMPTY_LIST_TONE);
  1095.                     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1096.                 }
  1097.                 else
  1098.                 {
  1099.                     mmi_um_get_list_info_req();
  1100.                 }
  1101.                 break;
  1102.             }
  1103.             case UM_STATE_ENTRY_SENT:
  1104.             {
  1105.                 if (g_um_p->msg_number.sent_msg_number == 0)
  1106.                 {
  1107.                     DisplayPopup(
  1108.                         (U8*) GetString(STR_GLOBAL_EMPTY),
  1109.                         IMG_GLOBAL_EMPTY,
  1110.                         1,
  1111.                         MESSAGES_POPUP_TIME_OUT,
  1112.                         (U8) EMPTY_LIST_TONE);
  1113.                     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1114.                 }
  1115.                 else
  1116.                 {
  1117.                     mmi_um_get_list_info_req();
  1118.                 }
  1119.                 break;
  1120.             }
  1121.             case UM_STATE_ENTRY_DRAFT:
  1122.             {
  1123.                 if (g_um_p->msg_number.draft_msg_number == 0)
  1124.                 {
  1125.                     DisplayPopup(
  1126.                         (U8*) GetString(STR_GLOBAL_EMPTY),
  1127.                         IMG_GLOBAL_EMPTY,
  1128.                         1,
  1129.                         MESSAGES_POPUP_TIME_OUT,
  1130.                         (U8) EMPTY_LIST_TONE);
  1131.                     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1132.                 }
  1133.                 else
  1134.                 {
  1135.                     mmi_um_get_list_info_req();
  1136.                 }
  1137.                 break;
  1138.             }
  1139.             case UM_STATE_ENTRY_DELETE_FOLDER:
  1140.             {
  1141.                 mmi_um_entry_delete_folder();
  1142.                 break;
  1143.             }
  1144.             case UM_STATE_ENTRY_NEW_MSG_IND:
  1145.             {
  1146.                 /* If not on new msg dummy screen, do nothing. */
  1147.                 if (GetExitScrnID() != SCR_ID_UM_NEW_MSG_DUMMY_IND)
  1148.                 {
  1149.                     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  1150.                              "*[UnifiedMessageMsg.c] mmi_um_handle_get_msg_num_rsp NOT on new msg dummy screen *n"));
  1151.                     return;
  1152.                 }
  1153.                 if (g_um_p->msg_number.inbox_unread_msg_number == 0)
  1154.                 {
  1155.                     /* If the msg is deleted, ex. by AT, change design to not display new msg screen */
  1156.                     g_um_p->main.is_new_msg = KAL_FALSE;
  1157.                 }
  1158.                 else
  1159.                 {
  1160.                     /* After the msg number is ready, enter idle screen again. */
  1161.                     g_um_p->main.is_ready_for_new_msg = KAL_TRUE;
  1162.                 }
  1163.                 
  1164.                 EntryIdleScreen();
  1165.                 break;
  1166.             }
  1167.             default:
  1168.             {
  1169.                 MMI_ASSERT(0);
  1170.             }
  1171.         }
  1172.     }
  1173.     else    /* if(g_um_p->main.pending_req_type != 0) */
  1174.     {
  1175.         U8 i = 0;
  1176.         U8 type = 0x01;
  1177.         for (; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  1178.         {
  1179.             if (mmi_um_check_support_type(type) && (type & (g_um_p->main.pending_req_type)))
  1180.             {
  1181.                 switch (type)
  1182.                 {
  1183.                     case UM_MSG_TYPE_SMS:
  1184.                     {
  1185.                         mmi_um_get_msg_num_req_struct *msgReq;
  1186.                         msgReq = (mmi_um_get_msg_num_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1187.                         msgReq->msg_type = UM_MSG_TYPE_SMS;
  1188.                         mmi_um_send_message(
  1189.                             MOD_MMI,
  1190.                             MOD_MMI,
  1191.                             0,
  1192.                             PRT_MSG_ID_MMI_UM_GET_MSG_NUM_REQ,
  1193.                             (oslParaType*) msgReq,
  1194.                             NULL);
  1195.                         return;
  1196.                     }
  1197.                     case UM_MSG_TYPE_MMS:
  1198.                     {
  1199.                         mmi_um_get_msg_num_req_struct *msgReq;
  1200.                         msgReq = (mmi_um_get_msg_num_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1201.                         msgReq->msg_type = UM_MSG_TYPE_MMS;
  1202.                         mmi_um_send_message(
  1203.                             MOD_MMI,
  1204.                             MOD_WAP,
  1205.                             0,
  1206.                             PRT_MSG_ID_MMI_UM_GET_MSG_NUM_REQ,
  1207.                             (oslParaType*) msgReq,
  1208.                             NULL);
  1209.                         return;
  1210.                     }
  1211.                     case UM_MSG_TYPE_WAP_PUSH:
  1212.                     {
  1213.                         mmi_um_get_msg_num_req_struct *msgReq;
  1214.                         msgReq = (mmi_um_get_msg_num_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1215.                         msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  1216.                         mmi_um_send_message(
  1217.                             MOD_MMI,
  1218.                             MOD_WAP,
  1219.                             0,
  1220.                             PRT_MSG_ID_MMI_UM_GET_MSG_NUM_REQ,
  1221.                             (oslParaType*) msgReq,
  1222.                             NULL);
  1223.                         return;
  1224.                     }
  1225.                     default:
  1226.                         MMI_ASSERT(0);
  1227.                         return;
  1228.                 }
  1229.             }
  1230.         }
  1231.         MMI_ASSERT(0);
  1232.     }
  1233. }
  1234. /*****************************************************************************
  1235.  * FUNCTION
  1236.  *  mmi_um_handle_get_list_info_rsp
  1237.  * DESCRIPTION
  1238.  *  handle screen flow after getting list info rsp
  1239.  * PARAMETERS
  1240.  *  void
  1241.  * RETURNS
  1242.  *  void
  1243.  *****************************************************************************/
  1244. void mmi_um_handle_get_list_info_rsp(void)
  1245. {
  1246.     /*----------------------------------------------------------------*/
  1247.     /* Local Variables                                                */
  1248.     /*----------------------------------------------------------------*/
  1249.     /*----------------------------------------------------------------*/
  1250.     /* Code Body                                                      */
  1251.     /*----------------------------------------------------------------*/
  1252.     if (g_um_p->main.pending_req_type == 0)
  1253.     {
  1254.         switch (g_um_p->main.state)
  1255.         {
  1256.             case UM_STATE_ENTRY_INBOX:
  1257.             {
  1258.                 if (IsScreenPresent(SCR_ID_UM_INBOX))
  1259.                 {
  1260.                     if (g_um_p->folder.msg_number_in_list == 0)
  1261.                     {
  1262.                         DisplayPopup(
  1263.                             (U8*) GetString(STR_GLOBAL_EMPTY),
  1264.                             IMG_GLOBAL_EMPTY,
  1265.                             1,
  1266.                             UI_POPUP_NOTIFYDURATION_TIME,
  1267.                             (U8) EMPTY_LIST_TONE);
  1268.                         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1269.                         DeleteScreenIfPresent(SCR_ID_UM_INBOX);
  1270.                         g_um_p->main.is_reset_folder_info = KAL_TRUE;
  1271.                         return;
  1272.                     }
  1273.                     mmi_um_get_msg_info_req();                    
  1274.                 }
  1275.                 else
  1276.                 {
  1277.                     mmi_um_entry_folder();
  1278.                 }
  1279.                 break;
  1280.             }
  1281.             case UM_STATE_ENTRY_UNSENT:
  1282.             {
  1283.                 if (IsScreenPresent(SCR_ID_UM_UNSENT))
  1284.                 {
  1285.                     if (g_um_p->folder.msg_number_in_list == 0)
  1286.                     {
  1287.                         DisplayPopup(
  1288.                             (U8*) GetString(STR_GLOBAL_EMPTY),
  1289.                             IMG_GLOBAL_EMPTY,
  1290.                             1,
  1291.                             UI_POPUP_NOTIFYDURATION_TIME,
  1292.                             (U8) EMPTY_LIST_TONE);
  1293.                         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1294.                         DeleteScreenIfPresent(SCR_ID_UM_UNSENT);
  1295.                         g_um_p->main.is_reset_folder_info = KAL_TRUE;
  1296.                         return;
  1297.                     }
  1298.                     mmi_um_get_msg_info_req();  
  1299.                 }
  1300.                 else
  1301.                 {
  1302.                     mmi_um_entry_folder();
  1303.                 }
  1304.                 break;
  1305.             }
  1306.             case UM_STATE_ENTRY_SENT:
  1307.             {
  1308.                 if (IsScreenPresent(SCR_ID_UM_SENT))
  1309.                 {
  1310.                     if (g_um_p->folder.msg_number_in_list == 0)
  1311.                     {
  1312.                         DisplayPopup(
  1313.                             (U8*) GetString(STR_GLOBAL_EMPTY),
  1314.                             IMG_GLOBAL_EMPTY,
  1315.                             1,
  1316.                             UI_POPUP_NOTIFYDURATION_TIME,
  1317.                             (U8) EMPTY_LIST_TONE);
  1318.                         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1319.                         DeleteScreenIfPresent(SCR_ID_UM_SENT);
  1320.                         g_um_p->main.is_reset_folder_info = KAL_TRUE;
  1321.                         return;
  1322.                     }
  1323.                     mmi_um_get_msg_info_req();  
  1324.                 }
  1325.                 else
  1326.                 {
  1327.                     mmi_um_entry_folder();
  1328.                 }
  1329.                 break;
  1330.             }
  1331.             case UM_STATE_ENTRY_DRAFT:
  1332.             {
  1333.                 if (IsScreenPresent(SCR_ID_UM_DRAFT))
  1334.                 {
  1335.                     if (g_um_p->folder.msg_number_in_list == 0)
  1336.                     {
  1337.                         DisplayPopup(
  1338.                             (U8*) GetString(STR_GLOBAL_EMPTY),
  1339.                             IMG_GLOBAL_EMPTY,
  1340.                             1,
  1341.                             UI_POPUP_NOTIFYDURATION_TIME,
  1342.                             (U8) EMPTY_LIST_TONE);
  1343.                         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1344.                         DeleteScreenIfPresent(SCR_ID_UM_DRAFT);
  1345.                         g_um_p->main.is_reset_folder_info = KAL_TRUE;
  1346.                         return;
  1347.                     }
  1348.                     mmi_um_get_msg_info_req();  
  1349.                 }
  1350.                 else
  1351.                 {
  1352.                     mmi_um_entry_folder();
  1353.                 }
  1354.                 break;
  1355.             }            
  1356.             /* If user selects RSK back in progressing screen, reset the list info */
  1357.             default:
  1358.             {
  1359.                 mmi_um_reset_folder_info();
  1360.                 return;
  1361.             }
  1362.         }
  1363.     }
  1364.     else
  1365.     {
  1366.         U8 i = 0;
  1367.         U8 type = 0x01;
  1368.         for (; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  1369.         {
  1370.             if (mmi_um_check_support_type(type) && (type & (g_um_p->main.pending_req_type)))
  1371.             {
  1372.                 switch (type)
  1373.                 {
  1374.                     case UM_MSG_TYPE_SMS:
  1375.                     {
  1376.                         mmi_um_get_list_req_struct *msgReq;
  1377.                         msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1378.                         msgReq->msg_type = UM_MSG_TYPE_SMS;
  1379.                         msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  1380.                         msgReq->start_entry = 0;
  1381.                         mmi_um_send_message(
  1382.                             MOD_MMI,
  1383.                             MOD_MMI,
  1384.                             0,
  1385.                             PRT_MSG_ID_MMI_UM_GET_LIST_REQ,
  1386.                             (oslParaType*) msgReq,
  1387.                             NULL);
  1388.                         return;
  1389.                     }
  1390.                     case UM_MSG_TYPE_MMS:
  1391.                     {
  1392.                         mmi_um_get_list_req_struct *msgReq;
  1393.                         msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1394.                         msgReq->msg_type = UM_MSG_TYPE_MMS;
  1395.                         msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  1396.                         msgReq->start_entry = 0;
  1397.                         mmi_um_send_message(
  1398.                             MOD_MMI,
  1399.                             MOD_WAP,
  1400.                             0,
  1401.                             PRT_MSG_ID_MMI_UM_GET_LIST_REQ,
  1402.                             (oslParaType*) msgReq,
  1403.                             NULL);
  1404.                         return;
  1405.                     }
  1406.                     case UM_MSG_TYPE_WAP_PUSH:
  1407.                     {
  1408.                         mmi_um_get_list_req_struct *msgReq;
  1409.                         msgReq = (mmi_um_get_list_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1410.                         msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  1411.                         msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  1412.                         msgReq->start_entry = 0;
  1413.                         mmi_um_send_message(
  1414.                             MOD_MMI,
  1415.                             MOD_WAP,
  1416.                             0,
  1417.                             PRT_MSG_ID_MMI_UM_GET_LIST_REQ,
  1418.                             (oslParaType*) msgReq,
  1419.                             NULL);
  1420.                         return;
  1421.                     }
  1422.                     default:
  1423.                         MMI_ASSERT(0);
  1424.                         return;
  1425.                 }
  1426.             }
  1427.         }
  1428.         MMI_ASSERT(0);
  1429.     }
  1430. }
  1431. /*****************************************************************************
  1432.  * FUNCTION
  1433.  *  mmi_um_handle_get_msg_info_rsp
  1434.  * DESCRIPTION
  1435.  *  handle screen flow after getting list info rsp
  1436.  * PARAMETERS
  1437.  *  void
  1438.  * RETURNS
  1439.  *  void
  1440.  *****************************************************************************/
  1441. void mmi_um_handle_get_msg_info_rsp(void)
  1442. {
  1443.     /*----------------------------------------------------------------*/
  1444.     /* Local Variables                                                */
  1445.     /*----------------------------------------------------------------*/
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Code Body                                                      */
  1448.     /*----------------------------------------------------------------*/
  1449.     if (g_um_p->main.pending_req_type == 0)
  1450.     {
  1451.         if (mmi_um_is_list_ready())
  1452.         {
  1453.             mmi_um_enter_curr_folder();
  1454.         }
  1455.         else
  1456.         {
  1457.             mmi_um_get_msg_info_req();
  1458.         }
  1459.     }
  1460.     else
  1461.     {
  1462.         U16 i = 0;
  1463.         UmMsgType type = 0x01;
  1464.         for (i = 0; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  1465.         {
  1466.             if (mmi_um_check_support_type(type) && (type & (g_um_p->main.pending_req_type)))
  1467.             {
  1468.                 switch (type)
  1469.                 {
  1470.                     case UM_MSG_TYPE_SMS:
  1471.                     {
  1472.                         if (g_um_p->get_msg_detail.msg_num_to_get_sms > 0)
  1473.                         {
  1474.                             mmi_um_get_msg_info_req_struct *msgReq;
  1475.                             msgReq = (mmi_um_get_msg_info_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1476.                             msgReq->msg_type = UM_MSG_TYPE_SMS;
  1477.                             msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  1478.                             msgReq->start_entry = g_um_p->get_msg_detail.start_index_sms;
  1479.                             msgReq->msg_number = g_um_p->get_msg_detail.msg_num_to_get_sms;
  1480.                             mmi_um_send_message(
  1481.                                 MOD_MMI,
  1482.                                 MOD_MMI,
  1483.                                 0,
  1484.                                 PRT_MSG_ID_MMI_UM_GET_MSG_INFO_REQ,
  1485.                                 (oslParaType*) msgReq,
  1486.                                 NULL);
  1487.                         }
  1488.                         return;
  1489.                     }
  1490.                     case UM_MSG_TYPE_MMS:
  1491.                     {
  1492.                         if (g_um_p->get_msg_detail.msg_num_to_get_mms > 0)
  1493.                         {
  1494.                             mmi_um_get_msg_info_req_struct *msgReq;
  1495.                             msgReq = (mmi_um_get_msg_info_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1496.                             msgReq->msg_type = UM_MSG_TYPE_MMS;
  1497.                             msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  1498.                             msgReq->start_entry = g_um_p->get_msg_detail.start_index_mms;
  1499.                             msgReq->msg_number = g_um_p->get_msg_detail.msg_num_to_get_mms;
  1500.                             mmi_um_send_message(
  1501.                                 MOD_MMI,
  1502.                                 MOD_WAP,
  1503.                                 0,
  1504.                                 PRT_MSG_ID_MMI_UM_GET_MSG_INFO_REQ,
  1505.                                 (oslParaType*) msgReq,
  1506.                                 NULL);
  1507.                         }
  1508.                         return;
  1509.                     }
  1510.                     case UM_MSG_TYPE_WAP_PUSH:
  1511.                     {
  1512.                         mmi_um_get_msg_info_req_struct *msgReq;
  1513.                         if (g_um_p->get_msg_detail.msg_num_to_get_wap_push > 0)
  1514.                         {
  1515.                             msgReq = (mmi_um_get_msg_info_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1516.                             msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  1517.                             msgReq->msg_box_type = g_um_p->folder.current_msg_box;
  1518.                             msgReq->start_entry = g_um_p->get_msg_detail.start_index_wap_push;
  1519.                             msgReq->msg_number = g_um_p->get_msg_detail.msg_num_to_get_wap_push;
  1520.                             mmi_um_send_message(
  1521.                                 MOD_MMI,
  1522.                                 MOD_WAP,
  1523.                                 0,
  1524.                                 PRT_MSG_ID_MMI_UM_GET_MSG_INFO_REQ,
  1525.                                 (oslParaType*) msgReq,
  1526.                                 NULL);
  1527.                         }
  1528.                         return;
  1529.                     }
  1530.                     default:
  1531.                         MMI_ASSERT(0);
  1532.                         return;
  1533.                 }
  1534.             }
  1535.         }
  1536.         MMI_ASSERT(0);
  1537.         return;
  1538.     }
  1539. }
  1540. /*****************************************************************************
  1541.  * FUNCTION
  1542.  *  mmi_um_handle_delete_folder_rsp
  1543.  * DESCRIPTION
  1544.  *  Delete function of delete folder for unified message.
  1545.  * PARAMETERS
  1546.  *  type        [IN]        
  1547.  *  result      [IN]        
  1548.  * RETURNS
  1549.  *  void
  1550.  *****************************************************************************/
  1551. void mmi_um_handle_delete_folder_rsp(UmMsgType type, kal_bool result)
  1552. {
  1553.     /*----------------------------------------------------------------*/
  1554.     /* Local Variables                                                */
  1555.     /*----------------------------------------------------------------*/
  1556.     /*----------------------------------------------------------------*/
  1557.     /* Code Body                                                      */
  1558.     /*----------------------------------------------------------------*/
  1559.     g_um_p->main.pending_req_type &= ~(type);
  1560.     if (!result)
  1561.     {
  1562.         g_um_p->delete_folder.result = KAL_FALSE;
  1563.     }
  1564.     if (g_um_p->main.pending_req_type == 0)
  1565.     {
  1566.         if (g_um_p->delete_folder.result)
  1567.         {
  1568.             DisplayPopup(
  1569.                 (PU8) GetString(STR_GLOBAL_DONE),
  1570.                 IMG_GLOBAL_ACTIVATED,
  1571.                 1,
  1572.                 MESSAGES_POPUP_TIME_OUT,
  1573.                 (U8) SUCCESS_TONE);
  1574.         }
  1575.         else
  1576.         {
  1577.             DisplayPopup(
  1578.                 (PU8) GetString(STR_GLOBAL_UNFINISHED),
  1579.                 IMG_GLOBAL_UNFINISHED,
  1580.                 1,
  1581.                 MESSAGES_POPUP_TIME_OUT,
  1582.                 (U8) ERROR_TONE);
  1583.         }
  1584.         /* Reset the new msg flag if the inbox messages are all deleted. */ 
  1585.         if (g_um_p->delete_folder.folders_to_delete == UM_MSG_BOX_TYPE_INBOX)
  1586.         {
  1587.             g_um_p->main.is_new_msg = KAL_FALSE;
  1588.         }
  1589.         
  1590.         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1591.     }
  1592.     else    /* g_um_p->main.pending_req_type != 0 */
  1593.     {
  1594.         U8 i = 0;
  1595.         U8 type = 0x01;
  1596.         for (; i < MMI_UM_MAX_SUPPORT_MSG_TYPE; i++, type <<= 1)
  1597.         {
  1598.             if (mmi_um_check_support_type(type) && (type & (g_um_p->main.pending_req_type)))
  1599.             {
  1600.                 switch (type)
  1601.                 {
  1602.                     case UM_MSG_TYPE_SMS:
  1603.                     {
  1604.                         mmi_um_delete_folder_req_struct *msgReq;
  1605.                         msgReq = (mmi_um_delete_folder_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1606.                         msgReq->msg_type = UM_MSG_TYPE_SMS;
  1607.                         msgReq->msg_box_type = g_um_p->delete_folder.folders_to_delete;
  1608.                         mmi_um_send_message(
  1609.                             MOD_MMI,
  1610.                             MOD_WAP,
  1611.                             0,
  1612.                             PRT_MSG_ID_MMI_UM_DELETE_FOLDER_REQ,
  1613.                             (oslParaType*) msgReq,
  1614.                             NULL);
  1615.                         return;
  1616.                     }
  1617.                     case UM_MSG_TYPE_MMS:
  1618.                     {
  1619.                         mmi_um_delete_folder_req_struct *msgReq;
  1620.                         msgReq = (mmi_um_delete_folder_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1621.                         msgReq->msg_type = UM_MSG_TYPE_MMS;
  1622.                         msgReq->msg_box_type = g_um_p->delete_folder.folders_to_delete;
  1623.                         mmi_um_send_message(
  1624.                             MOD_MMI,
  1625.                             MOD_WAP,
  1626.                             0,
  1627.                             PRT_MSG_ID_MMI_UM_DELETE_FOLDER_REQ,
  1628.                             (oslParaType*) msgReq,
  1629.                             NULL);
  1630.                         return;
  1631.                     }
  1632.                     case UM_MSG_TYPE_WAP_PUSH:
  1633.                     {
  1634.                         mmi_um_delete_folder_req_struct *msgReq;
  1635.                         msgReq = (mmi_um_delete_folder_req_struct*) OslConstructDataPtr(sizeof(*msgReq));
  1636.                         msgReq->msg_type = UM_MSG_TYPE_WAP_PUSH;
  1637.                         msgReq->msg_box_type = g_um_p->delete_folder.folders_to_delete;
  1638.                         mmi_um_send_message(
  1639.                             MOD_MMI,
  1640.                             MOD_WAP,
  1641.                             0,
  1642.                             PRT_MSG_ID_MMI_UM_DELETE_FOLDER_REQ,
  1643.                             (oslParaType*) msgReq,
  1644.                             NULL);
  1645.                         return;
  1646.                     }
  1647.                     default:
  1648.                         MMI_ASSERT(0);
  1649.                         return;
  1650.                 }
  1651.             }
  1652.         }
  1653.         MMI_ASSERT(0);
  1654.         return;
  1655.     }
  1656. }
  1657. /*****************************************************************************
  1658.  * FUNCTION
  1659.  *  mmi_um_send_message
  1660.  * DESCRIPTION
  1661.  *  Common function for sending message
  1662.  * PARAMETERS
  1663.  *  MOD_SRC         [IN]        Source module
  1664.  *  MOD_DEST        [IN]        Destination module
  1665.  *  MSG_SAP         [IN]        Message SAP
  1666.  *  MSG_ID          [IN]        Message ID
  1667.  *  LOCAL           [IN]        Local parameter
  1668.  *  PEER            [IN]        Peer buffer
  1669.  * RETURNS
  1670.  *  void
  1671.  *****************************************************************************/
  1672. void mmi_um_send_message(
  1673.         module_type MOD_SRC,
  1674.         module_type MOD_DEST,
  1675.         U8 MSG_SAP,
  1676.         const U16 MSG_ID,
  1677.         void *LOCAL,
  1678.         void *PEER)
  1679. {
  1680.     /*----------------------------------------------------------------*/
  1681.     /* Local Variables                                                */
  1682.     /*----------------------------------------------------------------*/
  1683.     MYQUEUE Message;
  1684.     /*----------------------------------------------------------------*/
  1685.     /* Code Body                                                      */
  1686.     /*----------------------------------------------------------------*/
  1687.     Message.oslSrcId = MOD_SRC;
  1688.     Message.oslDestId = MOD_DEST;
  1689.     Message.oslSapId = MSG_SAP;
  1690.     Message.oslMsgId = MSG_ID;
  1691.     Message.oslDataPtr = LOCAL;
  1692.     Message.oslPeerBuffPtr = PEER;
  1693.     OslMsgSendExtQueue(&Message);
  1694. }
  1695. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  1696. #endif /* _MMI_UNIFIED_MESSAGE_MSG_C */