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

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.  * UnifiedMessageUIInterface.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  * MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  * This file implements UI interface of Unified Message application.
  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.  * removed!
  116.  * removed!
  117.  * removed!
  118.  * removed!
  119.  *
  120.  *------------------------------------------------------------------------------
  121.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  122.  *============================================================================
  123.  ****************************************************************************/
  124. #ifndef _MMI_UNIFIED_MESSAGE_UIINTERFACE_C
  125. #define _MMI_UNIFIED_MESSAGE_UIINTERFACE_C
  126. #include "MMI_features.h"
  127. #ifdef __MMI_UNIFIED_MESSAGE__
  128. #include "stdC.h"
  129. #include "L4Dr1.h"
  130. #include "FileSystemDef.h"
  131. #include "FileMgr.h"
  132. #include "FileManagerGprot.h"
  133. #include "mdi_datatype.h"
  134. #include "mdi_audio.h"
  135. /* micha1230 */
  136. #include "custom_nvram_editor_data_item.h"
  137. #include "custom_data_account.h"
  138. #include "MessagesExDcl.h"
  139. #include "MessagesResourceData.h"
  140. #include "KeyBrd.h"
  141. #include "GlobalDefs.h"
  142. #include "DebugInitDef.h"
  143. #include "GlobalConstants.h"
  144. #include "FrameworkStruct.h"
  145. #include "EventsGprot.h"
  146. #include "HistoryGprot.h"
  147. #include "wgui_ems.h"
  148. #include "wgui_categories.h"
  149. #include "wgui_status_icons.h"
  150. #include "CommonScreens.h"
  151. #include "CustDataRes.h"
  152. #include "SettingProfile.h"
  153. #include "ProfileGprots.h"
  154. #include "SubLCDHistoryGprot.h"
  155. #include "PhoneBookGprot.h"
  156. #include "TimerEvents.h"
  157. #include "PhoneBookDef.h"
  158. #include "FileSystemDef.h"
  159. #include "FileSystemGProt.h"
  160. #include "Conversions.h"
  161. #include "MemPoolContainerProt.h"
  162. #include "wgui_asyncdynamic_menuitems.h"
  163. #include "Wgui_categories_inputs.h"
  164. #include "Wgui_categories_defs.h"
  165. #include "GlobalScrEnum.h"
  166. #include "Gdi_include.h"
  167. #include "Wgui_categories_multimedia.h"
  168. #include "Wgui_categories_popup.h"
  169. #include "AudioPlayerProt.h"
  170. #include "VdoPlyGProt.h"
  171. #include "CallManagementGprot.h"
  172. #include "mmi_trc.h"    /* debug info */
  173. #include "CommonScreens.h"
  174. #include "fmt_struct.h"
  175. #include "DateTimeGprot.h"
  176. #include "MessagesMiscell.h"
  177. #include "SmsGuiInterfaceProt.h"
  178. #include "EventsDef.h"
  179. #include "wgui_categories_email.h"
  180. #include "wapadp.h"
  181. #include "IdleAppDef.h"
  182. #include "UnifiedMessageDef.h"
  183. #include "UnifiedMessageGProt.h"
  184. #include "UnifiedMessageProt.h"
  185. #ifdef __MMI_UNIFIED_COMPOSER__
  186. #include "UnifiedComposerGProt.h"
  187. #endif /* __MMI_UNIFIED_COMPOSER__ */
  188. static S8 *mmi_um_string = NULL;
  189. /*****************************************************************************
  190.  * FUNCTION
  191.  *  mmi_um_highlight_main_menu
  192.  * DESCRIPTION
  193.  *  Highlight handler of unified message menu in Mesaage screen.
  194.  * PARAMETERS
  195.  *  void
  196.  * RETURNS
  197.  *  void
  198.  *****************************************************************************/
  199. void mmi_um_highlight_main_menu(void)
  200. {
  201.     /*----------------------------------------------------------------*/
  202.     /* Local Variables                                                */
  203.     /*----------------------------------------------------------------*/
  204.     /*----------------------------------------------------------------*/
  205.     /* Code Body                                                      */
  206.     /*----------------------------------------------------------------*/
  207.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  208.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  209.     SetLeftSoftkeyFunction(mmi_um_pre_entry_main, KEY_EVENT_UP);
  210.     SetKeyHandler(mmi_um_pre_entry_main, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  211.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  212.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  213. }
  214.  
  215. /*****************************************************************************
  216.  * FUNCTION
  217.  *  mmi_um_pre_entry_main
  218.  * DESCRIPTION
  219.  *  Pre-entry function of unified message.
  220.  * PARAMETERS
  221.  *  void
  222.  * RETURNS
  223.  *  void
  224.  *****************************************************************************/
  225. void mmi_um_pre_entry_main(void)
  226. {
  227.     /*----------------------------------------------------------------*/
  228.     /* Local Variables                                                */
  229.     /*----------------------------------------------------------------*/
  230.     /*----------------------------------------------------------------*/
  231.     /* Code Body                                                      */
  232.     /*----------------------------------------------------------------*/
  233.     mmi_um_set_state(UM_STATE_ENTRY_MAIN_MENU);
  234.     ClearInputEventHandler(MMI_DEVICE_ALL);
  235.     if (!mmi_um_check_ready())
  236.     {
  237.         mmi_um_set_processing_screen(STR_UM_MAIN_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, STR_GLOBAL_BACK);
  238.         mmi_um_entry_processing_generic();
  239.         return;
  240.     }
  241.     if (!CheckIsBackHistory())
  242.     {
  243.         if (!g_um_p->main.is_refresh)
  244.         {
  245.             g_um_p->main.main_index = 0;
  246.         }
  247.     }
  248.     mmi_um_get_msg_num_req();
  249.     /* Receive ready ind in processing screen */
  250.     /* DeleteScreenIfPresent(SCR_ID_UM_PROCESSING); */
  251. }
  252. /*****************************************************************************
  253.  * FUNCTION
  254.  *  mmi_um_entry_main
  255.  * DESCRIPTION
  256.  *  Entry function of unified message.
  257.  * PARAMETERS
  258.  *  void
  259.  * RETURNS
  260.  *  void
  261.  *****************************************************************************/
  262. void mmi_um_entry_main(void)
  263. {
  264.     /*----------------------------------------------------------------*/
  265.     /* Local Variables                                                */
  266.     /*----------------------------------------------------------------*/
  267.     U8 *guiBuffer;
  268.     U16 nStrItemList[MAX_SUB_MENUS];
  269.     U16 numItems;
  270.     U16 itemIcons[MAX_SUB_MENUS];
  271.     U8 *popUpList[MAX_SUB_MENUS];
  272.     /*----------------------------------------------------------------*/
  273.     /* Code Body                                                      */
  274.     /*----------------------------------------------------------------*/
  275.     if (IsScreenPresent(SCR_ID_UM_PROCESSING))
  276.     {
  277.         HistoryReplace(SCR_ID_UM_PROCESSING, SCR_ID_UM_MAIN, mmi_um_pre_entry_main);
  278.         return;
  279.     }
  280.     EntryNewScreen(SCR_ID_UM_MAIN, mmi_um_exit_generic, mmi_um_pre_entry_main, NULL);
  281.     mmi_um_set_state(UM_STATE_ENTRY_MAIN_MENU);
  282.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UM_MAIN);
  283.     SetParentHandler(MENU_ID_UM_MAIN);
  284.     RegisterHighlightHandler(mmi_um_main_highlight_handler);
  285.     numItems = GetNumOfChild_Ext(MENU_ID_UM_MAIN);
  286.     GetSequenceStringIds_Ext(MENU_ID_UM_MAIN, nStrItemList);
  287.     GetSequenceImageIds_Ext(MENU_ID_UM_MAIN, itemIcons);
  288.     /* reset current msg index and msg box */
  289.     g_um_p->folder.current_msg_index = 0;
  290.     g_um_p->folder.current_msg_box = 0;
  291.     mmi_um_set_main_menu_highlight_handler();
  292.     ConstructHintsList(MENU_ID_UM_MAIN, popUpList);
  293.     ShowCategory52Screen(
  294.         STR_UM_MAIN_ID,
  295.         IMG_UM_ENTRY_SCRN_CAPTION,
  296.         STR_GLOBAL_OK,
  297.         IMG_GLOBAL_OK,
  298.         STR_GLOBAL_BACK,
  299.         IMG_GLOBAL_BACK,
  300.         numItems,
  301.         nStrItemList,
  302.         itemIcons,
  303.         (U8 **) popUpList,
  304.         0,
  305.         g_um_p->main.main_index,
  306.         guiBuffer);
  307.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  308.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  309.     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  310.     /* refresh case */
  311.     DeleteScreenIfPresent(SCR_ID_UM_MAIN);
  312. }
  313. /*****************************************************************************
  314.  * FUNCTION
  315.  *  mmi_um_main_highlight_handler
  316.  * DESCRIPTION
  317.  *  Set main menu highlight handler for um app.
  318.  * PARAMETERS
  319.  *  index       [IN]        
  320.  * RETURNS
  321.  *  void
  322.  *****************************************************************************/
  323. void mmi_um_main_highlight_handler(S32 index)
  324. {
  325.     /*----------------------------------------------------------------*/
  326.     /* Local Variables                                                */
  327.     /*----------------------------------------------------------------*/
  328.     /*----------------------------------------------------------------*/
  329.     /* Code Body                                                      */
  330.     /*----------------------------------------------------------------*/
  331.     g_um_p->main.main_index = index;
  332.     ExecuteCurrHiliteHandler(index);
  333. }
  334. /*****************************************************************************
  335.  * FUNCTION
  336.  *  mmi_um_set_main_menu_highlight_handler
  337.  * DESCRIPTION
  338.  *  Set main menu highlight handler for um app.
  339.  * PARAMETERS
  340.  *  void
  341.  * RETURNS
  342.  *  void
  343.  *****************************************************************************/
  344. void mmi_um_set_main_menu_highlight_handler(void)
  345. {
  346.     /*----------------------------------------------------------------*/
  347.     /* Local Variables                                                */
  348.     /*----------------------------------------------------------------*/
  349.     /*----------------------------------------------------------------*/
  350.     /* Code Body                                                      */
  351.     /*----------------------------------------------------------------*/
  352.     /* set the menu hilite handlers */
  353.     SetHiliteHandler(MENU_ID_UM_WRITE_MSG, mmi_um_highlight_write_msg);
  354.     SetHiliteHandler(MENU_ID_UM_INBOX, mmi_um_highlight_inbox);
  355.     SetHiliteHandler(MENU_ID_UM_UNSENT, mmi_um_highlight_unsent);
  356.     SetHiliteHandler(MENU_ID_UM_SENT, mmi_um_highlight_sent);
  357.     SetHiliteHandler(MENU_ID_UM_DRAFT, mmi_um_highlight_draft);
  358.     SetHiliteHandler(MENU_ID_UM_DELETE_FOLDER, mmi_um_highlight_delete_folder);
  359.     SetHiliteHandler(MENU_ID_UM_TEMPLATE, mmi_um_highlight_template);
  360.     SetHiliteHandler(MENU_ID_UM_SETTING, mmi_um_highlight_setting);
  361.     /* set the menu hint handlers */
  362.     SetHintHandler(MENU_ID_UM_INBOX, mmi_um_hint_inbox);
  363.     SetHintHandler(MENU_ID_UM_UNSENT, mmi_um_hint_unsent);
  364.     SetHintHandler(MENU_ID_UM_SENT, mmi_um_hint_sent);
  365.     SetHintHandler(MENU_ID_UM_DRAFT, mmi_um_hint_draft);
  366.     return;
  367. }
  368. /*****************************************************************************
  369.  * FUNCTION
  370.  *  mmi_um_highlight_write_msg
  371.  * DESCRIPTION
  372.  *  Funtion is called when write message menu item selected
  373.  * NA
  374.  *  
  375.  * PARAMETERS
  376.  *  void
  377.  * RETURNS
  378.  *  void
  379.  *****************************************************************************/
  380. void mmi_um_highlight_write_msg(void)
  381. {
  382.     /*----------------------------------------------------------------*/
  383.     /* Local Variables                                                */
  384.     /*----------------------------------------------------------------*/
  385.     /*----------------------------------------------------------------*/
  386.     /* Code Body                                                      */
  387.     /*----------------------------------------------------------------*/
  388. #ifdef __MMI_UNIFIED_COMPOSER__
  389.     SetLeftSoftkeyFunction(mmi_uc_pre_entry_write_msg, KEY_EVENT_UP);
  390.     SetKeyHandler(mmi_uc_pre_entry_write_msg, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  391.     
  392. #else /* __MMI_UNIFIED_COMPOSER__ */
  393.     SetLeftSoftkeyFunction(mmi_um_entry_write_msg, KEY_EVENT_UP);
  394.     SetKeyHandler(mmi_um_entry_write_msg, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  395.     
  396. #endif /* __MMI_UNIFIED_COMPOSER__ */
  397.     return;
  398. }
  399. /*****************************************************************************
  400.  * FUNCTION
  401.  *  mmi_um_highlight_inbox
  402.  * DESCRIPTION
  403.  *  Funtion is called when inbox menu item selected
  404.  * NA
  405.  *  
  406.  * PARAMETERS
  407.  *  void
  408.  * RETURNS
  409.  *  void
  410.  *****************************************************************************/
  411. void mmi_um_highlight_inbox(void)
  412. {
  413.     /*----------------------------------------------------------------*/
  414.     /* Local Variables                                                */
  415.     /*----------------------------------------------------------------*/
  416.     /*----------------------------------------------------------------*/
  417.     /* Code Body                                                      */
  418.     /*----------------------------------------------------------------*/
  419.     SetLeftSoftkeyFunction(mmi_um_pre_entry_inbox, KEY_EVENT_UP);
  420.     SetKeyHandler(mmi_um_pre_entry_inbox, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  421.     return;
  422. }
  423. /*****************************************************************************
  424.  * FUNCTION
  425.  *  mmi_um_highlight_unsent
  426.  * DESCRIPTION
  427.  *  Funtion is called when unsent menu item selected
  428.  * NA
  429.  *  
  430.  * PARAMETERS
  431.  *  void
  432.  * RETURNS
  433.  *  void
  434.  *****************************************************************************/
  435. void mmi_um_highlight_unsent(void)
  436. {
  437.     /*----------------------------------------------------------------*/
  438.     /* Local Variables                                                */
  439.     /*----------------------------------------------------------------*/
  440.     /*----------------------------------------------------------------*/
  441.     /* Code Body                                                      */
  442.     /*----------------------------------------------------------------*/
  443.     SetLeftSoftkeyFunction(mmi_um_pre_entry_unsent, KEY_EVENT_UP);
  444.     SetKeyHandler(mmi_um_pre_entry_unsent, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  445.     return;
  446. }
  447. /*****************************************************************************
  448.  * FUNCTION
  449.  *  mmi_um_highlight_sent
  450.  * DESCRIPTION
  451.  *  Funtion is called when sent menu item selected
  452.  * NA
  453.  *  
  454.  * PARAMETERS
  455.  *  void
  456.  * RETURNS
  457.  *  void
  458.  *****************************************************************************/
  459. void mmi_um_highlight_sent(void)
  460. {
  461.     /*----------------------------------------------------------------*/
  462.     /* Local Variables                                                */
  463.     /*----------------------------------------------------------------*/
  464.     /*----------------------------------------------------------------*/
  465.     /* Code Body                                                      */
  466.     /*----------------------------------------------------------------*/
  467.     SetLeftSoftkeyFunction(mmi_um_pre_entry_sent, KEY_EVENT_UP);
  468.     SetKeyHandler(mmi_um_pre_entry_sent, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  469.     return;
  470. }
  471. /*****************************************************************************
  472.  * FUNCTION
  473.  *  mmi_um_highlight_draft
  474.  * DESCRIPTION
  475.  *  Funtion is called when draft menu item selected
  476.  * NA
  477.  *  
  478.  * PARAMETERS
  479.  *  void
  480.  * RETURNS
  481.  *  void
  482.  *****************************************************************************/
  483. void mmi_um_highlight_draft(void)
  484. {
  485.     /*----------------------------------------------------------------*/
  486.     /* Local Variables                                                */
  487.     /*----------------------------------------------------------------*/
  488.     /*----------------------------------------------------------------*/
  489.     /* Code Body                                                      */
  490.     /*----------------------------------------------------------------*/
  491.     SetLeftSoftkeyFunction(mmi_um_pre_entry_draft, KEY_EVENT_UP);
  492.     SetKeyHandler(mmi_um_pre_entry_draft, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  493.     return;
  494. }
  495. /*****************************************************************************
  496.  * FUNCTION
  497.  *  mmi_um_highlight_delete_folder
  498.  * DESCRIPTION
  499.  *  Funtion is called when delete folder menu item selected
  500.  * NA
  501.  *  
  502.  * PARAMETERS
  503.  *  void
  504.  * RETURNS
  505.  *  void
  506.  *****************************************************************************/
  507. void mmi_um_highlight_delete_folder(void)
  508. {
  509.     /*----------------------------------------------------------------*/
  510.     /* Local Variables                                                */
  511.     /*----------------------------------------------------------------*/
  512.     /*----------------------------------------------------------------*/
  513.     /* Code Body                                                      */
  514.     /*----------------------------------------------------------------*/
  515.     SetLeftSoftkeyFunction(mmi_um_pre_entry_delete_folder, KEY_EVENT_UP);
  516.     SetKeyHandler(mmi_um_pre_entry_delete_folder, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  517.     return;
  518. }
  519. /*****************************************************************************
  520.  * FUNCTION
  521.  *  mmi_um_highlight_template
  522.  * DESCRIPTION
  523.  *  Funtion is called when template menu item selected
  524.  * NA
  525.  *  
  526.  * PARAMETERS
  527.  *  void
  528.  * RETURNS
  529.  *  void
  530.  *****************************************************************************/
  531. void mmi_um_highlight_template(void)
  532. {
  533.     /*----------------------------------------------------------------*/
  534.     /* Local Variables                                                */
  535.     /*----------------------------------------------------------------*/
  536.     /*----------------------------------------------------------------*/
  537.     /* Code Body                                                      */
  538.     /*----------------------------------------------------------------*/
  539.     SetLeftSoftkeyFunction(mmi_um_entry_template, KEY_EVENT_UP);
  540.     SetKeyHandler(mmi_um_entry_template, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  541.     return;
  542. }
  543. /*****************************************************************************
  544.  * FUNCTION
  545.  *  mmi_um_highlight_setting
  546.  * DESCRIPTION
  547.  *  Funtion is called when setting menu item selected
  548.  * NA
  549.  *  
  550.  * PARAMETERS
  551.  *  void
  552.  * RETURNS
  553.  *  void
  554.  *****************************************************************************/
  555. void mmi_um_highlight_setting(void)
  556. {
  557.     /*----------------------------------------------------------------*/
  558.     /* Local Variables                                                */
  559.     /*----------------------------------------------------------------*/
  560.     /*----------------------------------------------------------------*/
  561.     /* Code Body                                                      */
  562.     /*----------------------------------------------------------------*/
  563.     SetLeftSoftkeyFunction(mmi_um_entry_setting, KEY_EVENT_UP);
  564.     SetKeyHandler(mmi_um_entry_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  565.     return;
  566. }
  567. /*****************************************************************************
  568.  * FUNCTION
  569.  *  mmi_um_hint_inbox
  570.  * DESCRIPTION
  571.  *  To construct hint popup for inbox
  572.  * NA
  573.  *  
  574.  * PARAMETERS
  575.  *  index       [IN]        Of the current menu item
  576.  * RETURNS
  577.  *  void
  578.  *****************************************************************************/
  579. void mmi_um_hint_inbox(U16 index)
  580. {
  581.     /*----------------------------------------------------------------*/
  582.     /* Local Variables                                                */
  583.     /*----------------------------------------------------------------*/
  584.     U8 value[MAX_SUB_MENU_HINT_SIZE];
  585.     /*----------------------------------------------------------------*/
  586.     /* Code Body                                                      */
  587.     /*----------------------------------------------------------------*/
  588.     /* reinitialize the hint data */
  589.     memset((PS8) hintData[index], 0, sizeof(hintData[index]));
  590.     sprintf((S8*) value, "%d ", g_um_p->msg_number.inbox_msg_number);
  591.     AnsiiToUnicodeString((PS8) hintData[index], (PS8) value);
  592.     pfnUnicodeStrncat((PS8) hintData[index], (S8*) GetString(STR_UM_MSG_ID), MMI_UM_MAX_GET_STRING_LEN);
  593.     return;
  594. }
  595. /*****************************************************************************
  596.  * FUNCTION
  597.  *  mmi_um_hint_unsent
  598.  * DESCRIPTION
  599.  *  To construct hint popup for unsent
  600.  * NA
  601.  *  
  602.  * PARAMETERS
  603.  *  index       [IN]        Of the current menu item
  604.  * RETURNS
  605.  *  void
  606.  *****************************************************************************/
  607. void mmi_um_hint_unsent(U16 index)
  608. {
  609.     /*----------------------------------------------------------------*/
  610.     /* Local Variables                                                */
  611.     /*----------------------------------------------------------------*/
  612.     U8 value[MAX_SUB_MENU_HINT_SIZE];
  613.     /*----------------------------------------------------------------*/
  614.     /* Code Body                                                      */
  615.     /*----------------------------------------------------------------*/
  616.     /* reinitialize the hint data */
  617.     memset((PS8) hintData[index], 0, sizeof(hintData[index]));
  618.     sprintf((S8*) value, "%d ", g_um_p->msg_number.unsent_msg_number);
  619.     AnsiiToUnicodeString((PS8) hintData[index], (PS8) value);
  620.     pfnUnicodeStrncat((PS8) hintData[index], (S8*) GetString(STR_UM_MSG_ID), MMI_UM_MAX_GET_STRING_LEN);
  621.     return;
  622. }
  623. /*****************************************************************************
  624.  * FUNCTION
  625.  *  mmi_um_hint_sent
  626.  * DESCRIPTION
  627.  *  To construct hint popup for sent
  628.  * NA
  629.  *  
  630.  * PARAMETERS
  631.  *  index       [IN]        Of the current menu item
  632.  * RETURNS
  633.  *  void
  634.  *****************************************************************************/
  635. void mmi_um_hint_sent(U16 index)
  636. {
  637.     /*----------------------------------------------------------------*/
  638.     /* Local Variables                                                */
  639.     /*----------------------------------------------------------------*/
  640.     U8 value[MAX_SUB_MENU_HINT_SIZE];
  641.     /*----------------------------------------------------------------*/
  642.     /* Code Body                                                      */
  643.     /*----------------------------------------------------------------*/
  644.     /* reinitialize the hint data */
  645.     memset((PS8) hintData[index], 0, sizeof(hintData[index]));
  646.     sprintf((S8*) value, "%d ", g_um_p->msg_number.sent_msg_number);
  647.     AnsiiToUnicodeString((PS8) hintData[index], (PS8) value);
  648.     pfnUnicodeStrncat((PS8) hintData[index], (S8*) GetString(STR_UM_MSG_ID), MMI_UM_MAX_GET_STRING_LEN);
  649.     return;
  650. }
  651. /*****************************************************************************
  652.  * FUNCTION
  653.  *  mmi_um_hint_draft
  654.  * DESCRIPTION
  655.  *  To construct hint popup for draft
  656.  * NA
  657.  *  
  658.  * PARAMETERS
  659.  *  index       [IN]        Of the current menu item
  660.  * RETURNS
  661.  *  void
  662.  *****************************************************************************/
  663. void mmi_um_hint_draft(U16 index)
  664. {
  665.     /*----------------------------------------------------------------*/
  666.     /* Local Variables                                                */
  667.     /*----------------------------------------------------------------*/
  668.     U8 value[MAX_SUB_MENU_HINT_SIZE];
  669.     /*----------------------------------------------------------------*/
  670.     /* Code Body                                                      */
  671.     /*----------------------------------------------------------------*/
  672.     /* reinitialize the hint data */
  673.     memset((PS8) hintData[index], 0, sizeof(hintData[index]));
  674.     sprintf((S8*) value, "%d ", g_um_p->msg_number.draft_msg_number);
  675.     AnsiiToUnicodeString((PS8) hintData[index], (PS8) value);
  676.     pfnUnicodeStrncat((PS8) hintData[index], (S8*) GetString(STR_UM_MSG_ID), MMI_UM_MAX_GET_STRING_LEN);
  677.     return;
  678. }
  679. /*****************************************************************************
  680.  * FUNCTION
  681.  *  mmi_um_entry_write_msg
  682.  * DESCRIPTION
  683.  *  Entry function of write message for unified message.
  684.  * NA
  685.  *  
  686.  * PARAMETERS
  687.  *  void
  688.  * RETURNS
  689.  *  void
  690.  *****************************************************************************/
  691. void mmi_um_entry_write_msg(void)
  692. {
  693.     /*----------------------------------------------------------------*/
  694.     /* Local Variables                                                */
  695.     /*----------------------------------------------------------------*/
  696.     U8 *guiBuffer;
  697.     U16 nStrItemList[MAX_SUB_MENUS];
  698.     U16 numItems;
  699.     U16 itemIcons[MAX_SUB_MENUS];
  700.     U8 *popUpList[MAX_SUB_MENUS];
  701.     /*----------------------------------------------------------------*/
  702.     /* Code Body                                                      */
  703.     /*----------------------------------------------------------------*/
  704.     ClearInputEventHandler(MMI_DEVICE_ALL);
  705.     /* If not back from history, reset the flag. */
  706.     if (!CheckIsBackHistory())
  707.     {
  708.         mmi_um_skip_write_menu(KAL_FALSE);
  709.     }
  710.     if (g_um_p->main.is_skip_write_menu)
  711.     {
  712.         mmi_um_skip_write_menu(KAL_FALSE);
  713.         DeleteScreenIfPresent(SCR_ID_UM_WRITE_MSG);
  714.         GoBackHistory();
  715.         return;
  716.     }
  717.     EntryNewScreen(SCR_ID_UM_WRITE_MSG, mmi_um_exit_generic, mmi_um_entry_write_msg, NULL);
  718.     mmi_um_set_state(UM_STATE_ENTRY_WRTIE_MSG);
  719.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UM_WRITE_MSG);
  720.     SetParentHandler(MENU_ID_UM_WRITE_MSG);
  721.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  722.     numItems = GetNumOfChild_Ext(MENU_ID_UM_WRITE_MSG);
  723.     GetSequenceStringIds_Ext(MENU_ID_UM_WRITE_MSG, nStrItemList);
  724.     GetSequenceImageIds_Ext(MENU_ID_UM_WRITE_MSG, itemIcons);
  725.     SetHiliteHandler(MENU_ID_UM_WRITE_MSG_SMS, mmi_um_highlight_write_msg_sms);
  726.     SetHiliteHandler(MENU_ID_UM_WRITE_MSG_MMS, mmi_um_highlight_write_msg_mms);
  727.     ConstructHintsList(MENU_ID_UM_WRITE_MSG, popUpList);
  728.     ShowCategory52Screen(
  729.         STR_UM_WRITE_MSG_ID,
  730.         IMG_UM_ENTRY_SCRN_CAPTION,
  731.         STR_GLOBAL_OK,
  732.         IMG_GLOBAL_OK,
  733.         STR_GLOBAL_BACK,
  734.         IMG_GLOBAL_BACK,
  735.         numItems,
  736.         nStrItemList,
  737.         itemIcons,
  738.         (U8 **) popUpList,
  739.         0,
  740.         0,
  741.         guiBuffer);
  742.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  743.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  744. }
  745. /*****************************************************************************
  746.  * FUNCTION
  747.  *  mmi_um_highlight_write_msg_sms
  748.  * DESCRIPTION
  749.  *  Funtion is called when write sms msg menu item selected
  750.  * NA
  751.  *  
  752.  * PARAMETERS
  753.  *  void
  754.  * RETURNS
  755.  *  void
  756.  *****************************************************************************/
  757. void mmi_um_highlight_write_msg_sms(void)
  758. {
  759.     /*----------------------------------------------------------------*/
  760.     /* Local Variables                                                */
  761.     /*----------------------------------------------------------------*/
  762.     /*----------------------------------------------------------------*/
  763.     /* Code Body                                                      */
  764.     /*----------------------------------------------------------------*/
  765.     SetLeftSoftkeyFunction(mmi_msg_um_entry_write, KEY_EVENT_UP);
  766.     SetKeyHandler(mmi_msg_um_entry_write, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  767.     return;
  768. }
  769. /*****************************************************************************
  770.  * FUNCTION
  771.  *  mmi_um_highlight_write_msg_mms
  772.  * DESCRIPTION
  773.  *  Funtion is called when write mms msg menu item selected
  774.  * NA
  775.  *  
  776.  * PARAMETERS
  777.  *  void
  778.  * RETURNS
  779.  *  void
  780.  *****************************************************************************/
  781. void mmi_um_highlight_write_msg_mms(void)
  782. {
  783.     /*----------------------------------------------------------------*/
  784.     /* Local Variables                                                */
  785.     /*----------------------------------------------------------------*/
  786.     /*----------------------------------------------------------------*/
  787.     /* Code Body                                                      */
  788.     /*----------------------------------------------------------------*/
  789.     SetLeftSoftkeyFunction(wap_um_entry_write_mms, KEY_EVENT_UP);
  790.     SetKeyHandler(wap_um_entry_write_mms, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  791.     return;
  792. }
  793.  
  794. /*****************************************************************************
  795.  * FUNCTION
  796.  *  mmi_um_pre_entry_delete_folder
  797.  * DESCRIPTION
  798.  *  Pre-entry function of delete folder for unified message.
  799.  * PARAMETERS
  800.  *  void
  801.  * RETURNS
  802.  *  void
  803.  *****************************************************************************/
  804. void mmi_um_pre_entry_delete_folder(void)
  805. {
  806.     /*----------------------------------------------------------------*/
  807.     /* Local Variables                                                */
  808.     /*----------------------------------------------------------------*/
  809.     /*----------------------------------------------------------------*/
  810.     /* Code Body                                                      */
  811.     /*----------------------------------------------------------------*/
  812.     mmi_um_set_state(UM_STATE_ENTRY_DELETE_FOLDER);
  813.     ClearInputEventHandler(MMI_DEVICE_ALL);
  814.     if (!mmi_um_check_ready())
  815.     {
  816.         mmi_um_set_processing_screen(STR_UM_DELETE_FOLDER_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, STR_GLOBAL_BACK);
  817.         mmi_um_entry_processing_generic();
  818.         return;
  819.     }
  820.     if (!CheckIsBackHistory())
  821.     {
  822.         if (!g_um_p->main.is_refresh)
  823.         {
  824.             g_um_p->delete_folder.folder_type = 0;
  825.         }
  826.     }
  827.     mmi_um_get_msg_num_req();
  828.     /* Receive ready ind in processing screen */
  829.     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  830. }
  831. /*****************************************************************************
  832.  * FUNCTION
  833.  *  mmi_um_entry_delete_folder
  834.  * DESCRIPTION
  835.  *  Entry function of delete folder for unified message.
  836.  * PARAMETERS
  837.  *  void
  838.  * RETURNS
  839.  *  void
  840.  *****************************************************************************/
  841. void mmi_um_entry_delete_folder(void)
  842. {
  843.     /*----------------------------------------------------------------*/
  844.     /* Local Variables                                                */
  845.     /*----------------------------------------------------------------*/
  846.     U8 *guiBuffer;
  847.     U16 nStrItemList[MAX_SUB_MENUS];
  848.     U16 numItems;
  849.     U16 itemIcons[MAX_SUB_MENUS];
  850.     U8 *popUpList[MAX_SUB_MENUS];
  851.     /*----------------------------------------------------------------*/
  852.     /* Code Body                                                      */
  853.     /*----------------------------------------------------------------*/
  854.     EntryNewScreen(SCR_ID_UM_DELETE_FOLDER, mmi_um_exit_generic, mmi_um_pre_entry_delete_folder, NULL);
  855.     mmi_um_set_state(UM_STATE_ENTRY_DELETE_FOLDER);
  856.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UM_DELETE_FOLDER);
  857.     SetParentHandler(MENU_ID_UM_DELETE_FOLDER);
  858.     RegisterHighlightHandler(mmi_um_delete_folder_highlight_handler);
  859.     numItems = GetNumOfChild_Ext(MENU_ID_UM_DELETE_FOLDER);
  860.     GetSequenceStringIds_Ext(MENU_ID_UM_DELETE_FOLDER, nStrItemList);
  861.     GetSequenceImageIds_Ext(MENU_ID_UM_DELETE_FOLDER, itemIcons);
  862.     mmi_um_set_delete_folder_highlight_handler();
  863.     ConstructHintsList(MENU_ID_UM_DELETE_FOLDER, popUpList);
  864.     ShowCategory52Screen(
  865.         STR_UM_DELETE_FOLDER_ID,
  866.         IMG_UM_ENTRY_SCRN_CAPTION,
  867.         STR_GLOBAL_OK,
  868.         IMG_GLOBAL_OK,
  869.         STR_GLOBAL_BACK,
  870.         IMG_GLOBAL_BACK,
  871.         numItems,
  872.         nStrItemList,
  873.         itemIcons,
  874.         (U8 **) popUpList,
  875.         0,
  876.         g_um_p->delete_folder.folder_type,
  877.         guiBuffer);
  878.     SetLeftSoftkeyFunction(mmi_um_pre_delete_folder, KEY_EVENT_UP);
  879.     SetKeyHandler(mmi_um_pre_delete_folder, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  880.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  881.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  882.     /* refresh case */
  883.     DeleteScreenIfPresent(SCR_ID_UM_DELETE_FOLDER);
  884. }
  885. /*****************************************************************************
  886.  * FUNCTION
  887.  *  mmi_um_delete_folder_highlight_handler
  888.  * DESCRIPTION
  889.  *  delete folder menu highlight handler for um app.
  890.  * PARAMETERS
  891.  *  index       [IN]        
  892.  * RETURNS
  893.  *  void
  894.  *****************************************************************************/
  895. void mmi_um_delete_folder_highlight_handler(S32 index)
  896. {
  897.     /*----------------------------------------------------------------*/
  898.     /* Local Variables                                                */
  899.     /*----------------------------------------------------------------*/
  900.     /*----------------------------------------------------------------*/
  901.     /* Code Body                                                      */
  902.     /*----------------------------------------------------------------*/
  903.     g_um_p->delete_folder.folder_type = (U8) index;
  904. }
  905. /*****************************************************************************
  906.  * FUNCTION
  907.  *  mmi_um_set_delete_folder_highlight_handler
  908.  * DESCRIPTION
  909.  *  Set delete folder menu highlight handler for um app.
  910.  * PARAMETERS
  911.  *  void
  912.  * RETURNS
  913.  *  void
  914.  *****************************************************************************/
  915. void mmi_um_set_delete_folder_highlight_handler(void)
  916. {
  917.     /*----------------------------------------------------------------*/
  918.     /* Local Variables                                                */
  919.     /*----------------------------------------------------------------*/
  920.     /*----------------------------------------------------------------*/
  921.     /* Code Body                                                      */
  922.     /*----------------------------------------------------------------*/
  923.     /* set the menu hint handlers */
  924.     SetHintHandler(MENU_ID_UM_DELETE_FOLDER_INBOX, mmi_um_hint_inbox);
  925.     SetHintHandler(MENU_ID_UM_DELETE_FOLDER_UNSENT, mmi_um_hint_unsent);
  926.     SetHintHandler(MENU_ID_UM_DELETE_FOLDER_SENT, mmi_um_hint_sent);
  927.     SetHintHandler(MENU_ID_UM_DELETE_FOLDER_DRAFT, mmi_um_hint_draft);
  928.     return;
  929. }
  930.  
  931. /*****************************************************************************
  932.  * FUNCTION
  933.  *  mmi_um_pre_delete_folder
  934.  * DESCRIPTION
  935.  *  Pre-delete function of delete folder for unified message.
  936.  * PARAMETERS
  937.  *  void
  938.  * RETURNS
  939.  *  void
  940.  *****************************************************************************/
  941. void mmi_um_pre_delete_folder(void)
  942. {
  943.     /*----------------------------------------------------------------*/
  944.     /* Local Variables                                                */
  945.     /*----------------------------------------------------------------*/
  946.     UmMsgBoxType folder_type = 0;
  947.     U16 msg_number = 0;
  948.     U16 popup_string = 0;
  949.     /*----------------------------------------------------------------*/
  950.     /* Code Body                                                      */
  951.     /*----------------------------------------------------------------*/
  952.     switch (g_um_p->delete_folder.folder_type)
  953.     {
  954.         case UM_MSG_DELETE_FOLDER_INBOX:
  955.         {
  956.             folder_type = UM_MSG_BOX_TYPE_INBOX;
  957.             msg_number = g_um_p->msg_number.inbox_msg_number;
  958.             popup_string = STR_UM_DELETE_FOLDER_INBOX_ID;
  959.             break;
  960.         }
  961.         case UM_MSG_DELETE_FOLDER_UNSENT:
  962.         {
  963.             folder_type = UM_MSG_BOX_TYPE_UNSENT;
  964.             msg_number = g_um_p->msg_number.unsent_msg_number;
  965.             popup_string = STR_UM_DELETE_FOLDER_UNSENT_ID;
  966.             break;
  967.         }
  968.         case UM_MSG_DELETE_FOLDER_SENT:
  969.         {
  970.             folder_type = UM_MSG_BOX_TYPE_SENT;
  971.             msg_number = g_um_p->msg_number.sent_msg_number;
  972.             popup_string = STR_UM_DELETE_FOLDER_SENT_ID;
  973.             break;
  974.         }
  975.         case UM_MSG_DELETE_FOLDER_DRAFT:
  976.         {
  977.             folder_type = UM_MSG_BOX_TYPE_DRAFT;
  978.             msg_number = g_um_p->msg_number.draft_msg_number;
  979.             popup_string = STR_UM_DELETE_FOLDER_DRAFT_ID;
  980.             break;
  981.         }
  982.         case UM_MSG_DELETE_FOLDER_TOTAL_NUM:
  983.         {
  984.             folder_type = UM_MSG_BOX_TYPE_INBOX | UM_MSG_BOX_TYPE_UNSENT | UM_MSG_BOX_TYPE_SENT | UM_MSG_BOX_TYPE_DRAFT;
  985.             msg_number = g_um_p->msg_number.inbox_msg_number + g_um_p->msg_number.unsent_msg_number +
  986.                 g_um_p->msg_number.sent_msg_number + g_um_p->msg_number.draft_msg_number;
  987.             popup_string = STR_UM_DELETE_FOLDER_ALL_ID;
  988.             break;
  989.         }
  990.         default:
  991.             MMI_ASSERT(0);
  992.     }
  993.     if (msg_number == 0)
  994.     {
  995.         DisplayPopup((PU8) GetString(STR_GLOBAL_EMPTY), IMG_GLOBAL_EMPTY, 1, MESSAGES_POPUP_TIME_OUT, (U8) ERROR_TONE);
  996.         return;
  997.     }
  998.     else
  999.     {
  1000.         g_um_p->delete_folder.folders_to_delete = folder_type;
  1001.         DisplayConfirm(
  1002.             STR_GLOBAL_YES,
  1003.             IMG_GLOBAL_YES,
  1004.             STR_GLOBAL_NO,
  1005.             IMG_GLOBAL_NO,
  1006.             get_string(popup_string),
  1007.             IMG_GLOBAL_QUESTION,
  1008.             WARNING_TONE);
  1009.     }
  1010.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1011.     SetLeftSoftkeyFunction(mmi_um_process_delete_folder, KEY_EVENT_UP);
  1012. }
  1013. /*****************************************************************************
  1014.  * FUNCTION
  1015.  *  mmi_um_process_delete_folder
  1016.  * DESCRIPTION
  1017.  *  Process screen function of delete folder for unified message.
  1018.  * PARAMETERS
  1019.  *  void
  1020.  * RETURNS
  1021.  *  void
  1022.  *****************************************************************************/
  1023. void mmi_um_process_delete_folder(void)
  1024. {
  1025.     /*----------------------------------------------------------------*/
  1026.     /* Local Variables                                                */
  1027.     /*----------------------------------------------------------------*/
  1028.     /*----------------------------------------------------------------*/
  1029.     /* Code Body                                                      */
  1030.     /*----------------------------------------------------------------*/
  1031.     mmi_um_set_processing_screen(STR_UM_DELETE_FOLDER_ID, STR_UM_DELETING_ID, IMG_GLOBAL_PROGRESS, 0);
  1032.     mmi_um_entry_processing_generic();
  1033.     mmi_um_delete_folder_req();
  1034. }
  1035. /*****************************************************************************
  1036.  * FUNCTION
  1037.  *  mmi_um_entry_template
  1038.  * DESCRIPTION
  1039.  *  Entry function of msg template for unified message.
  1040.  * NA
  1041.  *  
  1042.  * PARAMETERS
  1043.  *  void
  1044.  * RETURNS
  1045.  *  void
  1046.  *****************************************************************************/
  1047. void mmi_um_entry_template(void)
  1048. {
  1049.     /*----------------------------------------------------------------*/
  1050.     /* Local Variables                                                */
  1051.     /*----------------------------------------------------------------*/
  1052.     U8 *guiBuffer;
  1053.     U16 nStrItemList[MAX_SUB_MENUS];
  1054.     U16 numItems;
  1055.     U16 itemIcons[MAX_SUB_MENUS];
  1056.     U8 *popUpList[MAX_SUB_MENUS];
  1057.     /*----------------------------------------------------------------*/
  1058.     /* Code Body                                                      */
  1059.     /*----------------------------------------------------------------*/
  1060.     EntryNewScreen(SCR_ID_UM_TEMPLATE, mmi_um_exit_generic, mmi_um_entry_template, NULL);
  1061.     mmi_um_set_state(UM_STATE_ENTRY_TEMPLATE);
  1062.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UM_TEMPLATE);
  1063.     SetParentHandler(MENU_ID_UM_TEMPLATE);
  1064.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1065.     numItems = GetNumOfChild_Ext(MENU_ID_UM_TEMPLATE);
  1066.     GetSequenceStringIds_Ext(MENU_ID_UM_TEMPLATE, nStrItemList);
  1067.     GetSequenceImageIds_Ext(MENU_ID_UM_TEMPLATE, itemIcons);
  1068.     SetHiliteHandler(MENU_ID_UM_TEMPLATE_SMS, mmi_um_highlight_template_sms);
  1069.     SetHiliteHandler(MENU_ID_UM_TEMPLATE_MMS, mmi_um_highlight_template_mms);
  1070.     ConstructHintsList(MENU_ID_UM_TEMPLATE, popUpList);
  1071.     ShowCategory52Screen(
  1072.         STR_UM_TEMPLATE_ID,
  1073.         IMG_UM_ENTRY_SCRN_CAPTION,
  1074.         STR_GLOBAL_OK,
  1075.         IMG_GLOBAL_OK,
  1076.         STR_GLOBAL_BACK,
  1077.         IMG_GLOBAL_BACK,
  1078.         numItems,
  1079.         nStrItemList,
  1080.         itemIcons,
  1081.         (U8 **) popUpList,
  1082.         0,
  1083.         0,
  1084.         guiBuffer);
  1085.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1086.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1087. }
  1088. /*****************************************************************************
  1089.  * FUNCTION
  1090.  *  mmi_um_highlight_template_sms
  1091.  * DESCRIPTION
  1092.  *  Funtion is called when sms template menu item selected
  1093.  * NA
  1094.  *  
  1095.  * PARAMETERS
  1096.  *  void
  1097.  * RETURNS
  1098.  *  void
  1099.  *****************************************************************************/
  1100. void mmi_um_highlight_template_sms(void)
  1101. {
  1102.     /*----------------------------------------------------------------*/
  1103.     /* Local Variables                                                */
  1104.     /*----------------------------------------------------------------*/
  1105.     /*----------------------------------------------------------------*/
  1106.     /* Code Body                                                      */
  1107.     /*----------------------------------------------------------------*/
  1108.     SetLeftSoftkeyFunction(mmi_msg_um_entry_template, KEY_EVENT_UP);
  1109.     SetKeyHandler(mmi_msg_um_entry_template, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1110.     return;
  1111. }
  1112. /*****************************************************************************
  1113.  * FUNCTION
  1114.  *  mmi_um_highlight_template_mms
  1115.  * DESCRIPTION
  1116.  *  Funtion is called when mms template menu item selected
  1117.  * NA
  1118.  *  
  1119.  * PARAMETERS
  1120.  *  void
  1121.  * RETURNS
  1122.  *  void
  1123.  *****************************************************************************/
  1124. void mmi_um_highlight_template_mms(void)
  1125. {
  1126.     /*----------------------------------------------------------------*/
  1127.     /* Local Variables                                                */
  1128.     /*----------------------------------------------------------------*/
  1129.     /*----------------------------------------------------------------*/
  1130.     /* Code Body                                                      */
  1131.     /*----------------------------------------------------------------*/
  1132.     SetLeftSoftkeyFunction(wap_um_entry_template_mms, KEY_EVENT_UP);
  1133.     SetKeyHandler(wap_um_entry_template_mms, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1134.     return;
  1135. }
  1136. /*****************************************************************************
  1137.  * FUNCTION
  1138.  *  mmi_um_entry_setting
  1139.  * DESCRIPTION
  1140.  *  Entry function of msg setting for unified message.
  1141.  * NA
  1142.  *  
  1143.  * PARAMETERS
  1144.  *  void
  1145.  * RETURNS
  1146.  *  void
  1147.  *****************************************************************************/
  1148. void mmi_um_entry_setting(void)
  1149. {
  1150.     /*----------------------------------------------------------------*/
  1151.     /* Local Variables                                                */
  1152.     /*----------------------------------------------------------------*/
  1153.     U8 *guiBuffer;
  1154.     U16 nStrItemList[MAX_SUB_MENUS];
  1155.     U16 numItems;
  1156.     U16 itemIcons[MAX_SUB_MENUS];
  1157.     U8 *popUpList[MAX_SUB_MENUS];
  1158.     /*----------------------------------------------------------------*/
  1159.     /* Code Body                                                      */
  1160.     /*----------------------------------------------------------------*/
  1161.     EntryNewScreen(SCR_ID_UM_SETTING, mmi_um_exit_generic, mmi_um_entry_setting, NULL);
  1162.     mmi_um_set_state(UM_STATE_ENTRY_SETTING);
  1163.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UM_SETTING);
  1164.     SetParentHandler(MENU_ID_UM_SETTING);
  1165.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1166.     numItems = GetNumOfChild_Ext(MENU_ID_UM_SETTING);
  1167.     GetSequenceStringIds_Ext(MENU_ID_UM_SETTING, nStrItemList);
  1168.     GetSequenceImageIds_Ext(MENU_ID_UM_SETTING, itemIcons);
  1169.     SetHiliteHandler(MESSAGES_MENU_MSG_SETTINGS_MENUID, mmi_um_highlight_setting_sms);
  1170.     SetHiliteHandler(MENU_ID_UM_SETTING_MMS, mmi_um_highlight_setting_mms);
  1171.     ConstructHintsList(MENU_ID_UM_SETTING, popUpList);
  1172.     ShowCategory52Screen(
  1173.         STR_UM_SETTING_ID,
  1174.         IMG_UM_ENTRY_SCRN_CAPTION,
  1175.         STR_GLOBAL_OK,
  1176.         IMG_GLOBAL_OK,
  1177.         STR_GLOBAL_BACK,
  1178.         IMG_GLOBAL_BACK,
  1179.         numItems,
  1180.         nStrItemList,
  1181.         itemIcons,
  1182.         (U8 **) popUpList,
  1183.         0,
  1184.         0,
  1185.         guiBuffer);
  1186.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1187.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1188. }
  1189. /*****************************************************************************
  1190.  * FUNCTION
  1191.  *  mmi_um_highlight_setting_sms
  1192.  * DESCRIPTION
  1193.  *  Funtion is called when sms setting menu item selected
  1194.  * NA
  1195.  *  
  1196.  * PARAMETERS
  1197.  *  void
  1198.  * RETURNS
  1199.  *  void
  1200.  *****************************************************************************/
  1201. void mmi_um_highlight_setting_sms(void)
  1202. {
  1203.     /*----------------------------------------------------------------*/
  1204.     /* Local Variables                                                */
  1205.     /*----------------------------------------------------------------*/
  1206.     /*----------------------------------------------------------------*/
  1207.     /* Code Body                                                      */
  1208.     /*----------------------------------------------------------------*/
  1209.     SetLeftSoftkeyFunction(mmi_msg_um_entry_setting, KEY_EVENT_UP);
  1210.     SetKeyHandler(mmi_msg_um_entry_setting, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1211.     return;
  1212. }
  1213. /*****************************************************************************
  1214.  * FUNCTION
  1215.  *  mmi_um_highlight_setting_mms
  1216.  * DESCRIPTION
  1217.  *  Funtion is called when mms setting menu item selected
  1218.  * NA
  1219.  *  
  1220.  * PARAMETERS
  1221.  *  void
  1222.  * RETURNS
  1223.  *  void
  1224.  *****************************************************************************/
  1225. void mmi_um_highlight_setting_mms(void)
  1226. {
  1227.     /*----------------------------------------------------------------*/
  1228.     /* Local Variables                                                */
  1229.     /*----------------------------------------------------------------*/
  1230.     /*----------------------------------------------------------------*/
  1231.     /* Code Body                                                      */
  1232.     /*----------------------------------------------------------------*/
  1233.     SetLeftSoftkeyFunction(wap_um_entry_setting_mms, KEY_EVENT_UP);
  1234.     SetKeyHandler(wap_um_entry_setting_mms, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1235.     return;
  1236. }
  1237. /*****************************************************************************
  1238.  * FUNCTION
  1239.  *  mmi_um_exit_generic
  1240.  * DESCRIPTION
  1241.  *  Exit generic function for um app.
  1242.  * PARAMETERS
  1243.  *  void
  1244.  * RETURNS
  1245.  *  void
  1246.  *****************************************************************************/
  1247. void mmi_um_exit_generic(void)
  1248. {
  1249.     /*----------------------------------------------------------------*/
  1250.     /* Local Variables                                                */
  1251.     /*----------------------------------------------------------------*/
  1252.     /*----------------------------------------------------------------*/
  1253.     /* Code Body                                                      */
  1254.     /*----------------------------------------------------------------*/
  1255.     return;
  1256. }
  1257. /*****************************************************************************
  1258.  * FUNCTION
  1259.  *  mmi_um_exit_folder
  1260.  * DESCRIPTION
  1261.  *  Exit generic function for um app.
  1262.  * PARAMETERS
  1263.  *  void
  1264.  * RETURNS
  1265.  *  void
  1266.  *****************************************************************************/
  1267. void mmi_um_exit_folder(void)
  1268. {
  1269.     /*----------------------------------------------------------------*/
  1270.     /* Local Variables                                                */
  1271.     /*----------------------------------------------------------------*/
  1272.     /*----------------------------------------------------------------*/
  1273.     /* Code Body                                                      */
  1274.     /*----------------------------------------------------------------*/
  1275.     g_um_p->main.is_reset_folder_info = KAL_TRUE;
  1276.     return;
  1277. }
  1278. /*****************************************************************************
  1279.  * FUNCTION
  1280.  *  mmi_um_handle_screen_for_ready_ind
  1281.  * DESCRIPTION
  1282.  *  Handle screen for ready indication
  1283.  * PARAMETERS
  1284.  *  void
  1285.  * RETURNS
  1286.  *  void
  1287.  *****************************************************************************/
  1288. void mmi_um_handle_screen_for_ready_ind(void)
  1289. {
  1290.     /*----------------------------------------------------------------*/
  1291.     /* Local Variables                                                */
  1292.     /*----------------------------------------------------------------*/
  1293.     /*----------------------------------------------------------------*/
  1294.     /* Code Body                                                      */
  1295.     /*----------------------------------------------------------------*/
  1296.     if (mmi_um_check_ready())
  1297.     {
  1298.         if (g_um_p->main.state == UM_STATE_ENTRY_MAIN_MENU)
  1299.         {
  1300.             if (GetExitScrnID() == SCR_ID_UM_PROCESSING)
  1301.             {
  1302.                 mmi_um_pre_entry_main();
  1303.             }
  1304.             else if (IsScreenPresent(SCR_ID_UM_PROCESSING))
  1305.             {
  1306.                 HistoryReplace(SCR_ID_UM_PROCESSING, SCR_ID_UM_MAIN, mmi_um_pre_entry_main);
  1307.             }
  1308.         }
  1309.     }
  1310. }
  1311. /*****************************************************************************
  1312.  * FUNCTION
  1313.  *  mmi_um_set_processing_screen
  1314.  * DESCRIPTION
  1315.  *  Set string and image for UM MSG processing screen
  1316.  * PARAMETERS
  1317.  *  captionStrId            [IN]        
  1318.  *  bodyStrId               [IN]        
  1319.  *  animationImageId        [IN]        
  1320.  *  rskStrId                [IN]        
  1321.  * RETURNS
  1322.  *  void
  1323.  *****************************************************************************/
  1324. void mmi_um_set_processing_screen(U16 captionStrId, U16 bodyStrId, U16 animationImageId, U16 rskStrId)
  1325. {
  1326.     /*----------------------------------------------------------------*/
  1327.     /* Local Variables                                                */
  1328.     /*----------------------------------------------------------------*/
  1329.     /*----------------------------------------------------------------*/
  1330.     /* Code Body                                                      */
  1331.     /*----------------------------------------------------------------*/
  1332.     g_um_p->processing.caption_str_id = captionStrId;
  1333.     g_um_p->processing.body_str_id = bodyStrId;
  1334.     g_um_p->processing.animation_image_id = animationImageId;
  1335.     g_um_p->processing.RSK_str_id = rskStrId;
  1336. }
  1337. /*****************************************************************************
  1338.  * FUNCTION
  1339.  *  mmi_um_exit_processing_generic
  1340.  * DESCRIPTION
  1341.  *  Exit MSG generic processing screen
  1342.  * PARAMETERS
  1343.  *  void
  1344.  * RETURNS
  1345.  *  void
  1346.  *****************************************************************************/
  1347. void mmi_um_exit_processing_generic(void)
  1348. {
  1349.     /*----------------------------------------------------------------*/
  1350.     /* Local Variables                                                */
  1351.     /*----------------------------------------------------------------*/
  1352.     /*----------------------------------------------------------------*/
  1353.     /* Code Body                                                      */
  1354.     /*----------------------------------------------------------------*/
  1355.     StopTimer(UM_INPROGRESS_TIMER_ID);
  1356. }
  1357. /*****************************************************************************
  1358.  * FUNCTION
  1359.  *  mmi_um_time_out_processing_generic
  1360.  * DESCRIPTION
  1361.  *  Time out call back of processing screen
  1362.  * PARAMETERS
  1363.  *  void
  1364.  * RETURNS
  1365.  *  void
  1366.  *****************************************************************************/
  1367. void mmi_um_time_out_processing_generic(void)
  1368. {
  1369.     /*----------------------------------------------------------------*/
  1370.     /* Local Variables                                                */
  1371.     /*----------------------------------------------------------------*/
  1372.     /*----------------------------------------------------------------*/
  1373.     /* Code Body                                                      */
  1374.     /*----------------------------------------------------------------*/
  1375.     StopTimer(UM_INPROGRESS_TIMER_ID);
  1376.     if (GetExitScrnID() == SCR_ID_UM_PROCESSING)
  1377.     {
  1378.         DisplayPopup(
  1379.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  1380.             IMG_GLOBAL_UNFINISHED,
  1381.             1,
  1382.             MESSAGES_POPUP_TIME_OUT,
  1383.             (U8) ERROR_TONE);
  1384.     }
  1385.     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1386. }
  1387. /*****************************************************************************
  1388.  * FUNCTION
  1389.  *  mmi_um_entry_processing_generic
  1390.  * DESCRIPTION
  1391.  *  Entry MSG generic processing screen
  1392.  * PARAMETERS
  1393.  *  void
  1394.  * RETURNS
  1395.  *  void
  1396.  *****************************************************************************/
  1397. void mmi_um_entry_processing_generic(void)
  1398. {
  1399.     /*----------------------------------------------------------------*/
  1400.     /* Local Variables                                                */
  1401.     /*----------------------------------------------------------------*/
  1402.     /*----------------------------------------------------------------*/
  1403.     /* Code Body                                                      */
  1404.     /*----------------------------------------------------------------*/
  1405.     EntryNewScreen(SCR_ID_UM_PROCESSING, mmi_um_exit_processing_generic, mmi_um_entry_processing_generic, NULL);
  1406. #ifdef __MMI_MAINLCD_240X320__
  1407.     /* passing 0xffff for Title string and Title icon for the disbling the status bar and title display. */
  1408.     ShowCategory8Screen(
  1409.         0xffff,
  1410.         0xffff,
  1411.         0,
  1412.         0,
  1413.         g_um_p->processing.RSK_str_id,
  1414.         0,
  1415.         g_um_p->processing.body_str_id,
  1416.         g_um_p->processing.animation_image_id,
  1417.         NULL);
  1418. #else /* __MMI_MAINLCD_240X320__ */ 
  1419.     ShowCategory8Screen(
  1420.         g_um_p->processing.caption_str_id,
  1421.         IMG_UM_ENTRY_SCRN_CAPTION,
  1422.         0,
  1423.         0,
  1424.         g_um_p->processing.RSK_str_id,
  1425.         0,
  1426.         g_um_p->processing.body_str_id,
  1427.         g_um_p->processing.animation_image_id,
  1428.         NULL);
  1429. #endif /* __MMI_MAINLCD_240X320__ */ 
  1430.     if (g_um_p->processing.RSK_str_id == 0)
  1431.     {
  1432.         ClearAllKeyHandler();
  1433.         ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1434.         ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1435.         ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  1436.         ClearKeyHandler(KEY_END, KEY_REPEAT);
  1437.         if (isInCall())
  1438.         {
  1439.             SetKeyHandler(HangupAllCalls, KEY_END, KEY_EVENT_DOWN);
  1440.         }
  1441.         StartTimer(UM_INPROGRESS_TIMER_ID, MMI_UM_INPROGRESS_TIME_OUT, mmi_um_time_out_processing_generic);
  1442.     }
  1443.     else
  1444.     {
  1445.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1446.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1447.     }
  1448. }
  1449. /*****************************************************************************
  1450.  * FUNCTION
  1451.  *  mmi_um_pre_entry_inbox
  1452.  * DESCRIPTION
  1453.  *  pre-entry inbox list function
  1454.  * PARAMETERS
  1455.  *  void
  1456.  * RETURNS
  1457.  *  void
  1458.  *****************************************************************************/
  1459. void mmi_um_pre_entry_inbox(void)
  1460. {
  1461.     /*----------------------------------------------------------------*/
  1462.     /* Local Variables                                                */
  1463.     /*----------------------------------------------------------------*/
  1464.     /*----------------------------------------------------------------*/
  1465.     /* Code Body                                                      */
  1466.     /*----------------------------------------------------------------*/
  1467.     g_um_p->folder.current_msg_box = UM_MSG_BOX_TYPE_INBOX;
  1468.     mmi_um_set_state(UM_STATE_ENTRY_INBOX);
  1469.     if (GetExitScrnID() == SCR_ID_UM_MAIN)
  1470.     {
  1471.         if (g_um_p->msg_number.inbox_msg_number == 0)
  1472.         {
  1473.             DisplayPopup(
  1474.                 (U8*) GetString(STR_GLOBAL_EMPTY),
  1475.                 IMG_GLOBAL_EMPTY,
  1476.                 1,
  1477.                 MESSAGES_POPUP_TIME_OUT,
  1478.                 (U8) EMPTY_LIST_TONE);
  1479.             return;
  1480.         }
  1481.     }
  1482.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1483.     /* if receive ready ind and this func is called, do not show progress screen again  */
  1484.     if (GetExitScrnID() != SCR_ID_UM_PROCESSING && !IsScreenPresent(SCR_ID_UM_PROCESSING))
  1485.     {
  1486.         if (!CheckIsBackHistory())
  1487.         {
  1488.             if (mmi_um_check_ready())
  1489.             {
  1490.                 mmi_um_set_processing_screen(STR_UM_INBOX_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, 0);
  1491.             }
  1492.             else
  1493.             {
  1494.                 mmi_um_set_processing_screen(STR_UM_INBOX_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, STR_GLOBAL_BACK);
  1495.             }
  1496.             mmi_um_entry_processing_generic();
  1497.         }
  1498.     }
  1499.     if (!mmi_um_check_ready())
  1500.     {
  1501.         return;
  1502.     }
  1503.     if (g_um_p->main.is_reset_folder_info)
  1504.     {
  1505.         mmi_um_reset_folder_info();
  1506.         g_um_p->main.is_reset_folder_info = KAL_FALSE;
  1507.     }
  1508.     if (IsScreenPresent(SCR_ID_UM_MAIN) && (!g_um_p->main.is_refresh))
  1509.     {
  1510.         mmi_um_get_list_info_req();
  1511.     }
  1512.     else
  1513.     {
  1514.         mmi_um_get_msg_num_req();
  1515.     }
  1516. }
  1517. /*****************************************************************************
  1518.  * FUNCTION
  1519.  *  mmi_um_pre_entry_unsent
  1520.  * DESCRIPTION
  1521.  *  pre-entry unsent list function
  1522.  * PARAMETERS
  1523.  *  void
  1524.  * RETURNS
  1525.  *  void
  1526.  *****************************************************************************/
  1527. void mmi_um_pre_entry_unsent(void)
  1528. {
  1529.     /*----------------------------------------------------------------*/
  1530.     /* Local Variables                                                */
  1531.     /*----------------------------------------------------------------*/
  1532.     /*----------------------------------------------------------------*/
  1533.     /* Code Body                                                      */
  1534.     /*----------------------------------------------------------------*/
  1535.     g_um_p->folder.current_msg_box = UM_MSG_BOX_TYPE_UNSENT;
  1536.     mmi_um_set_state(UM_STATE_ENTRY_UNSENT);
  1537.     if (GetExitScrnID() == SCR_ID_UM_MAIN)
  1538.     {
  1539.         if (g_um_p->msg_number.unsent_msg_number == 0)
  1540.         {
  1541.             DisplayPopup(
  1542.                 (U8*) GetString(STR_GLOBAL_EMPTY),
  1543.                 IMG_GLOBAL_EMPTY,
  1544.                 1,
  1545.                 MESSAGES_POPUP_TIME_OUT,
  1546.                 (U8) EMPTY_LIST_TONE);
  1547.             return;
  1548.         }
  1549.     }
  1550.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1551.     /* if receive ready ind and this func is called, do not show progress screen again  */
  1552.     if (GetExitScrnID() != SCR_ID_UM_PROCESSING && !IsScreenPresent(SCR_ID_UM_PROCESSING))
  1553.     {
  1554.         if (!CheckIsBackHistory())
  1555.         {
  1556.             if (mmi_um_check_ready())
  1557.             {
  1558.                 mmi_um_set_processing_screen(STR_UM_UNSENT_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, 0);
  1559.             }
  1560.             else
  1561.             {
  1562.                 mmi_um_set_processing_screen(STR_UM_UNSENT_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, STR_GLOBAL_BACK);
  1563.             }
  1564.             mmi_um_entry_processing_generic();
  1565.         }
  1566.     }
  1567.     if (!mmi_um_check_ready())
  1568.     {
  1569.         return;
  1570.     }
  1571.     if (g_um_p->main.is_reset_folder_info)
  1572.     {
  1573.         mmi_um_reset_folder_info();
  1574.         g_um_p->main.is_reset_folder_info = KAL_FALSE;
  1575.     }
  1576.     if (IsScreenPresent(SCR_ID_UM_MAIN) && (!g_um_p->main.is_refresh))
  1577.     {
  1578.         mmi_um_get_list_info_req();
  1579.     }
  1580.     else
  1581.     {
  1582.         mmi_um_get_msg_num_req();
  1583.     }
  1584. }
  1585. /*****************************************************************************
  1586.  * FUNCTION
  1587.  *  mmi_um_pre_entry_sent
  1588.  * DESCRIPTION
  1589.  *  pre-entry sent list function
  1590.  * PARAMETERS
  1591.  *  void
  1592.  * RETURNS
  1593.  *  void
  1594.  *****************************************************************************/
  1595. void mmi_um_pre_entry_sent(void)
  1596. {
  1597.     /*----------------------------------------------------------------*/
  1598.     /* Local Variables                                                */
  1599.     /*----------------------------------------------------------------*/
  1600.     /*----------------------------------------------------------------*/
  1601.     /* Code Body                                                      */
  1602.     /*----------------------------------------------------------------*/
  1603.     g_um_p->folder.current_msg_box = UM_MSG_BOX_TYPE_SENT;
  1604.     mmi_um_set_state(UM_STATE_ENTRY_SENT);
  1605.     if (GetExitScrnID() == SCR_ID_UM_MAIN)
  1606.     {
  1607.         if (g_um_p->msg_number.sent_msg_number == 0)
  1608.         {
  1609.             DisplayPopup(
  1610.                 (U8*) GetString(STR_GLOBAL_EMPTY),
  1611.                 IMG_GLOBAL_EMPTY,
  1612.                 1,
  1613.                 MESSAGES_POPUP_TIME_OUT,
  1614.                 (U8) EMPTY_LIST_TONE);
  1615.             return;
  1616.         }
  1617.     }
  1618.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1619.     /* if receive ready ind and this func is called, do not show progress screen again  */
  1620.     if (GetExitScrnID() != SCR_ID_UM_PROCESSING && !IsScreenPresent(SCR_ID_UM_PROCESSING))
  1621.     {
  1622.         if (!CheckIsBackHistory())
  1623.         {
  1624.             if (mmi_um_check_ready())
  1625.             {
  1626.                 mmi_um_set_processing_screen(STR_UM_SENT_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, 0);
  1627.             }
  1628.             else
  1629.             {
  1630.                 mmi_um_set_processing_screen(STR_UM_SENT_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, STR_GLOBAL_BACK);
  1631.             }
  1632.             mmi_um_entry_processing_generic();
  1633.         }
  1634.     }
  1635.     if (!mmi_um_check_ready())
  1636.     {
  1637.         return;
  1638.     }
  1639.     if (g_um_p->main.is_reset_folder_info)
  1640.     {
  1641.         mmi_um_reset_folder_info();
  1642.         g_um_p->main.is_reset_folder_info = KAL_FALSE;
  1643.     }
  1644.     if (IsScreenPresent(SCR_ID_UM_MAIN) && (!g_um_p->main.is_refresh))
  1645.     {
  1646.         mmi_um_get_list_info_req();
  1647.     }
  1648.     else
  1649.     {
  1650.         mmi_um_get_msg_num_req();
  1651.     }
  1652. }
  1653. /*****************************************************************************
  1654.  * FUNCTION
  1655.  *  mmi_um_pre_entry_draft
  1656.  * DESCRIPTION
  1657.  *  pre-entry draft list function
  1658.  * PARAMETERS
  1659.  *  void
  1660.  * RETURNS
  1661.  *  void
  1662.  *****************************************************************************/
  1663. void mmi_um_pre_entry_draft(void)
  1664. {
  1665.     /*----------------------------------------------------------------*/
  1666.     /* Local Variables                                                */
  1667.     /*----------------------------------------------------------------*/
  1668.     /*----------------------------------------------------------------*/
  1669.     /* Code Body                                                      */
  1670.     /*----------------------------------------------------------------*/
  1671.     g_um_p->folder.current_msg_box = UM_MSG_BOX_TYPE_DRAFT;
  1672.     mmi_um_set_state(UM_STATE_ENTRY_DRAFT);
  1673.     if (GetExitScrnID() == SCR_ID_UM_MAIN)
  1674.     {
  1675.         if (g_um_p->msg_number.draft_msg_number == 0)
  1676.         {
  1677.             DisplayPopup(
  1678.                 (U8*) GetString(STR_GLOBAL_EMPTY),
  1679.                 IMG_GLOBAL_EMPTY,
  1680.                 1,
  1681.                 MESSAGES_POPUP_TIME_OUT,
  1682.                 (U8) EMPTY_LIST_TONE);
  1683.             return;
  1684.         }
  1685.     }
  1686.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1687.     /* if receive ready ind and this func is called, do not show progress screen again  */
  1688.     if (GetExitScrnID() != SCR_ID_UM_PROCESSING && !IsScreenPresent(SCR_ID_UM_PROCESSING))
  1689.     {
  1690.         if (!CheckIsBackHistory())
  1691.         {
  1692.             if (mmi_um_check_ready())
  1693.             {
  1694.                 mmi_um_set_processing_screen(STR_UM_DRAFT_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, 0);
  1695.             }
  1696.             else
  1697.             {
  1698.                 mmi_um_set_processing_screen(STR_UM_DRAFT_ID, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, STR_GLOBAL_BACK);
  1699.             }
  1700.             mmi_um_entry_processing_generic();
  1701.         }
  1702.     }
  1703.     if (!mmi_um_check_ready())
  1704.     {
  1705.         return;
  1706.     }
  1707.     if (g_um_p->main.is_reset_folder_info)
  1708.     {
  1709.         mmi_um_reset_folder_info();
  1710.         g_um_p->main.is_reset_folder_info = KAL_FALSE;
  1711.     }
  1712.     if (IsScreenPresent(SCR_ID_UM_MAIN) && (!g_um_p->main.is_refresh))
  1713.     {
  1714.         mmi_um_get_list_info_req();
  1715.     }
  1716.     else
  1717.     {
  1718.         mmi_um_get_msg_num_req();
  1719.     }
  1720. }
  1721. /*****************************************************************************
  1722.  * FUNCTION
  1723.  *  mmi_um_hilite_folder_item
  1724.  * DESCRIPTION
  1725.  *  Highlight handler of Sent list
  1726.  * PARAMETERS
  1727.  *  index       [IN]        Index of highlighted item
  1728.  * RETURNS
  1729.  *  void
  1730.  *****************************************************************************/
  1731. void mmi_um_hilite_folder_item(S32 index)
  1732. {
  1733.     /*----------------------------------------------------------------*/
  1734.     /* Local Variables                                                */
  1735.     /*----------------------------------------------------------------*/
  1736.     mmi_um_msg_detail_struct *listMsgsStruct[MMI_UM_MAX_MSG_DETAIL_NUM];
  1737.     mmi_um_msg_detail_struct *temp;
  1738.     MYTIME time;
  1739.     UI_character_type str[MMI_UM_MAX_LEN_TIME_STR];
  1740.     /*----------------------------------------------------------------*/
  1741.     /* Code Body                                                      */
  1742.     /*----------------------------------------------------------------*/
  1743.     mmi_mem_get_values(
  1744.         &g_um_p->mem_pool_info.mem_container,
  1745.         (S16) index,
  1746.         (S16) index,
  1747.         (void **)listMsgsStruct,
  1748.         &g_um_p->mem_pool_info.not_avail_pool);
  1749.     temp = listMsgsStruct[0];
  1750.     g_um_p->folder.current_msg_index = index;
  1751.     if (temp->msg_detail.timestamp != 0)
  1752.     {
  1753.     #ifdef MMI_ON_HARDWARE_P
  1754.         mmi_dt_utc_sec_2_mytime(temp->msg_detail.timestamp, &time, MMI_TRUE);
  1755.     #else /* MMI_ON_HARDWARE_P */ 
  1756.         time.nYear = 2006;
  1757.         time.nMonth = 3;
  1758.         time.nDay = 13;
  1759.         time.nHour = 20;
  1760.         time.nMin = 22;
  1761.         time.nSec = 30;
  1762.     #endif /* MMI_ON_HARDWARE_P */ 
  1763.         date_string(&time, str, DT_IDLE_SCREEN);
  1764.         pfnUnicodeStrncpy((S8*) g_um_p->folder.msg_time, (S8*) str, (MMI_UM_MAX_LEN_TIME_STR - 1));
  1765.         pfnUnicodeStrncat((S8*) g_um_p->folder.msg_time, (S8*) " ", 1);
  1766.         time_string(&time, str, DT_IDLE_SCREEN);
  1767.         pfnUnicodeStrncat((S8*) g_um_p->folder.msg_time, (S8*) str, (MMI_UM_MAX_LEN_TIME_STR - 1));
  1768.     }
  1769.     else
  1770.     {
  1771.         memset((S8*) g_um_p->folder.msg_time, 0, MMI_UM_MAX_LEN_TIME_STR * ENCODING_LENGTH);
  1772.     }
  1773.     RedrawCategory263InfoBox((U8*) temp->msg_detail.address, (U8*) g_um_p->folder.msg_time);
  1774. }
  1775. /*****************************************************************************
  1776.  * FUNCTION
  1777.  *  mmi_um_entry_folder
  1778.  * DESCRIPTION
  1779.  *  generic pre-entry folder function
  1780.  * PARAMETERS
  1781.  *  void
  1782.  * RETURNS
  1783.  *  void
  1784.  *****************************************************************************/
  1785. void mmi_um_entry_folder()
  1786. {
  1787.     /*----------------------------------------------------------------*/
  1788.     /* Local Variables                                                */
  1789.     /*----------------------------------------------------------------*/
  1790.     U16 string_id = 0;
  1791.     U16 screen_id = 0;
  1792.     U16 icon_id = 0;
  1793.     S32 numItems = 0;
  1794.     /*----------------------------------------------------------------*/
  1795.     /* Code Body                                                      */
  1796.     /*----------------------------------------------------------------*/
  1797.     switch (g_um_p->folder.current_msg_box)
  1798.     {
  1799.         case UM_MSG_BOX_TYPE_INBOX:
  1800.             string_id = STR_UM_INBOX_ID;
  1801.             screen_id = SCR_ID_UM_INBOX;
  1802.             icon_id = IMG_UM_INBOX_ID;
  1803.             break;
  1804.         case UM_MSG_BOX_TYPE_UNSENT:
  1805.             string_id = STR_UM_UNSENT_ID;
  1806.             screen_id = SCR_ID_UM_UNSENT;
  1807.             icon_id = IMG_UM_UNSENT_ID;
  1808.             break;
  1809.         case UM_MSG_BOX_TYPE_SENT:
  1810.             string_id = STR_UM_SENT_ID;
  1811.             screen_id = SCR_ID_UM_SENT;
  1812.             icon_id = IMG_UM_SENT_ID;
  1813.             break;
  1814.         case UM_MSG_BOX_TYPE_DRAFT:
  1815.             string_id = STR_UM_DRAFT_ID;
  1816.             screen_id = SCR_ID_UM_DRAFT;
  1817.             icon_id = IMG_UM_DRAFT_ID;
  1818.             break;
  1819.         default:
  1820.             MMI_ASSERT(0);
  1821.             break;
  1822.     }
  1823.     numItems = g_um_p->folder.msg_number_in_list;
  1824.     if (IsScreenPresent(SCR_ID_UM_PROCESSING))
  1825.     {
  1826.         PRINT_INFORMATION_2((MMI_TRACE_G6_SMS,
  1827.                              "*[UnifiedMessageUIInterface.c] mmi_um_entry_folder discard response *n"));
  1828.         g_um_p->main.is_reset_folder_info = KAL_TRUE;
  1829.         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1830.         return;
  1831.     }
  1832.     if (numItems)
  1833.     {
  1834.         U8 *guiBuffer;
  1835.         S32 list_not_ready;
  1836.         EntryNewScreen(screen_id, mmi_um_exit_folder, mmi_um_entry_folder, NULL);
  1837.         
  1838.         /* Back from history */
  1839.         if (g_um_p->main.is_reset_folder_info)
  1840.         {
  1841.             mmi_um_reset_folder_info();
  1842.             g_um_p->main.is_reset_folder_info = KAL_FALSE;
  1843.             mmi_um_reset_folder_history_guibuffer(screen_id);
  1844.         }
  1845.         else
  1846.         {
  1847.             /* Change the highlight by message applications request */
  1848.             if (g_um_p->folder.is_highlight_change_needed)
  1849.             {
  1850.                 mmi_um_change_highlight();
  1851.                 g_um_p->folder.is_highlight_change_needed = KAL_FALSE;
  1852.     
  1853.                 mmi_um_reset_folder_info();
  1854.                 g_um_p->main.is_reset_folder_info = KAL_FALSE;
  1855.                 mmi_um_reset_folder_history_guibuffer(screen_id);
  1856.             }
  1857.                         
  1858.             /* to prevent the selected msg being deleted */
  1859.             if (g_um_p->folder.current_msg_index >= numItems)
  1860.             {
  1861.                 g_um_p->folder.current_msg_index = numItems - 1;
  1862.             }
  1863.         }
  1864.         guiBuffer = GetCurrGuiBuffer(screen_id);
  1865.         
  1866.         RegisterHighlightHandler(mmi_um_hilite_folder_item);
  1867.         /* After entering inbox list, do not display full screen indication in idle screen */
  1868.         if (g_um_p->folder.current_msg_box == UM_MSG_BOX_TYPE_INBOX)
  1869.         {
  1870.             g_um_p->main.is_new_msg = KAL_FALSE;
  1871.         }
  1872. #ifdef __UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__
  1873.         ShowCategory263Screen(
  1874.             (U8*) GetString(string_id),
  1875.             icon_id,
  1876.             STR_GLOBAL_OPTIONS,
  1877.             IMG_GLOBAL_OPTIONS,
  1878.             STR_GLOBAL_BACK,
  1879.             IMG_GLOBAL_BACK,
  1880.             numItems,
  1881.             mmi_um_get_async_items,
  1882.             NULL,
  1883.             g_um_p->folder.current_msg_index,
  1884.             IMG_MESSAGE_READ /* list_icon */ ,
  1885.             guiBuffer,
  1886.             &list_not_ready);
  1887. #else /* __UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__ */
  1888.         ShowCategory263Screen(
  1889.             (U8*) GetString(string_id),
  1890.             icon_id,
  1891.             STR_GLOBAL_OK,
  1892.             IMG_GLOBAL_OK,
  1893.             STR_GLOBAL_BACK,
  1894.             IMG_GLOBAL_BACK,
  1895.             numItems,
  1896.             mmi_um_get_async_items,
  1897.             NULL,
  1898.             g_um_p->folder.current_msg_index,
  1899.             IMG_MESSAGE_READ /* list_icon */ ,
  1900.             guiBuffer,
  1901.             &list_not_ready);
  1902. #endif /* __UNIFIED_MESSAGE_LIST_OPTION_SUPPORT__ */
  1903.         if (list_not_ready)
  1904.         {
  1905.             MMI_ASSERT(GetExitScrnID() == screen_id);
  1906.             mmi_um_entry_get_msg_info();
  1907.         }
  1908.         else
  1909.         {
  1910.             g_um_p->folder.is_list_displayed = KAL_TRUE;
  1911.             SetLeftSoftkeyFunction(mmi_um_entry_msg, KEY_EVENT_UP);
  1912.             SetKeyHandler(mmi_um_entry_msg, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1913.             SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1914.             SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1915.         }
  1916.     }
  1917.     else
  1918.     {
  1919.         DisplayPopup(
  1920.             (U8*) GetString(STR_GLOBAL_EMPTY),
  1921.             IMG_GLOBAL_EMPTY,
  1922.             1,
  1923.             UI_POPUP_NOTIFYDURATION_TIME,
  1924.             (U8) EMPTY_LIST_TONE);
  1925.     }
  1926.     DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  1927. }
  1928. /*****************************************************************************
  1929.  * FUNCTION
  1930.  *  mmi_um_entry_msg
  1931.  * DESCRIPTION
  1932.  *  generic entry msg function
  1933.  * PARAMETERS
  1934.  *  void
  1935.  * RETURNS
  1936.  *  void
  1937.  *****************************************************************************/
  1938. void mmi_um_entry_msg(void)
  1939. {
  1940.     /*----------------------------------------------------------------*/
  1941.     /* Local Variables                                                */
  1942.     /*----------------------------------------------------------------*/
  1943.     kal_uint16 msg_index = g_um_p->folder.msg_list[g_um_p->folder.current_msg_index].list_info.msg_index;
  1944.     UmMsgType type = g_um_p->folder.msg_list[g_um_p->folder.current_msg_index].msg_type;
  1945.     /*----------------------------------------------------------------*/
  1946.     /* Code Body                                                      */
  1947.     /*----------------------------------------------------------------*/
  1948.     switch (type)
  1949.     {
  1950.         case UM_MSG_TYPE_SMS:
  1951.             mmi_msg_um_entry_msg(g_um_p->folder.current_msg_box, msg_index);
  1952.             break;
  1953.         case UM_MSG_TYPE_MMS:
  1954.             wap_um_entry_msg_mms((kal_uint16) g_um_p->folder.current_msg_box, msg_index);
  1955.             break;
  1956.         case UM_MSG_TYPE_WAP_PUSH:
  1957.             wap_um_entry_msg_wap_push((kal_uint16) g_um_p->folder.current_msg_box, msg_index);
  1958.             break;
  1959.         default:
  1960.             MMI_ASSERT(0);
  1961.             break;
  1962.     }
  1963. }
  1964. /*****************************************************************************
  1965.  * FUNCTION
  1966.  *  mmi_um_get_async_items
  1967.  * DESCRIPTION
  1968.  *  Fill dynamic list items of each folder
  1969.  * PARAMETERS
  1970.  *  start_indx      [IN]            Start index of item to be retrieved.
  1971.  *  menuData        [IN/OUT]        UI structure to store the list data.
  1972.  *  num_item        [IN]            Number of items revrieved.
  1973.  * RETURNS
  1974.  *  void
  1975.  *****************************************************************************/
  1976. S32 mmi_um_get_async_items(S32 start_indx, gui_iconlist_menu_item *menuData, S32 num_item)
  1977. {
  1978.     /*----------------------------------------------------------------*/
  1979.     /* Local Variables                                                */
  1980.     /*----------------------------------------------------------------*/
  1981.     S32 i;
  1982.     mmi_mem_pool_ret_enum ret_result;
  1983.     mmi_um_msg_detail_struct *listMsgsStruct[MMI_UM_MAX_MSG_DETAIL_NUM];
  1984.     /*----------------------------------------------------------------*/
  1985.     /* Code Body                                                      */
  1986.     /*----------------------------------------------------------------*/
  1987.     g_um_p->mem_pool_info.start_index = start_indx;
  1988.     g_um_p->mem_pool_info.end_index = (start_indx + num_item) - 1;
  1989.     ret_result = mmi_mem_get_values(
  1990.                     &g_um_p->mem_pool_info.mem_container,
  1991.                     (S16) g_um_p->mem_pool_info.start_index,
  1992.                     (S16) g_um_p->mem_pool_info.end_index,
  1993.                     (void **)listMsgsStruct,
  1994.                     &g_um_p->mem_pool_info.not_avail_pool);
  1995.     if (ret_result != MEM_CT_SUCCESS)
  1996.     {
  1997.         if (g_um_p->folder.is_list_displayed)
  1998.         {
  1999.             mmi_um_entry_get_msg_info();
  2000.         }
  2001.         return 0;
  2002.     }
  2003.     /* fill data */
  2004.     for (i = 0; i < num_item; ++i)
  2005.     {
  2006.         U16 status_img;
  2007.         mmi_um_msg_detail_struct *temp = listMsgsStruct[i];
  2008.         /* subject */
  2009.         pfnUnicodeStrncpy(
  2010.             (S8*) menuData[i].item_list[0],
  2011.             (S8*) temp->msg_detail.subject,
  2012.             temp->msg_detail.subject_length);
  2013.         /* status icon */
  2014.         status_img = temp->msg_detail.icon_id;
  2015.         menuData[i].image_list[0] = (PU8) GetImage(status_img);
  2016.     }
  2017.     return num_item;
  2018. }
  2019. /*****************************************************************************
  2020.  * FUNCTION
  2021.  *  mmi_um_entry_get_msg_info
  2022.  * DESCRIPTION
  2023.  *  Entry progressing screen for get message info request
  2024.  * PARAMETERS
  2025.  *  void
  2026.  * RETURNS
  2027.  *  void
  2028.  *****************************************************************************/
  2029. void mmi_um_entry_get_msg_info()
  2030. {
  2031.     /*----------------------------------------------------------------*/
  2032.     /* Local Variables                                                */
  2033.     /*----------------------------------------------------------------*/
  2034.     U16 string_id = 0;
  2035.     /*----------------------------------------------------------------*/
  2036.     /* Code Body                                                      */
  2037.     /*----------------------------------------------------------------*/
  2038.     switch (g_um_p->folder.current_msg_box)
  2039.     {
  2040.         case UM_MSG_BOX_TYPE_INBOX:
  2041.             string_id = STR_UM_INBOX_ID;
  2042.             break;
  2043.         case UM_MSG_BOX_TYPE_UNSENT:
  2044.             string_id = STR_UM_UNSENT_ID;
  2045.             break;
  2046.         case UM_MSG_BOX_TYPE_SENT:
  2047.             string_id = STR_UM_SENT_ID;
  2048.             break;
  2049.         case UM_MSG_BOX_TYPE_DRAFT:
  2050.             string_id = STR_UM_DRAFT_ID;
  2051.             break;
  2052.         default:
  2053.             MMI_ASSERT(0);
  2054.             break;
  2055.     }
  2056.     if (GetExitScrnID() != SCR_ID_UM_PROCESSING)
  2057.     {
  2058.         mmi_um_set_processing_screen(string_id, STR_UM_LOADING_ID, IMG_GLOBAL_PROGRESS, 0);
  2059.         mmi_um_entry_processing_generic();
  2060.         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  2061.         g_um_p->main.is_reset_folder_info = KAL_FALSE;
  2062.         g_um_p->folder.is_list_displayed = KAL_FALSE;
  2063.     }
  2064.     mmi_um_get_list_info_req();
  2065. }
  2066. /*****************************************************************************
  2067.  * FUNCTION
  2068.  *  mmi_um_enter_curr_folder
  2069.  * DESCRIPTION
  2070.  *  Enter current folder after list folder process complete
  2071.  * PARAMETERS
  2072.  *  void
  2073.  * RETURNS
  2074.  *  void
  2075.  *****************************************************************************/
  2076. void mmi_um_enter_curr_folder(void)
  2077. {
  2078.     /*----------------------------------------------------------------*/
  2079.     /* Local Variables                                                */
  2080.     /*----------------------------------------------------------------*/
  2081.     U16 folderScrnId = 0;
  2082.     FuncPtr entryFuncPtr = mmi_um_entry_folder;
  2083.     /*----------------------------------------------------------------*/
  2084.     /* Code Body                                                      */
  2085.     /*----------------------------------------------------------------*/
  2086.     /* retrieve screen info */
  2087.     switch (g_um_p->folder.current_msg_box)
  2088.     {
  2089.         case UM_MSG_BOX_TYPE_INBOX:
  2090.             folderScrnId = SCR_ID_UM_INBOX;
  2091.             break;
  2092.         case UM_MSG_BOX_TYPE_UNSENT:
  2093.             folderScrnId = SCR_ID_UM_UNSENT;
  2094.             break;
  2095.         case UM_MSG_BOX_TYPE_SENT:
  2096.             folderScrnId = SCR_ID_UM_SENT;
  2097.             break;
  2098.         case UM_MSG_BOX_TYPE_DRAFT:
  2099.             folderScrnId = SCR_ID_UM_DRAFT;
  2100.             break;
  2101.         default:
  2102.             MMI_ASSERT(0);
  2103.             break;
  2104.     }
  2105.     /* if it's in progressing screen */
  2106.     if (GetExitScrnID() == SCR_ID_UM_PROCESSING)
  2107.     {
  2108.         if (IsScreenPresent(folderScrnId))
  2109.         {
  2110.             /* if folder is already exists */
  2111.             GoBackHistory();
  2112.         }
  2113.         else
  2114.         {   /* first time entry */
  2115.             (*entryFuncPtr) ();
  2116.             DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  2117.         }
  2118.     }
  2119.     else
  2120.     {
  2121.         /* it's not in progressing screen, maybe in call or something else */
  2122.         DeleteScreenIfPresent(SCR_ID_UM_PROCESSING);
  2123.     }
  2124. }
  2125. /*****************************************************************************
  2126.  * FUNCTION
  2127.  *  mmi_um_pre_entry_new_msg_ind
  2128.  * DESCRIPTION
  2129.  *  entry new msg
  2130.  * PARAMETERS
  2131.  *  void
  2132.  * RETURNS
  2133.  *  void
  2134.  *****************************************************************************/
  2135. void mmi_um_pre_entry_new_msg_ind(void)
  2136. {
  2137.     /*----------------------------------------------------------------*/
  2138.     /* Local Variables                                                */
  2139.     /*----------------------------------------------------------------*/
  2140.     /*----------------------------------------------------------------*/
  2141.     /* Code Body                                                      */
  2142.     /*----------------------------------------------------------------*/
  2143.     /* This function is called again. The msg number should be ready. */
  2144.     if (g_um_p->main.is_ready_for_new_msg)
  2145.     {
  2146.         g_um_p->main.is_ready_for_new_msg = KAL_FALSE;
  2147.         mmi_um_entry_new_msg_ind(KAL_TRUE);
  2148.         return;
  2149.     }
  2150.     
  2151.     mmi_um_set_state(UM_STATE_ENTRY_NEW_MSG_IND);
  2152.     if (!mmi_um_check_ready())
  2153.     {
  2154.         mmi_um_entry_new_msg_ind(KAL_FALSE);
  2155.         return;
  2156.     }
  2157.     EntryNewScreen(SCR_ID_UM_NEW_MSG_DUMMY_IND, mmi_um_exit_generic, NULL, NULL);
  2158.     mmi_um_get_msg_num_req();
  2159. }
  2160. /*****************************************************************************
  2161.  * FUNCTION
  2162.  *  mmi_um_go_back_from_new_msg_ind
  2163.  * DESCRIPTION
  2164.  *  entry new msg
  2165.  * PARAMETERS
  2166.  *  void
  2167.  * RETURNS
  2168.  *  void
  2169.  *****************************************************************************/
  2170. void mmi_um_go_back_from_new_msg_ind(void)
  2171. {
  2172.     /*----------------------------------------------------------------*/
  2173.     /* Local Variables                                                */
  2174.     /*----------------------------------------------------------------*/
  2175.     /*----------------------------------------------------------------*/
  2176.     /* Code Body                                                      */
  2177.     /*----------------------------------------------------------------*/
  2178.     g_um_p->main.is_new_msg = KAL_FALSE;
  2179.     if (mmi_um_string != NULL)
  2180.     {
  2181.         OslMfree(mmi_um_string);
  2182.         mmi_um_string = NULL;
  2183.     }
  2184.     GoBackHistory();
  2185. }
  2186. /*****************************************************************************
  2187.  * FUNCTION
  2188.  *  mmi_um_entry_new_msg_ind
  2189.  * DESCRIPTION
  2190.  *  entry new msg
  2191.  * PARAMETERS
  2192.  *  ready       [IN]        
  2193.  * RETURNS
  2194.  *  void
  2195.  *****************************************************************************/
  2196. void mmi_um_entry_new_msg_ind(kal_bool ready)
  2197. {
  2198.     /*----------------------------------------------------------------*/
  2199.     /* Local Variables                                                */
  2200.     /*----------------------------------------------------------------*/
  2201.     S8 *new_msg_string_id = NULL;
  2202.     S8 *unread_msg_number = NULL;
  2203.     /*----------------------------------------------------------------*/
  2204.     /* Code Body                                                      */
  2205.     /*----------------------------------------------------------------*/
  2206.     EntryNewScreen(SCR_ID_UM_NEW_MSG_IND, mmi_um_exit_new_msg_ind, NULL, NULL);
  2207.     ForceSubLCDScreen(mmi_msg_start_msg_sub_anm);
  2208.     new_msg_string_id = GetString(STR_UM_NEW_MSG_ID);
  2209.     if (ready)
  2210.     {
  2211.         U8 *tempStr = NULL;
  2212.         U8 ascii_num[16];
  2213.         U16 num = g_um_p->msg_number.inbox_unread_msg_number;
  2214.         if (mmi_um_string != NULL)
  2215.         {
  2216.             OslMfree(mmi_um_string);
  2217.             mmi_um_string = NULL;
  2218.         }
  2219.         mmi_um_string = OslMalloc(64);
  2220.         memset(ascii_num, 0, 16);
  2221.         sprintf((S8*) ascii_num, "%d ", num);
  2222.         AnsiiToUnicodeString((S8*) mmi_um_string, (S8*) ascii_num);
  2223.         tempStr = (U8*) GetString((U16) STR_UM_UNREAD_MSG_NUMBER_ID);
  2224.         pfnUnicodeStrcat((S8*) mmi_um_string, (S8*) tempStr);
  2225.         unread_msg_number = mmi_um_string;
  2226.     }
  2227.     if (IsKeyPadLockState() == 0)
  2228.     {
  2229.         ShowCategory154Screen(
  2230.             0,
  2231.             0,
  2232.             STR_GLOBAL_VIEW,
  2233.             IMG_GLOBAL_OK,
  2234.             STR_GLOBAL_BACK,
  2235.             IMG_GLOBAL_BACK,
  2236.             (PU8) new_msg_string_id,
  2237.             (PU8) unread_msg_number,
  2238.             IMG_NEW_MESSAGE_NOTIFICATION_MSG,
  2239.             NULL);
  2240.         SetRightSoftkeyFunction(mmi_um_go_back_from_new_msg_ind, KEY_EVENT_UP);
  2241.         SetLeftSoftkeyFunction(mmi_um_pre_entry_inbox, KEY_EVENT_UP);
  2242.         SetKeyHandler(mmi_um_go_back_from_new_msg_ind, KEY_END, KEY_EVENT_DOWN);
  2243.     }
  2244.     else    /* keypad is locked */
  2245.     {
  2246.         ShowCategory154Screen(
  2247.             0,
  2248.             0,
  2249.             g_keylock_context.KeyLockLSKStringID,
  2250.             g_keylock_context.KeyLockLSKIconID,
  2251.             g_keylock_context.KeyLockRSKStringID,
  2252.             g_keylock_context.KeyLockRSKIconID,
  2253.             (PU8) new_msg_string_id,
  2254.             (PU8) unread_msg_number,
  2255.             IMG_NEW_MESSAGE_NOTIFICATION_MSG,
  2256.             NULL);
  2257.         ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  2258.     }
  2259. }
  2260. /*****************************************************************************
  2261.  * FUNCTION
  2262.  *  mmi_um_exit_new_msg_ind
  2263.  * DESCRIPTION
  2264.  *  get sms msg number of each msg box
  2265.  * PARAMETERS
  2266.  *  void
  2267.  * RETURNS
  2268.  *  void
  2269.  *****************************************************************************/
  2270. void mmi_um_exit_new_msg_ind()
  2271. {
  2272.     /*----------------------------------------------------------------*/
  2273.     /* Local Variables                                                */
  2274.     /*----------------------------------------------------------------*/
  2275.     /*----------------------------------------------------------------*/
  2276.     /* Code Body                                                      */
  2277.     /*----------------------------------------------------------------*/
  2278.     mmi_msg_stop_msg_sub_anm();
  2279. }
  2280. #endif /* __MMI_UNIFIED_MESSAGE__ */ 
  2281. #endif /* _MMI_UNIFIED_MESSAGE_UIINTERFACE_C */