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

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.  * SmsSettingsGuiInterface.C
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for MMI SMS APP.
  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.  *------------------------------------------------------------------------------
  108.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  109.  *============================================================================
  110.  ****************************************************************************/
  111. /**
  112.  * Copyright Notice
  113.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  114.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  115.  *  (It is illegal to remove this copyright notice from this software or any
  116.  *  portion of it)
  117.  */
  118. /**************************************************************
  119.    FILENAME : SmsSettingsGuiInterface.c
  120.    PURPOSE     : it allows user to access the following settings,
  121.                 - service center number, 
  122.                 - validity period,
  123.                 - message type,
  124.                 - prefer storage
  125.                 - memory status,
  126.                 - reply path,
  127.                 - deliver report 
  128.    REMARKS     : nil
  129.    AUTHOR      : Magesh, hiran
  130.    DATE     : 01-01-2003
  131. **************************************************************/
  132. #ifdef __MOD_SMSAL__
  133. /*  */
  134. /*  */
  135. #include "MMI_features.h"
  136. #include "stdC.h"
  137. #include "L4Dr1.h"
  138. #include "PixtelDataTypes.h"
  139. /* ... Add More MMI header */
  140. #include "EventsGprot.h"
  141. #include "HistoryGprot.h"
  142. #include "GlobalMenuItems.h"
  143. #include "GlobalConstants.h"
  144. #include "Globaldefs.h"
  145. #include "wgui_categories.h"
  146. #include "wgui_categories_inputs.h"
  147. #include "CustMenuRes.h"
  148. #include "CommonScreens.h"
  149. #include "Unicodexdcl.h"
  150. #include "TimerEvents.h"
  151. #include "DebugInitDef.h"
  152. #include "ProtocolEvents.h"
  153. /* ...Add MSG header */
  154. #include "customer_ps_inc.h"
  155. #include "mmi_msg_context.h"
  156. #include "MessagesL4Def.h"
  157. #include "MessagesResourceData.h"
  158. #include "MessagesMiscell.h"
  159. #include "MessagesExDcl.h"
  160. #include "SmsGuiInterfaceProt.h"
  161. #include "SmsGuiInterfaceType.h"
  162. #include "SmsPsHandler.h"
  163. #include "CellBroadcastType.h"
  164. /*  */
  165. #include "GSM7BitDefaultAlphabet.h"
  166. #include "wgui_status_icons.h"
  167. /*  */
  168. #include "NVRAMEnum.h"
  169. #include "NVRAMProt.h"
  170. #include "NVRAMType.h"
  171. /*  */
  172. #include "CSP.h"
  173. #include "SettingProfile.h"
  174. #include "PhoneBookGprot.h"
  175. #include "SettingProt.h"
  176. #include "AlarmFrameworkProt.h"
  177. /*  */
  178. #include "CallManagementGprot.h"
  179. #include "callsetup.h"
  180. #include "SMSApi.h"
  181. #include "SMSStruct.h"
  182. static U8 DeliveryRepyStates[2];
  183. static msg_profile_edit_struct psProfileEditInfo;   /* attn: reduce one of this struct obj.... */
  184. static msg_profile_list_struct psProfileNameList;
  185. static PU8 vpItems[MAX_LFOUR_VP];
  186. static PU8 msgTypeItems[MAX_LFOUR_MSG_TYPE];
  187. static U16 defaultProfileNames[MAX_LFOUR_PROFILES] = 
  188. {
  189.     STR_SET0_MENUENTRY,
  190.     STR_SET1_MENUENTRY,
  191.     STR_SET2_MENUENTRY,
  192.     STR_SET3_MENUENTRY
  193. };
  194. static U16 profileEditIcons[MAX_PROFILE_EDIT_ITEMS] = 
  195. {
  196.     IMG_SMS_PROFILE_NAME,
  197.     IMG_SMS_PROFILE_SC,
  198.     IMG_SMS_PROFILE_VP,
  199.     IMG_SMS_PROFILE_MSG_TYPE
  200. };
  201. U16 profileEditStrings[MAX_PROFILE_EDIT_ITEMS];
  202. static U8 *pMailBoxName[MAX_MAILBOX_PS_SUPPORT] = {NULL, NULL};
  203. static U8 *pMailBoxNumber[MAX_MAILBOX_PS_SUPPORT] = {NULL, NULL};
  204. static U8 psMailBoxDCS[MAX_MAILBOX_PS_SUPPORT];
  205. static msg_mailbox_edit_struct psMailboxEditInfo;
  206. #if defined(__MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__)
  207. static msg_mem_status_struct memStatus = {SMSAL_STORAGE_UNSPECIFIED, 0, 0, 0, 0};
  208. #endif 
  209. #ifdef __MMI_GPRS_FEATURES__
  210. static msg_bearer_enum preferBearer;
  211. #endif 
  212. static U16 mmi_msg_mailbox_num = 0;
  213. /********************************************************************
  214.                   variables
  215. ********************************************************************/
  216. extern msg_active_profile_struct activeProfile;
  217. extern U8 hintData[MAX_SUB_MENUS][MAX_SUB_MENU_HINT_SIZE];
  218. extern PU8 hintDataPtrs[MAX_SUB_MENUS];
  219. extern U8 subMenuData[MAX_SUB_MENUS][MAX_SUB_MENU_SIZE];
  220. extern PU8 subMenuDataPtrs[MAX_SUB_MENUS];
  221. extern wgui_inline_item wgui_inline_items[];
  222. extern void MakeCall(PS8 strNumber);
  223. /*****************************************************************************
  224.  * FUNCTION
  225.  *  mmi_msg_dial_mailbox_rsp
  226.  * DESCRIPTION
  227.  *  
  228.  * PARAMETERS
  229.  *  mailbox     [?]         
  230.  *  mod         [IN]        
  231.  *  result      [IN]        
  232.  * RETURNS
  233.  *  void
  234.  *****************************************************************************/
  235. void mmi_msg_dial_mailbox_rsp(void *mailbox, module_type mod, U16 result)
  236. {
  237.     /*----------------------------------------------------------------*/
  238.     /* Local Variables                                                */
  239.     /*----------------------------------------------------------------*/
  240.     MMI_BOOL is_number = MMI_FALSE;
  241.     /*----------------------------------------------------------------*/
  242.     /* Code Body                                                      */
  243.     /*----------------------------------------------------------------*/
  244.     if (result == MMI_FRM_SMS_OK)
  245.     {
  246.         mmi_frm_sms_mailbox_struct *mailboxlist = (mmi_frm_sms_mailbox_struct*) mailbox;
  247.         U8 i = 0;
  248.         if (mailboxlist->mailboxNumber == 0)
  249.         {
  250.             DisplayPopup(
  251.                 (PU8) GetString(STR_GLOBAL_EMPTY),
  252.                 IMG_GLOBAL_EMPTY,
  253.                 1,
  254.                 MESSAGES_POPUP_TIME_OUT,
  255.                 (U8) EMPTY_LIST_TONE);
  256.         }
  257.         else
  258.         {
  259.             while (i < mailboxlist->mailboxNumber)
  260.             {
  261.                 pMailBoxNumber[i] = OslMalloc((MAX_CC_ADDR_LEN * ENCODING_LENGTH) + ENCODING_LENGTH);
  262.                 pfnUnicodeStrcpy((S8*) pMailBoxNumber[i], (S8*) mailboxlist->pMailBoxNumber[i]);
  263.                 if (pfnUnicodeStrlen((PS8) pMailBoxNumber[i]) != 0)
  264.                 {
  265.                     is_number = MMI_TRUE;
  266.                 }
  267.                 i++;
  268.             }
  269.             if (is_number)
  270.             {
  271.                 if (mailboxlist->mailboxNumber >= MAX_MAILBOX_PS_SUPPORT)
  272.                 {
  273.                     if (g_callset_context.LineID == LINE1)
  274.                     {
  275.                         if (pMailBoxNumber[0] != NULL &&
  276.                             pfnUnicodeStrlen((PS8) pMailBoxNumber[0]) != 0)
  277.                         {                        
  278.                             MakeCall((PS8) pMailBoxNumber[0]);                        
  279.                         }
  280.                         else
  281.                         {
  282.                             DisplayPopup(
  283.                                 (PU8) GetString(STR_VM_NO_NUMBER_TO_DIAL),
  284.                                 IMG_GLOBAL_WARNING,
  285.                                 1,
  286.                                 MESSAGES_POPUP_TIME_OUT,
  287.                                 (U8) WARNING_TONE);
  288.                         }
  289.                     }
  290.                     else
  291.                     {
  292.                         if (pMailBoxNumber[1] != NULL &&
  293.                             pfnUnicodeStrlen((PS8) pMailBoxNumber[1]) != 0)
  294.                         {                        
  295.                             MakeCall((PS8) pMailBoxNumber[1]);                        
  296.                         }
  297.                         else
  298.                         {
  299.                             DisplayPopup(
  300.                                 (PU8) GetString(STR_VM_NO_NUMBER_TO_DIAL),
  301.                                 IMG_GLOBAL_WARNING,
  302.                                 1,
  303.                                 MESSAGES_POPUP_TIME_OUT,
  304.                                 (U8) WARNING_TONE);
  305.                         }                    
  306.                     }
  307.                 }
  308.                 else
  309.                 {
  310.                     if (pMailBoxNumber[0] != NULL &&
  311.                         pfnUnicodeStrlen((PS8) pMailBoxNumber[0]) != 0)
  312.                     {                        
  313.                         MakeCall((PS8) pMailBoxNumber[0]);                        
  314.                     }
  315.                     else
  316.                     {
  317.                         /* Impossible case */
  318.                         DisplayPopup(
  319.                             (PU8) GetString(STR_VM_NO_NUMBER_TO_DIAL),
  320.                             IMG_GLOBAL_WARNING,
  321.                             1,
  322.                             MESSAGES_POPUP_TIME_OUT,
  323.                             (U8) WARNING_TONE);
  324.                         
  325.                         MMI_ASSERT(0);
  326.                     }
  327.                 }
  328.             }
  329.             else
  330.             {
  331.                 if (mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX)
  332.                 {
  333.                     DisplayPopup(
  334.                         (PU8) GetString(STR_VOICE_MAIL_NOT_READY_YET),
  335.                         IMG_GLOBAL_UNFINISHED,
  336.                         1,
  337.                         MESSAGES_POPUP_TIME_OUT,
  338.                         (U8) ERROR_TONE);
  339.                 }
  340.                 else
  341.                 {
  342.                     DisplayPopup(
  343.                         (PU8) GetString(STR_VM_NO_NUMBER_TO_DIAL),
  344.                         IMG_GLOBAL_WARNING,
  345.                         1,
  346.                         MESSAGES_POPUP_TIME_OUT,
  347.                         (U8) WARNING_TONE);
  348.                 }
  349.             }
  350.             FreeVoiceMailData();
  351.         }
  352.     }
  353.     else
  354.     {
  355.         DisplayPopup(
  356.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  357.             IMG_GLOBAL_UNFINISHED,
  358.             1,
  359.             MESSAGES_POPUP_TIME_OUT,
  360.             (U8) WARNING_TONE);
  361.     }
  362. }
  363. /*****************************************************************************
  364.  * FUNCTION
  365.  *  mmi_msg_dial_mailbox_req
  366.  * DESCRIPTION
  367.  *  
  368.  * PARAMETERS
  369.  *  void
  370.  * RETURNS
  371.  *  void
  372.  *****************************************************************************/
  373. void mmi_msg_dial_mailbox_req(void)
  374. {
  375.     /*----------------------------------------------------------------*/
  376.     /* Local Variables                                                */
  377.     /*----------------------------------------------------------------*/
  378.     /*----------------------------------------------------------------*/
  379.     /* Code Body                                                      */
  380.     /*----------------------------------------------------------------*/
  381.     ClearInputEventHandler(MMI_DEVICE_ALL);
  382.     mmi_frm_sms_get_mailbox_info(mmi_msg_dial_mailbox_rsp, MOD_MMI);
  383. }
  384. /*****************************************************************************
  385.  * FUNCTION
  386.  *  mmi_msg_get_mailbox_list_rsp
  387.  * DESCRIPTION
  388.  *  
  389.  * PARAMETERS
  390.  *  mailbox     [?]         
  391.  *  mod         [IN]        
  392.  *  result      [IN]        
  393.  * RETURNS
  394.  *  void
  395.  *****************************************************************************/
  396. void mmi_msg_get_mailbox_list_rsp(void *mailbox, module_type mod, U16 result)
  397. {
  398.     /*----------------------------------------------------------------*/
  399.     /* Local Variables                                                */
  400.     /*----------------------------------------------------------------*/
  401.     /*----------------------------------------------------------------*/
  402.     /* Code Body                                                      */
  403.     /*----------------------------------------------------------------*/
  404.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  405.     if (mmi_msg_check_interrupt() == TRUE)
  406.     {
  407.         return;
  408.     }
  409.     if (result == MMI_FRM_SMS_OK)
  410.     {
  411.         mmi_frm_sms_mailbox_struct *mailboxlist = (mmi_frm_sms_mailbox_struct*) mailbox;
  412.         U8 i = 0;
  413.         mmi_msg_mailbox_num = (U16)mailboxlist->mailboxNumber;
  414.         if (mailboxlist->mailboxNumber == 0)
  415.         {
  416.             DisplayPopup(
  417.                 (PU8) GetString(STR_GLOBAL_EMPTY),
  418.                 IMG_GLOBAL_EMPTY,
  419.                 1,
  420.                 MESSAGES_POPUP_TIME_OUT,
  421.                 (U8) EMPTY_LIST_TONE);
  422.         }
  423.         else
  424.         {
  425.             psMailboxEditInfo.malboxNameLength = mailboxlist->mailboxNameLength;
  426.             for (i = 0; i < mailboxlist->mailboxNumber; i++)
  427.             {
  428.                 pMailBoxName[i] = OslMalloc((MAX_PROFILE_NAME_LEN * ENCODING_LENGTH) + ENCODING_LENGTH);
  429.                 pfnUnicodeStrcpy((S8*) pMailBoxName[i], (S8*) mailboxlist->pMailBoxName[i]);
  430.                 pMailBoxNumber[i] = OslMalloc((MAX_CC_ADDR_LEN * ENCODING_LENGTH) + ENCODING_LENGTH);
  431.                 pfnUnicodeStrcpy((S8*) pMailBoxNumber[i], (S8*) mailboxlist->pMailBoxNumber[i]);
  432.                 psMailBoxDCS[i] = mailboxlist->mailboxNameDcs[i];
  433.             }
  434.             mmi_msg_entry_voice_mail_server();
  435.         }
  436.     }
  437.     else
  438.     {
  439.         DisplayPopup(
  440.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  441.             IMG_GLOBAL_UNFINISHED,
  442.             1,
  443.             MESSAGES_POPUP_TIME_OUT,
  444.             (U8) WARNING_TONE);
  445.     }
  446. }
  447. /*****************************************************************************
  448.  * FUNCTION
  449.  *  mmi_msg_get_mailbox_list_req
  450.  * DESCRIPTION
  451.  *  
  452.  * PARAMETERS
  453.  *  void
  454.  * RETURNS
  455.  *  void
  456.  *****************************************************************************/
  457. void mmi_msg_get_mailbox_list_req(void)
  458. {
  459.     /*----------------------------------------------------------------*/
  460.     /* Local Variables                                                */
  461.     /*----------------------------------------------------------------*/
  462.     /*----------------------------------------------------------------*/
  463.     /* Code Body                                                      */
  464.     /*----------------------------------------------------------------*/
  465.     ClearInputEventHandler(MMI_DEVICE_ALL);
  466.     mmi_frm_sms_get_mailbox_info(mmi_msg_get_mailbox_list_rsp, MOD_MMI);
  467. }
  468. /*****************************************************************************
  469.  * FUNCTION
  470.  *  mmi_msg_set_profile_active_rsp
  471.  * DESCRIPTION
  472.  *  
  473.  * PARAMETERS
  474.  *  index       [?]         
  475.  *  mod_src     [IN]        
  476.  *  result      [IN]        
  477.  * RETURNS
  478.  *  void
  479.  *****************************************************************************/
  480. void mmi_msg_set_profile_active_rsp(void *index, module_type mod_src, U16 result)
  481. {
  482.     /*----------------------------------------------------------------*/
  483.     /* Local Variables                                                */
  484.     /*----------------------------------------------------------------*/
  485.     /*----------------------------------------------------------------*/
  486.     /* Code Body                                                      */
  487.     /*----------------------------------------------------------------*/
  488.     psProfileNameList.currReqProfileNo = *((U8*) index);
  489.     DisplayPopup(
  490.         (PU8) GetString(STR_GLOBAL_SAVED),
  491.         IMG_GLOBAL_ACTIVATED,
  492.         1,
  493.         MESSAGES_POPUP_TIME_OUT,
  494.         (U8) SUCCESS_TONE);
  495.     DeleteMessagesHistoryNodes();
  496. }
  497. /*****************************************************************************
  498.  * FUNCTION
  499.  *  mmi_msg_set_profile_active_req
  500.  * DESCRIPTION
  501.  *  
  502.  * PARAMETERS
  503.  *  index       [?]     
  504.  * RETURNS
  505.  *  void
  506.  *****************************************************************************/
  507. void mmi_msg_set_profile_active_req(U8 *index)
  508. {
  509.     /*----------------------------------------------------------------*/
  510.     /* Local Variables                                                */
  511.     /*----------------------------------------------------------------*/
  512.     /*----------------------------------------------------------------*/
  513.     /* Code Body                                                      */
  514.     /*----------------------------------------------------------------*/
  515.     ClearInputEventHandler(MMI_DEVICE_ALL);
  516.     mmi_frm_sms_set_profile_active(mmi_msg_set_profile_active_rsp, MOD_MMI, index);
  517. }
  518. /*****************************************************************************
  519.  * FUNCTION
  520.  *  mmi_msg_save_profile_active
  521.  * DESCRIPTION
  522.  *  
  523.  * PARAMETERS
  524.  *  void
  525.  * RETURNS
  526.  *  void
  527.  *****************************************************************************/
  528. void mmi_msg_save_profile_active(void)
  529. {
  530.     /*----------------------------------------------------------------*/
  531.     /* Local Variables                                                */
  532.     /*----------------------------------------------------------------*/
  533.     /*----------------------------------------------------------------*/
  534.     /* Code Body                                                      */
  535.     /*----------------------------------------------------------------*/
  536.     ClearInputEventHandler(MMI_DEVICE_ALL);
  537.     mmi_msg_set_profile_active_req((U8*) & (g_msg_cntx.currHiliteIndex));
  538. }
  539. /*****************************************************************************
  540.  * FUNCTION
  541.  *  mmi_msg_set_mailbox_inline_item_rsp
  542.  * DESCRIPTION
  543.  *  
  544.  * PARAMETERS
  545.  *  mailboxdetail       [?]         
  546.  *  mod                 [IN]        
  547.  *  result              [IN]        
  548.  * RETURNS
  549.  *  void
  550.  *****************************************************************************/
  551. void mmi_msg_set_mailbox_inline_item_rsp(void *mailboxdetail, module_type mod, U16 result)
  552. {
  553.     /*----------------------------------------------------------------*/
  554.     /* Local Variables                                                */
  555.     /*----------------------------------------------------------------*/
  556.     /*----------------------------------------------------------------*/
  557.     /* Code Body                                                      */
  558.     /*----------------------------------------------------------------*/
  559.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_VOICE_MAIL_OPTION);
  560.     if (result == MMI_FRM_SMS_OK)
  561.     {
  562.         msg_mailbox_edit_struct *mailbox = (msg_mailbox_edit_struct*) mailboxdetail;
  563.         pfnUnicodeStrcpy((S8*) pMailBoxName[mailbox->mailboxIndex], (S8*) mailbox->mailboxName);
  564.         pfnUnicodeStrcpy((S8*) pMailBoxNumber[mailbox->mailboxIndex], (S8*) mailbox->mailboxAddress);
  565.         DisplayPopup(
  566.             (PU8) GetString(STR_GLOBAL_DONE),
  567.             IMG_GLOBAL_ACTIVATED,
  568.             1,
  569.             MESSAGES_POPUP_TIME_OUT,
  570.             (U8) SUCCESS_TONE);
  571.     }
  572.     else
  573.     {
  574.         DisplayPopup(
  575.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  576.             IMG_GLOBAL_UNFINISHED,
  577.             1,
  578.             MESSAGES_POPUP_TIME_OUT,
  579.             (U8) WARNING_TONE);
  580.     }
  581.     DeleteMessagesHistoryNodes();
  582. }
  583. /*****************************************************************************
  584.  * FUNCTION
  585.  *  mmi_msg_set_mailbox_inline_item_req
  586.  * DESCRIPTION
  587.  *  
  588.  * PARAMETERS
  589.  *  void
  590.  * RETURNS
  591.  *  void
  592.  *****************************************************************************/
  593. void mmi_msg_set_mailbox_inline_item_req(void)
  594. {
  595.     /*----------------------------------------------------------------*/
  596.     /* Local Variables                                                */
  597.     /*----------------------------------------------------------------*/
  598.     /*----------------------------------------------------------------*/
  599.     /* Code Body                                                      */
  600.     /*----------------------------------------------------------------*/
  601.     ClearInputEventHandler(MMI_DEVICE_ALL);
  602.     mmi_frm_sms_set_mailbox_info(mmi_msg_set_mailbox_inline_item_rsp, MOD_MMI, (void*)&psMailboxEditInfo);
  603. }
  604. /*****************************************************************************
  605.  * FUNCTION
  606.  *  mmi_msg_dial_mailbox_address
  607.  * DESCRIPTION
  608.  *  
  609.  * PARAMETERS
  610.  *  void
  611.  * RETURNS
  612.  *  void
  613.  *****************************************************************************/
  614. void mmi_msg_dial_mailbox_address(void)
  615. {
  616.     /*----------------------------------------------------------------*/
  617.     /* Local Variables                                                */
  618.     /*----------------------------------------------------------------*/
  619.     /*----------------------------------------------------------------*/
  620.     /* Code Body                                                      */
  621.     /*----------------------------------------------------------------*/
  622.     if (pfnUnicodeStrlen((PS8) pMailBoxNumber[g_msg_cntx.currHiliteIndex]) != 0)
  623.     {
  624.         MakeCall((PS8) pMailBoxNumber[g_msg_cntx.currHiliteIndex]);
  625.     }
  626.     else
  627.     {
  628.         DisplayPopup(
  629.             (PU8) GetString(STR_VM_NO_NUMBER_TO_DIAL),
  630.             IMG_GLOBAL_WARNING,
  631.             1,
  632.             MESSAGES_POPUP_TIME_OUT,
  633.             (U8) WARNING_TONE);
  634.     }
  635. }
  636. /*****************************************************************************
  637.  * FUNCTION
  638.  *  mmi_msg_get_profile_list_rsp
  639.  * DESCRIPTION
  640.  *  
  641.  * PARAMETERS
  642.  *  profilelist     [?]         
  643.  *  mod             [IN]        
  644.  *  result          [IN]        
  645.  * RETURNS
  646.  *  void
  647.  *****************************************************************************/
  648. void mmi_msg_get_profile_list_rsp(void *profilelist, module_type mod, U16 result)
  649. {
  650.     /*----------------------------------------------------------------*/
  651.     /* Local Variables                                                */
  652.     /*----------------------------------------------------------------*/
  653.     /*----------------------------------------------------------------*/
  654.     /* Code Body                                                      */
  655.     /*----------------------------------------------------------------*/
  656.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  657.     if (mmi_msg_check_interrupt() == TRUE)
  658.     {
  659.         return;
  660.     }
  661.     if (result == MMI_FRM_SMS_OK)
  662.     {
  663.         memset(&psProfileNameList, 0, sizeof(msg_profile_list_struct));
  664.         memcpy((S8*) & psProfileNameList, (S8*) profilelist, sizeof(msg_profile_list_struct));
  665.         if (psProfileNameList.currMaxPsProfiles > 0)
  666.         {
  667.             mmi_msg_entry_profile_settings();
  668.         }
  669.         else
  670.         {
  671.             DisplayPopup(
  672.                 (PU8) GetString(STR_GLOBAL_EMPTY),
  673.                 IMG_GLOBAL_EMPTY,
  674.                 1,
  675.                 MESSAGES_POPUP_TIME_OUT,
  676.                 (U8) EMPTY_LIST_TONE);
  677.         }
  678.     }
  679.     else
  680.     {
  681.         DisplayPopup(
  682.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  683.             IMG_GLOBAL_UNFINISHED,
  684.             1,
  685.             MESSAGES_POPUP_TIME_OUT,
  686.             (U8) WARNING_TONE);
  687.     }
  688. }
  689. /*****************************************************************************
  690.  * FUNCTION
  691.  *  mmi_msg_get_profile_list_req
  692.  * DESCRIPTION
  693.  *  
  694.  * PARAMETERS
  695.  *  void
  696.  * RETURNS
  697.  *  void
  698.  *****************************************************************************/
  699. void mmi_msg_get_profile_list_req(void)
  700. {
  701.     /*----------------------------------------------------------------*/
  702.     /* Local Variables                                                */
  703.     /*----------------------------------------------------------------*/
  704.     /*----------------------------------------------------------------*/
  705.     /* Code Body                                                      */
  706.     /*----------------------------------------------------------------*/
  707.     ClearInputEventHandler(MMI_DEVICE_ALL);
  708.     mmi_frm_sms_get_profile_list(mmi_msg_get_profile_list_rsp, MOD_MMI);
  709. }
  710. /*****************************************************************************
  711.  * FUNCTION
  712.  *  mmi_msg_get_profile_highlight_index
  713.  * DESCRIPTION
  714.  *  
  715.  * PARAMETERS
  716.  *  nIndex      [IN]        
  717.  * RETURNS
  718.  *  void
  719.  *****************************************************************************/
  720. void mmi_msg_get_profile_highlight_index(S32 nIndex)
  721. {
  722.     /*----------------------------------------------------------------*/
  723.     /* Local Variables                                                */
  724.     /*----------------------------------------------------------------*/
  725.     /*----------------------------------------------------------------*/
  726.     /* Code Body                                                      */
  727.     /*----------------------------------------------------------------*/
  728.     g_msg_cntx.currHiliteIndex = nIndex;
  729.     if (g_msg_cntx.currHiliteIndex != psProfileNameList.currReqProfileNo)
  730.     {
  731.         mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_save_profile_active, Messages2GoBackHistory);
  732.         ChangeRightSoftkey(STR_GLOBAL_DONE, IMG_GLOBAL_BACK);
  733.         SetRightSoftkeyFunction(mmi_msg_entry_confirm_generic, KEY_EVENT_UP);
  734.     }
  735.     else
  736.     {
  737.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  738.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  739.     }
  740. }
  741. /*****************************************************************************
  742.  * FUNCTION
  743.  *  mmi_msg_set_profile_inline_item_rsp
  744.  * DESCRIPTION
  745.  *  
  746.  * PARAMETERS
  747.  *  profiledetail       [?]         
  748.  *  mod                 [IN]        
  749.  *  result              [IN]        
  750.  * RETURNS
  751.  *  void
  752.  *****************************************************************************/
  753. void mmi_msg_set_profile_inline_item_rsp(void *profiledetail, module_type mod, U16 result)
  754. {
  755.     /*----------------------------------------------------------------*/
  756.     /* Local Variables                                                */
  757.     /*----------------------------------------------------------------*/
  758.     /*----------------------------------------------------------------*/
  759.     /* Code Body                                                      */
  760.     /*----------------------------------------------------------------*/
  761.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_PROFILE_EDIT);
  762.     if (result == MMI_FRM_SMS_OK)
  763.     {
  764.         msg_profile_edit_struct *profile = (msg_profile_edit_struct*) profiledetail;
  765.         pfnUnicodeStrcpy(
  766.             (S8*) & psProfileNameList.profileName[psProfileEditInfo.profileIndex],
  767.             (S8*) profile->profileName);
  768.         switch (profile->vpIndex)
  769.         {
  770.             case SMSAL_VP_1_HR:
  771.                 psProfileEditInfo.vpIndex = 0;
  772.                 break;
  773.             case SMSAL_VP_6_HR:
  774.                 psProfileEditInfo.vpIndex = 1;
  775.                 break;                
  776.             case SMSAL_VP_12_HR:
  777.                 psProfileEditInfo.vpIndex = 2;
  778.                 break;
  779.             case SMSAL_VP_24_HR:
  780.                 psProfileEditInfo.vpIndex = 3;
  781.                 break;
  782.             case SMSAL_VP_72_HR:
  783.                 psProfileEditInfo.vpIndex = 4;
  784.                 break;                
  785.             case SMSAL_VP_1_WEEK:
  786.                 psProfileEditInfo.vpIndex = 5;
  787.                 break;
  788.             case SMSAL_VP_MAX:
  789.                 psProfileEditInfo.vpIndex = 6;
  790.                 break;
  791.             default:
  792.                 psProfileEditInfo.vpIndex = 6;
  793.                 break;
  794.         }
  795.         switch (profile->msgTypeIndex)
  796.         {
  797.             case SMSAL_DEFAULT_PID:
  798.                 psProfileEditInfo.msgTypeIndex = 0;
  799.                 break;
  800.             case SMSAL_G3_FAX_PID:
  801.                 psProfileEditInfo.msgTypeIndex = 1;
  802.                 break;
  803.             case SMSAL_PAGING_PID:
  804.                 psProfileEditInfo.msgTypeIndex = 2;
  805.                 break;
  806.             case SMSAL_EMAIL_PID:
  807.                 psProfileEditInfo.msgTypeIndex = 3;
  808.                 break;
  809.             default:
  810.                 psProfileEditInfo.msgTypeIndex = 0;
  811.                 break;
  812.         }
  813.         DisplayPopup(
  814.             (PU8) GetString(STR_GLOBAL_SAVED),
  815.             IMG_GLOBAL_ACTIVATED,
  816.             1,
  817.             MESSAGES_POPUP_TIME_OUT,
  818.             (U8) SUCCESS_TONE);
  819.     }
  820.     else
  821.     {
  822.         DisplayPopup(
  823.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  824.             IMG_GLOBAL_UNFINISHED,
  825.             1,
  826.             MESSAGES_POPUP_TIME_OUT,
  827.             (U8) WARNING_TONE);
  828.     }
  829.     DeleteMessagesHistoryNodes();
  830. }
  831. /*****************************************************************************
  832.  * FUNCTION
  833.  *  mmi_msg_set_profile_inline_item_req
  834.  * DESCRIPTION
  835.  *  
  836.  * PARAMETERS
  837.  *  void
  838.  * RETURNS
  839.  *  void
  840.  *****************************************************************************/
  841. void mmi_msg_set_profile_inline_item_req(void)
  842. {
  843.     /*----------------------------------------------------------------*/
  844.     /* Local Variables                                                */
  845.     /*----------------------------------------------------------------*/
  846.     /*----------------------------------------------------------------*/
  847.     /* Code Body                                                      */
  848.     /*----------------------------------------------------------------*/
  849.     if (!IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Validity_Period))
  850.     {
  851.         switch ((U8) psProfileEditInfo.vpIndex)
  852.         {
  853.             case 0:
  854.                 psProfileEditInfo.vpIndex = SMSAL_VP_1_HR;
  855.                 break;
  856.             case 1:
  857.                 psProfileEditInfo.vpIndex = SMSAL_VP_6_HR;
  858.                 break;
  859.             case 2:
  860.                 psProfileEditInfo.vpIndex = SMSAL_VP_12_HR;
  861.                 break;
  862.             case 3:
  863.                 psProfileEditInfo.vpIndex = SMSAL_VP_24_HR;
  864.                 break;
  865.             case 4:
  866.                 psProfileEditInfo.vpIndex = SMSAL_VP_72_HR;
  867.                 break;                
  868.             case 5:
  869.                 psProfileEditInfo.vpIndex = SMSAL_VP_1_WEEK;
  870.                 break;
  871.             case 6:
  872.                 psProfileEditInfo.vpIndex = SMSAL_VP_MAX;
  873.                 break;
  874.             default:
  875.                 psProfileEditInfo.vpIndex = SMSAL_VP_MAX;
  876.                 break;
  877.         }
  878.     }
  879.     if (!IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Protocol_ID))
  880.     {
  881.         switch ((U8) psProfileEditInfo.msgTypeIndex)
  882.         {
  883.             case 0:
  884.                 psProfileEditInfo.msgTypeIndex = SMSAL_DEFAULT_PID;
  885.                 break;
  886.             case 1:
  887.                 psProfileEditInfo.msgTypeIndex = SMSAL_G3_FAX_PID;
  888.                 break;
  889.             case 2:
  890.                 if (!IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_SM_MO_PAGING))
  891.                 {
  892.                     psProfileEditInfo.msgTypeIndex = SMSAL_PAGING_PID;
  893.                     break;
  894.                 }
  895.             case 3:
  896.                 if (!IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_SM_MO_EMAIL))
  897.                 {
  898.                     psProfileEditInfo.msgTypeIndex = SMSAL_EMAIL_PID;
  899.                     break;
  900.                 }
  901.             default:
  902.                 psProfileEditInfo.msgTypeIndex = SMSAL_DEFAULT_PID;
  903.                 break;
  904.         }
  905.     }
  906.     ClearAllKeyHandler();
  907.     mmi_frm_sms_set_profile_detail(mmi_msg_set_profile_inline_item_rsp, MOD_MMI, (void*)&psProfileEditInfo);
  908. }
  909. /*****************************************************************************
  910.  * FUNCTION
  911.  *  mmi_msg_get_profile_inline_item_rsp
  912.  * DESCRIPTION
  913.  *  
  914.  * PARAMETERS
  915.  *  profiledetail       [?]         
  916.  *  mod                 [IN]        
  917.  *  result              [IN]        
  918.  * RETURNS
  919.  *  void
  920.  *****************************************************************************/
  921. void mmi_msg_get_profile_inline_item_rsp(void *profiledetail, module_type mod, U16 result)
  922. {
  923.     /*----------------------------------------------------------------*/
  924.     /* Local Variables                                                */
  925.     /*----------------------------------------------------------------*/
  926.     /*----------------------------------------------------------------*/
  927.     /* Code Body                                                      */
  928.     /*----------------------------------------------------------------*/
  929.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  930.     if (mmi_msg_check_interrupt() == TRUE)
  931.     {
  932.         return;
  933.     }
  934.     if (result == MMI_FRM_SMS_OK)
  935.     {
  936.         memcpy((S8*) & psProfileEditInfo, (S8*) profiledetail, sizeof(msg_profile_edit_struct));
  937.         psProfileEditInfo.profileIndex = g_msg_cntx.currHiliteIndex;
  938.         switch (psProfileEditInfo.vpIndex)
  939.         {
  940.             case SMSAL_VP_1_HR:
  941.                 psProfileEditInfo.vpIndex = 0;
  942.                 break;
  943.             case SMSAL_VP_6_HR:
  944.                 psProfileEditInfo.vpIndex = 1;
  945.                 break;
  946.             case SMSAL_VP_12_HR:
  947.                 psProfileEditInfo.vpIndex = 2;
  948.                 break;
  949.             case SMSAL_VP_24_HR:
  950.                 psProfileEditInfo.vpIndex = 3;
  951.                 break;
  952.             case SMSAL_VP_72_HR:
  953.                 psProfileEditInfo.vpIndex = 4;
  954.                 break;                
  955.             case SMSAL_VP_1_WEEK:
  956.                 psProfileEditInfo.vpIndex = 5;
  957.                 break;
  958.             case SMSAL_VP_MAX:
  959.                 psProfileEditInfo.vpIndex = 6;
  960.                 break;
  961.             default:
  962.                 psProfileEditInfo.vpIndex = 6;
  963.                 break;
  964.         }
  965.         switch (psProfileEditInfo.msgTypeIndex)
  966.         {
  967.             case SMSAL_DEFAULT_PID:
  968.                 psProfileEditInfo.msgTypeIndex = 0;
  969.                 break;
  970.             case SMSAL_G3_FAX_PID:
  971.                 psProfileEditInfo.msgTypeIndex = 1;
  972.                 break;
  973.             case SMSAL_PAGING_PID:
  974.                 psProfileEditInfo.msgTypeIndex = 2;
  975.                 break;
  976.             case SMSAL_EMAIL_PID:
  977.                 psProfileEditInfo.msgTypeIndex = 3;
  978.                 break;
  979.             default:
  980.                 psProfileEditInfo.msgTypeIndex = 0;
  981.                 break;
  982.         }
  983.         mmi_msg_entry_profile_edit();
  984.     }
  985.     else
  986.     {
  987.         DisplayPopup(
  988.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  989.             IMG_GLOBAL_UNFINISHED,
  990.             1,
  991.             MESSAGES_POPUP_TIME_OUT,
  992.             (U8) WARNING_TONE);
  993.     }
  994. }
  995. /*****************************************************************************
  996.  * FUNCTION
  997.  *  mmi_msg_get_profile_inline_item_req
  998.  * DESCRIPTION
  999.  *  
  1000.  * PARAMETERS
  1001.  *  void
  1002.  * RETURNS
  1003.  *  void
  1004.  *****************************************************************************/
  1005. void mmi_msg_get_profile_inline_item_req(void)
  1006. {
  1007.     /*----------------------------------------------------------------*/
  1008.     /* Local Variables                                                */
  1009.     /*----------------------------------------------------------------*/
  1010.     /*----------------------------------------------------------------*/
  1011.     /* Code Body                                                      */
  1012.     /*----------------------------------------------------------------*/
  1013.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1014.     mmi_frm_sms_get_profile_detail(mmi_msg_get_profile_inline_item_rsp, MOD_MMI, (U8) g_msg_cntx.currHiliteIndex);
  1015. }
  1016. /*****************************************************************************
  1017.  * FUNCTION
  1018.  *  mmi_msg_get_common_settings_rsp
  1019.  * DESCRIPTION
  1020.  *  
  1021.  * PARAMETERS
  1022.  *  data        [?]         
  1023.  *  mod         [IN]        
  1024.  *  result      [IN]        
  1025.  * RETURNS
  1026.  *  void
  1027.  *****************************************************************************/
  1028. void mmi_msg_get_common_settings_rsp(void *data, module_type mod, U16 result)
  1029. {
  1030.     /*----------------------------------------------------------------*/
  1031.     /* Local Variables                                                */
  1032.     /*----------------------------------------------------------------*/
  1033.     /*----------------------------------------------------------------*/
  1034.     /* Code Body                                                      */
  1035.     /*----------------------------------------------------------------*/
  1036.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  1037.     if (mmi_msg_check_interrupt() == TRUE)
  1038.     {
  1039.         return;
  1040.     }
  1041. #ifndef MMI_ON_HARDWARE_P
  1042.     mmi_msg_entry_common_settings();
  1043. #else /* MMI_ON_HARDWARE_P */ 
  1044.     if (result == MMI_FRM_SMS_OK)
  1045.     {
  1046.         U8 *DrRp = (U8*) data;
  1047.         DeliveryRepyStates[0] = DrRp[0];
  1048.         DeliveryRepyStates[1] = DrRp[1];
  1049.         mmi_msg_entry_common_settings();
  1050.     }
  1051.     else
  1052.     {
  1053.         DisplayPopup(
  1054.             (PU8) GetString(STR_MESSAGES_UNKNOWN_ERROR),
  1055.             IMG_GLOBAL_UNFINISHED,
  1056.             1,
  1057.             MESSAGES_POPUP_TIME_OUT,
  1058.             (U8) ERROR_TONE);
  1059.     }
  1060. #endif /* MMI_ON_HARDWARE_P */ 
  1061. }
  1062. /*****************************************************************************
  1063.  * FUNCTION
  1064.  *  mmi_msg_get_common_settings_req
  1065.  * DESCRIPTION
  1066.  *  
  1067.  * PARAMETERS
  1068.  *  void
  1069.  * RETURNS
  1070.  *  void
  1071.  *****************************************************************************/
  1072. void mmi_msg_get_common_settings_req(void)
  1073. {
  1074.     /*----------------------------------------------------------------*/
  1075.     /* Local Variables                                                */
  1076.     /*----------------------------------------------------------------*/
  1077.     /*----------------------------------------------------------------*/
  1078.     /* Code Body                                                      */
  1079.     /*----------------------------------------------------------------*/
  1080.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1081.     mmi_frm_sms_get_common_settings(mmi_msg_get_common_settings_rsp, MOD_MMI);
  1082. }
  1083. /*****************************************************************************
  1084.  * FUNCTION
  1085.  *  mmi_msg_set_common_settings_rsp
  1086.  * DESCRIPTION
  1087.  *  
  1088.  * PARAMETERS
  1089.  *  dummy       [?]         
  1090.  *  mod         [IN]        
  1091.  *  result      [IN]        
  1092.  * RETURNS
  1093.  *  void
  1094.  *****************************************************************************/
  1095. void mmi_msg_set_common_settings_rsp(void *dummy, module_type mod, U16 result)
  1096. {
  1097. #ifndef MMI_ON_HARDWARE_P
  1098.     /*----------------------------------------------------------------*/
  1099.     /* Local Variables                                                */
  1100.     /*----------------------------------------------------------------*/
  1101.     /*----------------------------------------------------------------*/
  1102.     /* Code Body                                                      */
  1103.     /*----------------------------------------------------------------*/
  1104.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, MESSAGES_POPUP_TIME_OUT, (U8) SUCCESS_TONE);
  1105.     DeleteMessagesHistoryNodes();
  1106. #else /* MMI_ON_HARDWARE_P */ 
  1107.     if (result == MMI_FRM_SMS_OK)
  1108.     {
  1109.         DisplayPopup(
  1110.             (PU8) GetString(STR_GLOBAL_DONE),
  1111.             IMG_GLOBAL_ACTIVATED,
  1112.             1,
  1113.             MESSAGES_POPUP_TIME_OUT,
  1114.             (U8) SUCCESS_TONE);
  1115.     }
  1116.     else
  1117.     {
  1118.         DisplayPopup(
  1119.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  1120.             IMG_GLOBAL_UNFINISHED,
  1121.             1,
  1122.             MESSAGES_POPUP_TIME_OUT,
  1123.             (U8) WARNING_TONE);
  1124.     }
  1125.     DeleteMessagesHistoryNodes();
  1126. #endif /* MMI_ON_HARDWARE_P */ 
  1127. }
  1128. /*****************************************************************************
  1129.  * FUNCTION
  1130.  *  mmi_msg_set_common_settings_req
  1131.  * DESCRIPTION
  1132.  *  
  1133.  * PARAMETERS
  1134.  *  void
  1135.  * RETURNS
  1136.  *  void
  1137.  *****************************************************************************/
  1138. void mmi_msg_set_common_settings_req(void)
  1139. {
  1140.     /*----------------------------------------------------------------*/
  1141.     /* Local Variables                                                */
  1142.     /*----------------------------------------------------------------*/
  1143.     /*----------------------------------------------------------------*/
  1144.     /* Code Body                                                      */
  1145.     /*----------------------------------------------------------------*/
  1146.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1147.     mmi_frm_sms_set_common_settings(mmi_msg_set_common_settings_rsp, MOD_MMI, DeliveryRepyStates);
  1148. }
  1149. #ifdef __MMI_GPRS_FEATURES__
  1150. /*****************************************************************************
  1151.  * FUNCTION
  1152.  *  mmi_msg_get_bearer_service_rsp
  1153.  * DESCRIPTION
  1154.  *  
  1155.  * PARAMETERS
  1156.  *  bearer      [?]         
  1157.  *  mod         [IN]        
  1158.  *  result      [IN]        
  1159.  * RETURNS
  1160.  *  void
  1161.  *****************************************************************************/
  1162. void mmi_msg_get_bearer_service_rsp(void *bearer, module_type mod, U16 result)
  1163. {
  1164.     /*----------------------------------------------------------------*/
  1165.     /* Local Variables                                                */
  1166.     /*----------------------------------------------------------------*/
  1167.     /*----------------------------------------------------------------*/
  1168.     /* Code Body                                                      */
  1169.     /*----------------------------------------------------------------*/
  1170.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  1171.     if (mmi_msg_check_interrupt() == TRUE)
  1172.     {
  1173.         return;
  1174.     }
  1175. #ifndef MMI_ON_HARDWARE_P
  1176.     mmi_msg_entry_msg_settings();
  1177. #else /* MMI_ON_HARDWARE_P */ 
  1178.     if (result == MMI_FRM_SMS_OK)
  1179.     {
  1180.         preferBearer = (msg_bearer_enum) (*(U8*) bearer);
  1181.         mmi_msg_entry_msg_settings();
  1182.     }
  1183.     else
  1184.     {
  1185.         DisplayPopup(
  1186.             (PU8) GetString(STR_MESSAGES_UNKNOWN_ERROR),
  1187.             IMG_GLOBAL_UNFINISHED,
  1188.             1,
  1189.             MESSAGES_POPUP_TIME_OUT,
  1190.             (U8) ERROR_TONE);
  1191.     }
  1192. #endif /* MMI_ON_HARDWARE_P */ 
  1193. }
  1194. /*****************************************************************************
  1195.  * FUNCTION
  1196.  *  mmi_msg_get_bearer_service_req
  1197.  * DESCRIPTION
  1198.  *  
  1199.  * PARAMETERS
  1200.  *  void
  1201.  * RETURNS
  1202.  *  void
  1203.  *****************************************************************************/
  1204. void mmi_msg_get_bearer_service_req(void)
  1205. {
  1206.     /*----------------------------------------------------------------*/
  1207.     /* Local Variables                                                */
  1208.     /*----------------------------------------------------------------*/
  1209.     /*----------------------------------------------------------------*/
  1210.     /* Code Body                                                      */
  1211.     /*----------------------------------------------------------------*/
  1212.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1213.     mmi_frm_sms_get_preferred_bearer(mmi_msg_get_bearer_service_rsp, MOD_MMI);
  1214. }
  1215. /*****************************************************************************
  1216.  * FUNCTION
  1217.  *  mmi_msg_set_bearer_service_rsp
  1218.  * DESCRIPTION
  1219.  *  
  1220.  * PARAMETERS
  1221.  *  dummy       [?]         
  1222.  *  mod         [IN]        
  1223.  *  result      [IN]        
  1224.  * RETURNS
  1225.  *  void
  1226.  *****************************************************************************/
  1227. void mmi_msg_set_bearer_service_rsp(void *dummy, module_type mod, U16 result)
  1228. {
  1229. #ifndef MMI_ON_HARDWARE_P
  1230.     /*----------------------------------------------------------------*/
  1231.     /* Local Variables                                                */
  1232.     /*----------------------------------------------------------------*/
  1233.     /*----------------------------------------------------------------*/
  1234.     /* Code Body                                                      */
  1235.     /*----------------------------------------------------------------*/
  1236.     preferBearer = g_msg_cntx.currHiliteIndex;
  1237.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, MESSAGES_POPUP_TIME_OUT, (U8) SUCCESS_TONE);
  1238.     DeleteMessagesHistoryNodes();
  1239. #else /* MMI_ON_HARDWARE_P */ 
  1240.     if (result == MMI_FRM_SMS_OK)
  1241.     {
  1242.         preferBearer = (msg_bearer_enum) g_msg_cntx.currHiliteIndex;
  1243.         DisplayPopup(
  1244.             (PU8) GetString(STR_GLOBAL_DONE),
  1245.             IMG_GLOBAL_ACTIVATED,
  1246.             1,
  1247.             MESSAGES_POPUP_TIME_OUT,
  1248.             (U8) SUCCESS_TONE);
  1249.         DeleteMessagesHistoryNodes();
  1250.     }
  1251.     else
  1252.     {
  1253.         DisplayPopup(
  1254.             (PU8) GetString(STR_MESSAGES_UNKNOWN_ERROR),
  1255.             IMG_GLOBAL_UNFINISHED,
  1256.             1,
  1257.             MESSAGES_POPUP_TIME_OUT,
  1258.             (U8) ERROR_TONE);
  1259.         DeleteMessagesHistoryNodes();
  1260.     }
  1261. #endif /* MMI_ON_HARDWARE_P */ 
  1262. }
  1263. /*****************************************************************************
  1264.  * FUNCTION
  1265.  *  mmi_msg_set_bearer_service_req
  1266.  * DESCRIPTION
  1267.  *  
  1268.  * PARAMETERS
  1269.  *  bearer      [IN]        
  1270.  * RETURNS
  1271.  *  void
  1272.  *****************************************************************************/
  1273. void mmi_msg_set_bearer_service_req(U8 bearer)
  1274. {
  1275.     /*----------------------------------------------------------------*/
  1276.     /* Local Variables                                                */
  1277.     /*----------------------------------------------------------------*/
  1278.     /*----------------------------------------------------------------*/
  1279.     /* Code Body                                                      */
  1280.     /*----------------------------------------------------------------*/
  1281.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1282.     mmi_frm_sms_set_preferred_bearer(mmi_msg_set_bearer_service_rsp, MOD_MMI, bearer);
  1283. }
  1284. #endif /* __MMI_GPRS_FEATURES__ */ 
  1285. #ifdef __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__
  1286. /*****************************************************************************
  1287.  * FUNCTION
  1288.  *  mmi_msg_get_preferred_storage_rsp
  1289.  * DESCRIPTION
  1290.  *  
  1291.  * PARAMETERS
  1292.  *  storage     [?]         
  1293.  *  mod         [IN]        
  1294.  *  result      [IN]        
  1295.  * RETURNS
  1296.  *  void
  1297.  *****************************************************************************/
  1298. void mmi_msg_get_preferred_storage_rsp(void *storage, module_type mod, U16 result)
  1299. {
  1300.     /*----------------------------------------------------------------*/
  1301.     /* Local Variables                                                */
  1302.     /*----------------------------------------------------------------*/
  1303.     /*----------------------------------------------------------------*/
  1304.     /* Code Body                                                      */
  1305.     /*----------------------------------------------------------------*/
  1306.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  1307.     if (mmi_msg_check_interrupt() == TRUE)
  1308.     {
  1309.         return;
  1310.     }
  1311. #ifndef MMI_ON_HARDWARE_P
  1312. #ifdef __MMI_GPRS_FEATURES__
  1313.     mmi_msg_get_bearer_service_req();
  1314. #else 
  1315.     mmi_msg_entry_msg_settings();
  1316. #endif 
  1317. #else /* MMI_ON_HARDWARE_P */ 
  1318.     if (result == MMI_FRM_SMS_OK)
  1319.     {
  1320.         memStatus.prefStorage = *(U8*) storage;
  1321.     #ifdef __MMI_GPRS_FEATURES__
  1322.         mmi_msg_get_bearer_service_req();
  1323.     #else 
  1324.         mmi_msg_entry_msg_settings();
  1325.     #endif 
  1326.     }
  1327.     else
  1328.     {
  1329.         DisplayPopup(
  1330.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  1331.             IMG_GLOBAL_UNFINISHED,
  1332.             1,
  1333.             MESSAGES_POPUP_TIME_OUT,
  1334.             (U8) WARNING_TONE);
  1335.     }
  1336. #endif /* MMI_ON_HARDWARE_P */ 
  1337. }
  1338. /*****************************************************************************
  1339.  * FUNCTION
  1340.  *  mmi_msg_get_preferred_storage_req
  1341.  * DESCRIPTION
  1342.  *  
  1343.  * PARAMETERS
  1344.  *  void
  1345.  * RETURNS
  1346.  *  void
  1347.  *****************************************************************************/
  1348. void mmi_msg_get_preferred_storage_req(void)
  1349. {
  1350.     /*----------------------------------------------------------------*/
  1351.     /* Local Variables                                                */
  1352.     /*----------------------------------------------------------------*/
  1353.     /*----------------------------------------------------------------*/
  1354.     /* Code Body                                                      */
  1355.     /*----------------------------------------------------------------*/
  1356.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1357.     mmi_frm_sms_get_preferred_storage(mmi_msg_get_preferred_storage_rsp, MOD_MMI);
  1358. }
  1359. /*****************************************************************************
  1360.  * FUNCTION
  1361.  *  mmi_msg_set_preferred_storage_rsp
  1362.  * DESCRIPTION
  1363.  *  
  1364.  * PARAMETERS
  1365.  *  storage     [?]         
  1366.  *  mod         [IN]        
  1367.  *  result      [IN]        
  1368.  * RETURNS
  1369.  *  void
  1370.  *****************************************************************************/
  1371. void mmi_msg_set_preferred_storage_rsp(void *storage, module_type mod, U16 result)
  1372. {
  1373. #ifndef MMI_ON_HARDWARE_P
  1374.     /*----------------------------------------------------------------*/
  1375.     /* Local Variables                                                */
  1376.     /*----------------------------------------------------------------*/
  1377.     /*----------------------------------------------------------------*/
  1378.     /* Code Body                                                      */
  1379.     /*----------------------------------------------------------------*/
  1380.     memStatus.prefStorage = g_msg_cntx.currHiliteIndex;
  1381.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, MESSAGES_POPUP_TIME_OUT, (U8) SUCCESS_TONE);
  1382.     DeleteMessagesHistoryNodes();
  1383. #else /* MMI_ON_HARDWARE_P */ 
  1384.     if (result == MMI_FRM_SMS_OK)
  1385.     {
  1386.         memStatus.prefStorage = *(U8*) storage;
  1387.         DisplayPopup(
  1388.             (PU8) GetString(STR_GLOBAL_DONE),
  1389.             IMG_GLOBAL_ACTIVATED,
  1390.             1,
  1391.             MESSAGES_POPUP_TIME_OUT,
  1392.             (U8) SUCCESS_TONE);
  1393.         DeleteMessagesHistoryNodes();
  1394.     }
  1395.     else
  1396.     {
  1397.         DisplayPopup(
  1398.             (PU8) GetString(STR_MESSAGES_UNKNOWN_ERROR),
  1399.             IMG_GLOBAL_UNFINISHED,
  1400.             1,
  1401.             MESSAGES_POPUP_TIME_OUT,
  1402.             (U8) ERROR_TONE);
  1403.         DeleteMessagesHistoryNodes();
  1404.     }
  1405. #endif /* MMI_ON_HARDWARE_P */ 
  1406. }
  1407. /*****************************************************************************
  1408.  * FUNCTION
  1409.  *  mmi_msg_set_preferred_storage_req
  1410.  * DESCRIPTION
  1411.  *  
  1412.  * PARAMETERS
  1413.  *  storage     [IN]        
  1414.  * RETURNS
  1415.  *  void
  1416.  *****************************************************************************/
  1417. void mmi_msg_set_preferred_storage_req(U8 storage)
  1418. {
  1419.     /*----------------------------------------------------------------*/
  1420.     /* Local Variables                                                */
  1421.     /*----------------------------------------------------------------*/
  1422.     /*----------------------------------------------------------------*/
  1423.     /* Code Body                                                      */
  1424.     /*----------------------------------------------------------------*/
  1425.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1426.     mmi_frm_sms_set_preferred_storage(mmi_msg_set_preferred_storage_rsp, MOD_MMI, storage);
  1427. }
  1428. /*****************************************************************************
  1429.  * FUNCTION
  1430.  *  mmi_msg_get_memory_status_rsp
  1431.  * DESCRIPTION
  1432.  *  
  1433.  * PARAMETERS
  1434.  *  data        [?]         
  1435.  *  mod         [IN]        
  1436.  *  result      [IN]        
  1437.  * RETURNS
  1438.  *  void
  1439.  *****************************************************************************/
  1440. void mmi_msg_get_memory_status_rsp(void *data, module_type mod, U16 result)
  1441. {
  1442.     /*----------------------------------------------------------------*/
  1443.     /* Local Variables                                                */
  1444.     /*----------------------------------------------------------------*/
  1445.     /*----------------------------------------------------------------*/
  1446.     /* Code Body                                                      */
  1447.     /*----------------------------------------------------------------*/
  1448.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  1449.     if (mmi_msg_check_interrupt() == TRUE)
  1450.     {
  1451.         return;
  1452.     }
  1453. #ifndef MMI_ON_HARDWARE_P
  1454.     mmi_msg_entry_memory_status();
  1455. #else /* MMI_ON_HARDWARE_P */ 
  1456.     if (result == MMI_FRM_SMS_OK)
  1457.     {
  1458.         msg_mem_status_struct *memorystatus = (msg_mem_status_struct*) data;
  1459.         memStatus.simTotal = memorystatus->simTotal;
  1460.         memStatus.meTotal = memorystatus->meTotal;
  1461.         memStatus.simUsed = memorystatus->simUsed;
  1462.         memStatus.meUsed = memorystatus->meUsed;
  1463.         if (IsScreenPresent(SCR_ID_MSG_MEMORY_STATUS))
  1464.         {
  1465.             HistoryReplace(SCR_ID_MSG_MEMORY_STATUS, SCR_ID_MSG_MEMORY_STATUS, mmi_msg_entry_memory_status);
  1466.         }
  1467.         else
  1468.         {
  1469.             mmi_msg_entry_memory_status();
  1470.         }
  1471.     }
  1472.     else
  1473.     {
  1474.         DisplayPopup(
  1475.             (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
  1476.             IMG_GLOBAL_UNFINISHED,
  1477.             1,
  1478.             MESSAGES_POPUP_TIME_OUT,
  1479.             (U8) ERROR_TONE);
  1480.     }
  1481.     AlmEnableExpiryHandler();
  1482. #endif /* MMI_ON_HARDWARE_P */ 
  1483. }
  1484. /*****************************************************************************
  1485.  * FUNCTION
  1486.  *  mmi_msg_get_memory_status_req
  1487.  * DESCRIPTION
  1488.  *  
  1489.  * PARAMETERS
  1490.  *  void
  1491.  * RETURNS
  1492.  *  void
  1493.  *****************************************************************************/
  1494. void mmi_msg_get_memory_status_req(void)
  1495. {
  1496.     /*----------------------------------------------------------------*/
  1497.     /* Local Variables                                                */
  1498.     /*----------------------------------------------------------------*/
  1499.     /*----------------------------------------------------------------*/
  1500.     /* Code Body                                                      */
  1501.     /*----------------------------------------------------------------*/
  1502.     /* Do not  call ClearInputEventHandler(MMI_DEVICE_ALL) if SCR_ID_MSG_MEMORY_STATUS is already in history. Ex. new msg ind pops up when screen is SCR_ID_MSG_MEMORY_STATUS */
  1503.     if (!IsScreenPresent(SCR_ID_MSG_MEMORY_STATUS))
  1504.     {
  1505.         ClearInputEventHandler(MMI_DEVICE_ALL);
  1506.     }
  1507.     mmi_frm_sms_get_memory_status(mmi_msg_get_memory_status_rsp, MOD_MMI);
  1508. }
  1509. /*****************************************************************************
  1510.  * FUNCTION
  1511.  *  mmi_msg_get_preferred_memory_status_rsp
  1512.  * DESCRIPTION
  1513.  *  
  1514.  * PARAMETERS
  1515.  *  data        [?]         
  1516.  *  mod         [IN]        
  1517.  *  result      [IN]        
  1518.  * RETURNS
  1519.  *  void
  1520.  *****************************************************************************/
  1521. void mmi_msg_get_preferred_memory_status_rsp(void *data, module_type mod, U16 result)
  1522. {
  1523.     /*----------------------------------------------------------------*/
  1524.     /* Local Variables                                                */
  1525.     /*----------------------------------------------------------------*/
  1526.     /*----------------------------------------------------------------*/
  1527.     /* Code Body                                                      */
  1528.     /*----------------------------------------------------------------*/
  1529.     /* if incoming call ringing or alarm playing, do not show response result in case interrupt current screen */
  1530.     if (mmi_msg_check_interrupt() == TRUE)
  1531.     {
  1532.         return;
  1533.     }
  1534. #ifndef MMI_ON_HARDWARE_P
  1535.     mmi_msg_entry_preferred_storage();
  1536. #else /* MMI_ON_HARDWARE_P */ 
  1537.     if (result == MMI_FRM_SMS_OK)
  1538.     {
  1539.         msg_mem_status_struct *memorystatus = (msg_mem_status_struct*) data;
  1540.         memStatus.simTotal = memorystatus->simTotal;
  1541.         memStatus.meTotal = memorystatus->meTotal;
  1542.         memStatus.simUsed = memorystatus->simUsed;
  1543.         memStatus.meUsed = memorystatus->meUsed;
  1544.         if (IsScreenPresent(SCR_ID_MSG_PREFERRED_STORAGE))
  1545.         {
  1546.             HistoryReplace(SCR_ID_MSG_PREFERRED_STORAGE, SCR_ID_MSG_PREFERRED_STORAGE, mmi_msg_entry_preferred_storage);
  1547.         }
  1548.         else
  1549.         {
  1550.             mmi_msg_entry_preferred_storage();
  1551.         }
  1552.     }
  1553.     else
  1554.     {
  1555.         DisplayPopup(
  1556.             (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
  1557.             IMG_GLOBAL_UNFINISHED,
  1558.             1,
  1559.             MESSAGES_POPUP_TIME_OUT,
  1560.             (U8) ERROR_TONE);
  1561.     }
  1562.     AlmEnableExpiryHandler();
  1563. #endif /* MMI_ON_HARDWARE_P */ 
  1564. }
  1565. /*****************************************************************************
  1566.  * FUNCTION
  1567.  *  mmi_msg_get_preferred_memory_status_req
  1568.  * DESCRIPTION
  1569.  *  
  1570.  * PARAMETERS
  1571.  *  void
  1572.  * RETURNS
  1573.  *  void
  1574.  *****************************************************************************/
  1575. void mmi_msg_get_preferred_memory_status_req(void)
  1576. {
  1577.     /*----------------------------------------------------------------*/
  1578.     /* Local Variables                                                */
  1579.     /*----------------------------------------------------------------*/
  1580.     /*----------------------------------------------------------------*/
  1581.     /* Code Body                                                      */
  1582.     /*----------------------------------------------------------------*/
  1583.     /* Do not  call ClearInputEventHandler(MMI_DEVICE_ALL) if SCR_ID_MSG_PREFERRED_STORAGE is already in history. Ex. new msg ind pops up when screen is SCR_ID_MSG_PREFERRED_STORAGE */
  1584.     if (!IsScreenPresent(SCR_ID_MSG_PREFERRED_STORAGE))
  1585.     {
  1586.         ClearInputEventHandler(MMI_DEVICE_ALL);
  1587.     }
  1588.     mmi_frm_sms_get_memory_status(mmi_msg_get_preferred_memory_status_rsp, MOD_MMI);
  1589. }
  1590. /*****************************************************************************
  1591.  * FUNCTION
  1592.  *  mmi_msg_save_preferred_storage
  1593.  * DESCRIPTION
  1594.  *  Set preferred storage
  1595.  * PARAMETERS
  1596.  *  void
  1597.  * RETURNS
  1598.  *  void
  1599.  *****************************************************************************/
  1600. void mmi_msg_save_preferred_storage(void)
  1601. {
  1602.     /*----------------------------------------------------------------*/
  1603.     /* Local Variables                                                */
  1604.     /*----------------------------------------------------------------*/
  1605.     /*----------------------------------------------------------------*/
  1606.     /* Code Body                                                      */
  1607.     /*----------------------------------------------------------------*/
  1608.     ClearAllKeyHandler();
  1609.     if (((g_msg_cntx.currHiliteIndex == 0) && (memStatus.prefStorage == 0))
  1610.         || ((g_msg_cntx.currHiliteIndex == 1) && (memStatus.prefStorage == 1)))
  1611.     {
  1612.         DisplayPopup(
  1613.             (PU8) GetString(STR_GLOBAL_DONE),
  1614.             IMG_GLOBAL_ACTIVATED,
  1615.             1,
  1616.             MESSAGES_POPUP_TIME_OUT,
  1617.             (U8) SUCCESS_TONE);
  1618.         DeleteMessagesHistoryNodes();
  1619.     }
  1620.     else if (((g_msg_cntx.currHiliteIndex == 0) && (memStatus.simTotal == 0)) ||
  1621.              ((g_msg_cntx.currHiliteIndex == 1) && (memStatus.meTotal == 0)))
  1622.     {
  1623.         DisplayPopup(
  1624.             (PU8) GetString(STR_SMS_DOES_NOT_SUPPORT),
  1625.             IMG_GLOBAL_WARNING,
  1626.             1,
  1627.             MESSAGES_POPUP_TIME_OUT,
  1628.             (U8) SUCCESS_TONE);
  1629.         DeleteMessagesHistoryNodes();
  1630.     }
  1631.     else
  1632.     {
  1633.         if (g_msg_cntx.currHiliteIndex == 0)
  1634.         {
  1635.             mmi_msg_set_preferred_storage_req(SMSAL_SM_PREFER);
  1636.         }
  1637.         else if (g_msg_cntx.currHiliteIndex == 1)
  1638.         {
  1639.             mmi_msg_set_preferred_storage_req(SMSAL_ME_PREFER);
  1640.         }
  1641.     }
  1642. }
  1643. /*****************************************************************************
  1644.  * FUNCTION
  1645.  *  mmi_msg_refresh_memory_status
  1646.  * DESCRIPTION
  1647.  *  Refresh memory status
  1648.  * PARAMETERS
  1649.  *  void
  1650.  * RETURNS
  1651.  *  void
  1652.  *****************************************************************************/
  1653. void mmi_msg_refresh_memory_status(void)
  1654. {
  1655.     /*----------------------------------------------------------------*/
  1656.     /* Local Variables                                                */
  1657.     /*----------------------------------------------------------------*/
  1658.     /*----------------------------------------------------------------*/
  1659.     /* Code Body                                                      */
  1660.     /*----------------------------------------------------------------*/
  1661.     if (IsScreenPresent(SCR_ID_MSG_MEMORY_STATUS))
  1662.     {
  1663.         mmi_msg_get_memory_status_req();
  1664.     }
  1665.     else if (IsScreenPresent(SCR_ID_MSG_PREFERRED_STORAGE))
  1666.     {
  1667.         mmi_msg_get_preferred_memory_status_req();
  1668.     }
  1669. }
  1670. #endif /* __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__ */ 
  1671. #ifdef __MMI_GPRS_FEATURES__
  1672. /*****************************************************************************
  1673.  * FUNCTION
  1674.  *  mmi_msg_save_bearer_settings
  1675.  * DESCRIPTION
  1676.  *  Set bearer settings
  1677.  * PARAMETERS
  1678.  *  void
  1679.  * RETURNS
  1680.  *  void
  1681.  *****************************************************************************/
  1682. void mmi_msg_save_bearer_settings(void)
  1683. {
  1684.     /*----------------------------------------------------------------*/
  1685.     /* Local Variables                                                */
  1686.     /*----------------------------------------------------------------*/
  1687.     /*----------------------------------------------------------------*/
  1688.     /* Code Body                                                      */
  1689.     /*----------------------------------------------------------------*/
  1690.     ClearAllKeyHandler();
  1691.     if (g_msg_cntx.currHiliteIndex == preferBearer)
  1692.     {
  1693.         DisplayPopup(
  1694.             (PU8) GetString(STR_GLOBAL_DONE),
  1695.             IMG_GLOBAL_ACTIVATED,
  1696.             1,
  1697.             MESSAGES_POPUP_TIME_OUT,
  1698.             (U8) SUCCESS_TONE);
  1699.         DeleteMessagesHistoryNodes();
  1700.     }
  1701.     else
  1702.     {
  1703.         mmi_msg_set_bearer_service_req((U8) g_msg_cntx.currHiliteIndex);
  1704.     }
  1705. }
  1706. #endif /* __MMI_GPRS_FEATURES__ */ 
  1707. /*****************************************************************************
  1708.  * FUNCTION
  1709.  *  mmi_msg_set_profile_inline_item
  1710.  * DESCRIPTION
  1711.  *  Set profile items for edit
  1712.  * PARAMETERS
  1713.  *  void
  1714.  * RETURNS
  1715.  *  void
  1716.  *****************************************************************************/
  1717. void mmi_msg_set_profile_inline_item(void)
  1718. {
  1719.     /*----------------------------------------------------------------*/
  1720.     /* Local Variables                                                */
  1721.     /*----------------------------------------------------------------*/
  1722.     U8 numOfMenuItems = 2;
  1723.     U8 numOfMsgTypes = 2;
  1724.     /*----------------------------------------------------------------*/
  1725.     /* Code Body                                                      */
  1726.     /*----------------------------------------------------------------*/
  1727.     vpItems[0] = (PU8) GetString(STR_1HOUR_MENUENTRY);
  1728.     vpItems[1] = (PU8) GetString(STR_6HOUR_MENUENTRY);
  1729.     vpItems[2] = (PU8) GetString(STR_12HOUR_MENUENTRY);
  1730.     vpItems[3] = (PU8) GetString(STR_24HOUR_MENUENTRY);
  1731.     vpItems[4] = (PU8) GetString(STR_3DAY_MENUENTRY);
  1732.     vpItems[5] = (PU8) GetString(STR_1WEEK_MENUENTRY);
  1733.     vpItems[6] = (PU8) GetString(STR_63WEEKS_MENUENTRY);
  1734.     /* message type */
  1735.     msgTypeItems[0] = (PU8) GetString(STR_TEXT_MENUENTRY);
  1736.     msgTypeItems[1] = (PU8) GetString(STR_FAX_MENUENTRY);
  1737.     if (!IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_SM_MO_PAGING))
  1738.     {
  1739.         msgTypeItems[numOfMsgTypes] = (PU8) GetString(STR_PAGE_MENUENTRY);
  1740.         numOfMsgTypes++;
  1741.     }
  1742.     if (!IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_SM_MO_EMAIL))
  1743.     {
  1744.         msgTypeItems[numOfMsgTypes] = (PU8) GetString(STR_MT_EMAIL_MENUENTRY);
  1745.         numOfMsgTypes++;
  1746.     }
  1747.     /* say activate these items */
  1748.     SetInlineItemActivation(&wgui_inline_items[0], KEY_LSK, KEY_EVENT_UP);
  1749.     /* profile name */
  1750.     SetInlineItemFullScreenEdit(
  1751.         &wgui_inline_items[0],
  1752.         STR_PROFILE_NAME,
  1753.         IMG_SMS_ENTRY_SCRN_CAPTION,
  1754.         (PU8) psProfileEditInfo.profileName,
  1755.         /* MAX_PROFILE_NAME_LEN */ psProfileNameList.profileNameLength + 1,
  1756.         INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ONE_LESS_CHARACTER | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_GSM_EXTENDED_HANDLING);
  1757.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[0], mmi_msg_inline_generic_custom_function);
  1758.     /* service center */
  1759.     SetInlineItemActivation(&wgui_inline_items[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1760.     SetInlineItemTextEdit(
  1761.         &wgui_inline_items[1],
  1762.         (PU8) psProfileEditInfo.scAddress,
  1763.         MAX_DIGITS_SMS,
  1764.         INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  1765.     DisableInlineItemHighlight(&wgui_inline_items[1]);
  1766.     /* validity period */
  1767.     if (!IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Validity_Period))
  1768.     {
  1769.         SetInlineItemActivation(&wgui_inline_items[numOfMenuItems], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1770.         SetInlineItemSelect(&wgui_inline_items[numOfMenuItems], MAX_LFOUR_VP, vpItems, &psProfileEditInfo.vpIndex);
  1771.         numOfMenuItems++;
  1772.     }
  1773.     /* message type */
  1774.     if (!IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Protocol_ID))
  1775.     {
  1776.         SetInlineItemActivation(&wgui_inline_items[numOfMenuItems], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1777.         SetInlineItemSelect(
  1778.             &wgui_inline_items[numOfMenuItems],
  1779.             numOfMsgTypes,
  1780.             msgTypeItems,
  1781.             &psProfileEditInfo.msgTypeIndex);
  1782.         numOfMenuItems++;
  1783.     }
  1784. }
  1785. /*****************************************************************************
  1786.  * FUNCTION
  1787.  *  mmi_msg_entry_msg_settings
  1788.  * DESCRIPTION
  1789.  *  Entry message settings menu
  1790.  * PARAMETERS
  1791.  *  void
  1792.  * RETURNS
  1793.  *  void
  1794.  *****************************************************************************/
  1795. void mmi_msg_entry_msg_settings(void)
  1796. {
  1797.     /*----------------------------------------------------------------*/
  1798.     /* Local Variables                                                */
  1799.     /*----------------------------------------------------------------*/
  1800.     U8 *guiBuffer = NULL;
  1801.     U16 numItems = 0;
  1802.     U16 nStrItemList[MAX_SUB_MENUS];
  1803.     U8 *popUpList[MAX_SUB_MENUS];
  1804.     /*----------------------------------------------------------------*/
  1805.     /* Code Body                                                      */
  1806.     /*----------------------------------------------------------------*/
  1807.     /* S32 maskingByte=-1; */
  1808.     EntryNewScreen(SCR_ID_MSG_SETTINGS, mmi_msg_exit_generic, mmi_msg_entry_msg_settings, NULL);
  1809.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsSettingsGuiInterface.c] EntryScrMessageSetup -------*n"));
  1810.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_SETTINGS);
  1811.     /* diamond, 2005/07/01 add _Ext to menu item functions */
  1812.     numItems = GetNumOfChild_Ext(MESSAGES_MENU_MSG_SETTINGS_MENUID);
  1813.     GetSequenceStringIds_Ext(MESSAGES_MENU_MSG_SETTINGS_MENUID, nStrItemList);
  1814.     SetParentHandler(MESSAGES_MENU_MSG_SETTINGS_MENUID);
  1815.     ConstructHintsList(MESSAGES_MENU_MSG_SETTINGS_MENUID, popUpList);
  1816.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1817.     SetMessagesCurrScrnID(SCR_ID_MSG_SETTINGS);
  1818.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_SETTINGS);
  1819.     mmi_msg_set_msg_menu_highlight_handler();
  1820.     /* diamond, 2005/07/01 removed for new menu item architecture to CPHS */
  1821. #if 0
  1822. /* under construction !*/
  1823. /* under construction !*/
  1824. /* under construction !*/
  1825. /* under construction !*/
  1826. /* under construction !*/
  1827. /* under construction !*/
  1828. /* under construction !*/
  1829. /* under construction !*/
  1830. /* under construction !*/
  1831. #ifndef __MMI_GPRS_FEATURES__
  1832. /* under construction !*/
  1833. /* under construction !*/
  1834. /* under construction !*/
  1835. /* under construction !*/
  1836. /* under construction !*/
  1837. /* under construction !*/
  1838. #endif
  1839. /* under construction !*/
  1840. /* under construction !*/
  1841. /* under construction !*/
  1842. /* under construction !*/
  1843. #endif /* 0 */ 
  1844.     ShowCategory52Screen(
  1845.         STR_MESSAGESETUP_MENUENTRY,
  1846.         IMG_SMS_ENTRY_SCRN_CAPTION,
  1847.         STR_GLOBAL_OK,
  1848.         IMG_GLOBAL_OK,
  1849.         STR_GLOBAL_BACK,
  1850.         IMG_GLOBAL_BACK,
  1851.         numItems,
  1852.         nStrItemList,
  1853.         (U16*) gIndexIconsImageList,
  1854.         (U8 **) popUpList,
  1855.         0,
  1856.         0,
  1857.         guiBuffer);
  1858.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1859. }
  1860. /*****************************************************************************
  1861.  * FUNCTION
  1862.  *  mmi_msg_pre_entry_msg_settings
  1863.  * DESCRIPTION
  1864.  *  Before entering message settings menu, get preferred storage and/or bearer settings
  1865.  * PARAMETERS
  1866.  *  void
  1867.  * RETURNS
  1868.  *  void
  1869.  *****************************************************************************/
  1870. void mmi_msg_pre_entry_msg_settings(void)
  1871. {
  1872. #ifdef MMI_ON_HARDWARE_P
  1873.     /*----------------------------------------------------------------*/
  1874.     /* Local Variables                                                */
  1875.     /*----------------------------------------------------------------*/
  1876.     /*----------------------------------------------------------------*/
  1877.     /* Code Body                                                      */
  1878.     /*----------------------------------------------------------------*/
  1879.     if (mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX)
  1880.     {
  1881.         DisplayPopup(
  1882.             (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
  1883.             IMG_GLOBAL_UNFINISHED,
  1884.             1,
  1885.             MESSAGES_POPUP_TIME_OUT,
  1886.             (U8) ERROR_TONE);
  1887.         return;
  1888.     }
  1889.     /* disallow re-entering SMS application when there is a pending SMS job running in the background */
  1890.     else if (mmi_frm_sms_check_action_pending())
  1891.     {
  1892.         DisplayPopup(
  1893.             (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
  1894.             IMG_GLOBAL_UNFINISHED,
  1895.             1,
  1896.             MESSAGES_POPUP_TIME_OUT,
  1897.             (U8) ERROR_TONE);
  1898.         return;
  1899.     }
  1900. #ifdef __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__
  1901.     mmi_msg_get_preferred_storage_req();
  1902. #elif defined(__MMI_GPRS_FEATURES__)
  1903.     mmi_msg_get_bearer_service_req();
  1904. #else 
  1905.     mmi_msg_entry_msg_settings();
  1906. #endif 
  1907. #else /* MMI_ON_HARDWARE_P */ 
  1908.     mmi_msg_entry_msg_settings();
  1909. #endif /* MMI_ON_HARDWARE_P */ 
  1910. }
  1911. /*****************************************************************************
  1912.  * FUNCTION
  1913.  *  mmi_msg_profile_edit_highlight_handler
  1914.  * DESCRIPTION
  1915.  *  Entry profile edit screen
  1916.  * PARAMETERS
  1917.  *  index       [IN]        
  1918.  * RETURNS
  1919.  *  void
  1920.  *****************************************************************************/
  1921. void mmi_msg_profile_edit_highlight_handler(S32 index)
  1922. {
  1923.     /*----------------------------------------------------------------*/
  1924.     /* Local Variables                                                */
  1925.     /*----------------------------------------------------------------*/
  1926.     /*----------------------------------------------------------------*/
  1927.     /* Code Body                                                      */
  1928.     /*----------------------------------------------------------------*/
  1929.     ChangeTitleString((PU8) GetString(profileEditStrings[index]));
  1930.     draw_title();
  1931. }
  1932. /*****************************************************************************
  1933.  * FUNCTION
  1934.  *  mmi_msg_entry_profile_edit
  1935.  * DESCRIPTION
  1936.  *  
  1937.  * PARAMETERS
  1938.  *  void
  1939.  * RETURNS
  1940.  *  void
  1941.  *****************************************************************************/
  1942. void mmi_msg_entry_profile_edit(void)
  1943. {
  1944.     /*----------------------------------------------------------------*/
  1945.     /* Local Variables                                                */
  1946.     /*----------------------------------------------------------------*/
  1947.     U8 *guiBuffer = NULL;
  1948.     U8 *inputBuffer = NULL;
  1949.     U16 inputBufferSize = 0;
  1950.     U8 numOfItems = MAX_PROFILE_EDIT_ITEMS;
  1951.     /*----------------------------------------------------------------*/
  1952.     /* Code Body                                                      */
  1953.     /*----------------------------------------------------------------*/
  1954.     EntryNewScreen(SCR_ID_MSG_PROFILE_EDIT, mmi_msg_exit_profile_edit, NULL, NULL);
  1955.     InitializeCategory57Screen();
  1956.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_PROFILE_EDIT);
  1957.     inputBuffer = GetCurrNInputBuffer(SCR_ID_MSG_PROFILE_EDIT, &inputBufferSize);
  1958.     RegisterHighlightHandler(mmi_msg_profile_edit_highlight_handler);
  1959.     profileEditStrings[0] = STR_PROFILE_NAME;
  1960.     profileEditStrings[1] = STR_PROFILE_SC;
  1961.     profileEditStrings[2] = STR_PROFILE_VP;
  1962.     profileEditStrings[3] = STR_PROFILE_MSG_TYPE;
  1963.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Validity_Period))
  1964.     {
  1965.         numOfItems--;
  1966.     }
  1967.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Protocol_ID))
  1968.     {
  1969.         numOfItems--;
  1970.     }
  1971.     mmi_msg_set_profile_inline_item();
  1972.     if (guiBuffer != NULL)
  1973.     {
  1974.         SetCategory57Data(wgui_inline_items, numOfItems, inputBuffer);
  1975.     }
  1976.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_PROFILE_EDIT);
  1977.     SetMessagesCurrScrnID(SCR_ID_MSG_PROFILE_EDIT);
  1978.     mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_set_profile_inline_item_req, Messages2GoBackHistory);
  1979.     ShowCategory57Screen(
  1980.         STR_PROFILE_NAME,
  1981.         IMG_SMS_ENTRY_SCRN_CAPTION,
  1982.         STR_GLOBAL_EDIT,
  1983.         IMG_GLOBAL_OK,
  1984.         STR_GLOBAL_BACK,
  1985.         IMG_GLOBAL_BACK,
  1986.         numOfItems,
  1987.         profileEditIcons,
  1988.         wgui_inline_items,
  1989.         0,
  1990.         guiBuffer);
  1991.     SetCategory57RightSoftkeyFunctions(mmi_msg_entry_confirm_generic, GoBackHistory);
  1992. }
  1993. /*****************************************************************************
  1994.  * FUNCTION
  1995.  *  mmi_msg_exit_profile_edit
  1996.  * DESCRIPTION
  1997.  *  Exit profile edit screen
  1998.  * PARAMETERS
  1999.  *  void
  2000.  * RETURNS
  2001.  *  void
  2002.  *****************************************************************************/
  2003. void mmi_msg_exit_profile_edit(void)
  2004. {
  2005.     /*----------------------------------------------------------------*/
  2006.     /* Local Variables                                                */
  2007.     /*----------------------------------------------------------------*/
  2008.     history currHistory;
  2009.     U16 inputBufferSize = 0;    /* added for inline edit history */
  2010.     S16 nHistory = 0;
  2011.     /*----------------------------------------------------------------*/
  2012.     /* Code Body                                                      */
  2013.     /*----------------------------------------------------------------*/
  2014.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsSettingsGuiInterface.c] ExitScrProfileSetting -------*n"));
  2015.     if (GetUCS2Flag((PS8) psProfileEditInfo.profileName))
  2016.     {
  2017.         psProfileEditInfo.profileNameDcs = PHB_UCS2;
  2018.     }
  2019.     else
  2020.     {
  2021.         psProfileEditInfo.profileNameDcs = PHB_ASCII;
  2022.     }
  2023.     g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes = SCR_ID_MSG_PROFILE_EDIT;
  2024.     SetMessagesCurrScrnID(0);
  2025.     currHistory.scrnID = SCR_ID_MSG_PROFILE_EDIT;
  2026.     CloseCategory57Screen();
  2027.     currHistory.entryFuncPtr = mmi_msg_entry_profile_edit;
  2028.     pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
  2029.     GetCategory57History(currHistory.guiBuffer);
  2030.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  2031.     GetCategory57Data((U8*) currHistory.inputBuffer);   /* added for inline edit history */
  2032.     AddNHistory(currHistory, inputBufferSize);          /* added for inline edit history */
  2033. }
  2034. /*****************************************************************************
  2035.  * FUNCTION
  2036.  *  mmi_msg_entry_profile_settings
  2037.  * DESCRIPTION
  2038.  *  Entry profile settings screen
  2039.  * PARAMETERS
  2040.  *  void
  2041.  * RETURNS
  2042.  *  void
  2043.  *****************************************************************************/
  2044. void mmi_msg_entry_profile_settings(void)
  2045. {
  2046.     /*----------------------------------------------------------------*/
  2047.     /* Local Variables                                                */
  2048.     /*----------------------------------------------------------------*/
  2049.     PU8 guiBuffer = NULL;
  2050.     S32 hiliteitem;
  2051.     S8 index = 0;
  2052.     /*----------------------------------------------------------------*/
  2053.     /* Code Body                                                      */
  2054.     /*----------------------------------------------------------------*/
  2055.     EntryNewScreen(SCR_ID_MSG_PROFILE_LIST, mmi_msg_exit_generic, mmi_msg_entry_profile_settings, NULL);
  2056.     for (index = 0; (index < psProfileNameList.currMaxPsProfiles) && (index < MAX_LFOUR_PROFILES); index++)
  2057.     {
  2058.         if ((psProfileNameList.profileName[index][0] == '') && (psProfileNameList.profileName[index][1] == ''))
  2059.         {
  2060.             subMenuDataPtrs[index] = (PU8) GetString((U16) defaultProfileNames[index]);
  2061.         }
  2062.         else
  2063.         {
  2064.             subMenuDataPtrs[index] = (PU8) psProfileNameList.profileName[index];
  2065.         }
  2066.     }
  2067.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_PROFILE_LIST);
  2068.     if (guiBuffer != NULL)
  2069.     {
  2070.         hiliteitem = g_msg_cntx.currHiliteIndex;
  2071.     }
  2072.     else
  2073.     {
  2074.         hiliteitem = psProfileNameList.currReqProfileNo;
  2075.     }
  2076.     RegisterHighlightHandler(mmi_msg_get_profile_highlight_index);
  2077.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_PROFILE_LIST);
  2078.     SetMessagesCurrScrnID(SCR_ID_MSG_PROFILE_LIST);
  2079.     ShowCategory36Screen(
  2080.         STR_PROFILE_SETTING_MENUENTRY,
  2081.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2082.         STR_GLOBAL_EDIT,
  2083.         IMG_SMS_COMMON_NOIMAGE,
  2084.         STR_GLOBAL_BACK,
  2085.         IMG_GLOBAL_BACK,
  2086.         index,
  2087.         subMenuDataPtrs,
  2088.         (U16) hiliteitem,
  2089.         guiBuffer);
  2090.     SetLeftSoftkeyFunction(mmi_msg_get_profile_inline_item_req, KEY_EVENT_UP);
  2091.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2092. }
  2093. /*****************************************************************************
  2094.  * FUNCTION
  2095.  *  mmi_msg_entry_common_settings
  2096.  * DESCRIPTION
  2097.  *  Entry common settings screen
  2098.  * PARAMETERS
  2099.  *  void
  2100.  * RETURNS
  2101.  *  void
  2102.  *****************************************************************************/
  2103. void mmi_msg_entry_common_settings(void)
  2104. {
  2105.     /*----------------------------------------------------------------*/
  2106.     /* Local Variables                                                */
  2107.     /*----------------------------------------------------------------*/
  2108.     U8 *guiBuffer;
  2109.     U16 numItems = 2;
  2110.     S32 maskingByte = -1;
  2111.     /*----------------------------------------------------------------*/
  2112.     /* Code Body                                                      */
  2113.     /*----------------------------------------------------------------*/
  2114.     EntryNewScreen(SCR_ID_MSG_COMMON_SETTINGS, mmi_msg_exit_generic, mmi_msg_entry_common_settings, NULL);
  2115.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsSettingsGuiInterface.c] EntryScrCommonSettings -------*n"));
  2116.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_COMMON_SETTINGS);
  2117.     subMenuDataPtrs[0] = (PU8) GetString((U16) STR_DELIVERY_REPORT_MENUENTRY);
  2118.     subMenuDataPtrs[1] = (PU8) GetString((U16) STR_REPLY_PATH_MENUENTRY);
  2119.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_COMMON_SETTINGS);
  2120.     SetMessagesCurrScrnID(SCR_ID_MSG_COMMON_SETTINGS);
  2121.     mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_set_common_settings_req, Messages2GoBackHistory);
  2122.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Del_Conf))
  2123.     {
  2124.         ResetBit(maskingByte, 0);
  2125.     }
  2126.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Reply_path))
  2127.     {
  2128.         ResetBit(maskingByte, 1);
  2129.     }
  2130.     MaskStringItems(subMenuDataPtrs, (U8) numItems, maskingByte);
  2131.     numItems = MaskItemsU8(DeliveryRepyStates, (U8) numItems, maskingByte);
  2132.     SetCheckboxToggleRightSoftkeyFunctions(mmi_msg_entry_confirm_generic, GoBackHistory);
  2133.     ShowCategory140Screen(
  2134.         STR_COMMONSETTING_MENUENTRY,
  2135.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2136.         numItems,
  2137.         (U8 **) subMenuDataPtrs,
  2138.         (U8*) DeliveryRepyStates,
  2139.         0,
  2140.         guiBuffer);
  2141.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2142.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2143. }
  2144. #ifdef __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__
  2145. /*****************************************************************************
  2146.  * FUNCTION
  2147.  *  mmi_msg_entry_memory_status
  2148.  * DESCRIPTION
  2149.  *  Entry memory status screen
  2150.  * PARAMETERS
  2151.  *  void
  2152.  * RETURNS
  2153.  *  void
  2154.  *****************************************************************************/
  2155. void mmi_msg_entry_memory_status(void)
  2156. {
  2157.     /*----------------------------------------------------------------*/
  2158.     /* Local Variables                                                */
  2159.     /*----------------------------------------------------------------*/
  2160.     U8 *guiBuffer;
  2161.     char tempBuf[MAX_SUBMENU_CHARACTERS];
  2162.     char tempBufUnicode[MAX_SUBMENU_CHARACTERS * ENCODING_LENGTH];
  2163.     char spaceBuf[5];
  2164.     S8 memoryStatus[MAX_SUBMENU_CHARACTERS * ENCODING_LENGTH];
  2165.     /*----------------------------------------------------------------*/
  2166.     /* Code Body                                                      */
  2167.     /*----------------------------------------------------------------*/
  2168.     EntryNewScreen(SCR_ID_MSG_MEMORY_STATUS, mmi_msg_exit_generic, mmi_msg_entry_memory_status, NULL);
  2169.     memset(memoryStatus, 0, 100);
  2170.     memset(spaceBuf, 0, 5);
  2171.     AnsiiToUnicodeString(spaceBuf, "n");
  2172.     pfnUnicodeStrcpy(memoryStatus, GetString(STR_SMSSTATUS_TITLE));
  2173.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  2174.     pfnUnicodeStrcat(memoryStatus, GetString(STR_SMS_MEMSTATUS_PREFIX_SIM));
  2175.     memset(tempBuf, 0, MAX_SUBMENU_CHARACTERS);
  2176.     if (memStatus.simTotal > 0)
  2177.     {
  2178.         sprintf (tempBuf, "%d/%d", memStatus.simUsed, memStatus.simTotal);     //Old:sprintf(tempBuf, "%d%%", ((memStatus.simUsed) * 100) / (memStatus.simTotal));     //KP Jerry modify on 2007-3-6
  2179.         AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  2180.         pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  2181.     }
  2182.     else
  2183.     {
  2184.         pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_SMS_DOES_NOT_SUPPORT));
  2185.     }
  2186.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  2187.     pfnUnicodeStrncat(memoryStatus, GetString(STR_SMS_MEMSTATUS_PREFIX_PHONE), 16);
  2188.     memset(tempBuf, 0, MAX_SUBMENU_CHARACTERS);
  2189.     if (memStatus.meTotal > 0)
  2190.     {
  2191.         sprintf (tempBuf, "%d/%d", memStatus.meUsed, memStatus.meTotal);     //Old:sprintf(tempBuf, "%d%%", ((memStatus.meUsed) * 100) / (memStatus.meTotal));     //KP Jerry modify on 2007-3-6
  2192.         AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  2193.         pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  2194.     }
  2195.     else
  2196.     {
  2197.         pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_SMS_DOES_NOT_SUPPORT));
  2198.     }
  2199.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_MEMORY_STATUS);
  2200.     if ((guiBuffer != NULL) || (g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes == SCR_ID_MSG_MEMORY_STATUS))
  2201.     {
  2202.         DeleteNScrId(SCR_ID_MSG_MEMORY_STATUS);
  2203.     }
  2204.     SetMessagesCurrScrnID(SCR_ID_MSG_MEMORY_STATUS);
  2205.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_MEMORY_STATUS);
  2206.     ShowCategory7Screen(
  2207.         STR_SMSSTATUS_MENUENTRY,
  2208.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2209.         0,
  2210.         0,
  2211.         STR_GLOBAL_BACK,
  2212.         IMG_GLOBAL_BACK,
  2213.         (PU8) memoryStatus,
  2214.         guiBuffer);
  2215.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2216.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2217. }
  2218. /*****************************************************************************
  2219.  * FUNCTION
  2220.  *  mmi_msg_entry_preferred_storage
  2221.  * DESCRIPTION
  2222.  *  Entry preferred storage screen
  2223.  * PARAMETERS
  2224.  *  void
  2225.  * RETURNS
  2226.  *  void
  2227.  *****************************************************************************/
  2228. void mmi_msg_entry_preferred_storage(void)
  2229. {
  2230.     /*----------------------------------------------------------------*/
  2231.     /* Local Variables                                                */
  2232.     /*----------------------------------------------------------------*/
  2233.     U8 *guiBuffer;
  2234.     U16 nNumofItem = 2;
  2235.     S32 hiliteitem;
  2236.     char tempBuf[MAX_SUBMENU_CHARACTERS];
  2237.     /*----------------------------------------------------------------*/
  2238.     /* Code Body                                                      */
  2239.     /*----------------------------------------------------------------*/
  2240.     EntryNewScreen(SCR_ID_MSG_PREFERRED_STORAGE, mmi_msg_exit_generic, mmi_msg_entry_preferred_storage, NULL);
  2241.     memset(hintData[0], 0, MAX_SUB_MENU_HINT_SIZE);
  2242.     memset(hintData[1], 0, MAX_SUB_MENU_HINT_SIZE);
  2243.     if (memStatus.simTotal > 0)
  2244.     {
  2245.         sprintf (tempBuf, "%d/%d", memStatus.simUsed, memStatus.simTotal);     //Old:sprintf(tempBuf, "%d%%", ((memStatus.simUsed) * 100) / (memStatus.simTotal));     //KP Jerry modify on 2007-3-6
  2246.         AnsiiToUnicodeString((S8*) hintData[0], tempBuf);
  2247.     }
  2248.     else
  2249.     {
  2250.         pfnUnicodeStrcpy((S8*) hintData[0], (S8*) GetString(STR_SMS_DOES_NOT_SUPPORT));
  2251.     }
  2252.     if (memStatus.meTotal > 0)
  2253.     {
  2254.         sprintf (tempBuf, "%d/%d", memStatus.meUsed, memStatus.meTotal);     //Old:sprintf(tempBuf, "%d%%", ((memStatus.meUsed) * 100) / (memStatus.meTotal));     //KP Jerry modify on 2007-3-6
  2255.         AnsiiToUnicodeString((S8*) hintData[1], tempBuf);
  2256.     }
  2257.     else
  2258.     {
  2259.         pfnUnicodeStrcpy((S8*) hintData[1], (S8*) GetString(STR_SMS_DOES_NOT_SUPPORT));
  2260.     }
  2261.     hintDataPtrs[0] = hintData[0];
  2262.     hintDataPtrs[1] = hintData[1];
  2263.     subMenuDataPtrs[0] = (PU8) GetString(STR_SIM_STORAGE_MENUENTRY);
  2264.     subMenuDataPtrs[1] = (PU8) GetString(STR_ME_STORAGE_MENUENTRY);
  2265.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_PREFERRED_STORAGE);
  2266.     if ((guiBuffer != NULL) || (g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes == SCR_ID_MSG_PREFERRED_STORAGE))
  2267.     {
  2268.         DeleteNScrId(SCR_ID_MSG_PREFERRED_STORAGE);
  2269.         hiliteitem = g_msg_cntx.currHiliteIndex;
  2270.     }
  2271.     else
  2272.     {
  2273.         if (memStatus.prefStorage == 0)
  2274.         {
  2275.             hiliteitem = 0;
  2276.         }
  2277.         else
  2278.         {
  2279.             hiliteitem = 1;
  2280.         }
  2281.     }
  2282.     RegisterHighlightHandler(GetHiliteIndex);
  2283.     SetMessagesCurrScrnID(SCR_ID_MSG_PREFERRED_STORAGE);
  2284.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_PREFERRED_STORAGE);
  2285.     ShowCategory109Screen(
  2286.         STR_PREFEREDSTORAGE_MENUENTRY,
  2287.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2288.         STR_GLOBAL_OK,
  2289.         IMG_GLOBAL_OK,
  2290.         STR_GLOBAL_BACK,
  2291.         IMG_GLOBAL_BACK,
  2292.         nNumofItem,
  2293.         subMenuDataPtrs,
  2294.         hintDataPtrs,
  2295.         hiliteitem,
  2296.         guiBuffer);
  2297.     SetLeftSoftkeyFunction(mmi_msg_save_preferred_storage, KEY_EVENT_UP);
  2298.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2299.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2300. }
  2301. #endif /* __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__ */ 
  2302. #ifdef __MMI_GPRS_FEATURES__
  2303. /*****************************************************************************
  2304.  * FUNCTION
  2305.  *  mmi_msg_entry_bearer_settings
  2306.  * DESCRIPTION
  2307.  *  Entry bearer settings screen
  2308.  * PARAMETERS
  2309.  *  void
  2310.  * RETURNS
  2311.  *  void
  2312.  *****************************************************************************/
  2313. void mmi_msg_entry_bearer_settings(void)
  2314. {
  2315.     /*----------------------------------------------------------------*/
  2316.     /* Local Variables                                                */
  2317.     /*----------------------------------------------------------------*/
  2318.     U8 *guiBuffer;
  2319.     U16 nStrItemList[MAX_SUB_MENUS];
  2320.     U16 nNumofItem;
  2321.     S32 hiliteitem;
  2322.     /*----------------------------------------------------------------*/
  2323.     /* Code Body                                                      */
  2324.     /*----------------------------------------------------------------*/
  2325.     EntryNewScreen(SCR_ID_MSG_BEARER_SETTINGS, mmi_msg_exit_generic, mmi_msg_entry_bearer_settings, NULL);
  2326.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_BEARER_SETTINGS);
  2327.     nNumofItem = GetNumOfChild(SETUP_MENU_PREFEREDBEARER_MENUID);
  2328.     GetSequenceStringIds(SETUP_MENU_PREFEREDBEARER_MENUID, nStrItemList);
  2329.     SetParentHandler(SETUP_MENU_PREFEREDBEARER_MENUID);
  2330.     if (guiBuffer != NULL)
  2331.     {
  2332.         hiliteitem = g_msg_cntx.currHiliteIndex;
  2333.     }
  2334.     else
  2335.     {
  2336.         hiliteitem = (S32) preferBearer;
  2337.     }
  2338.     RegisterHighlightHandler(GetHiliteIndex);
  2339.     SetMessagesCurrScrnID(SCR_ID_MSG_BEARER_SETTINGS);
  2340.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_BEARER_SETTINGS);
  2341.     ShowCategory11Screen(
  2342.         STR_PREFEREDBEARER_MENUENTRY,
  2343.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2344.         STR_GLOBAL_OK,
  2345.         IMG_GLOBAL_OK,
  2346.         STR_GLOBAL_BACK,
  2347.         IMG_GLOBAL_BACK,
  2348.         nNumofItem,
  2349.         nStrItemList,
  2350.         (U16) hiliteitem,
  2351.         guiBuffer);
  2352.     SetLeftSoftkeyFunction(mmi_msg_save_bearer_settings, KEY_EVENT_UP);
  2353.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2354.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2355. }
  2356. #endif /* __MMI_GPRS_FEATURES__ */ 
  2357. /*****************************************************************************
  2358.  * FUNCTION
  2359.  *  mmi_msg_go_back_from_voice_mail_server
  2360.  * DESCRIPTION
  2361.  *  Free voice mail data before go back screen
  2362.  * PARAMETERS
  2363.  *  void
  2364.  * RETURNS
  2365.  *  void
  2366.  *****************************************************************************/
  2367. void mmi_msg_go_back_from_voice_mail_server(void)
  2368. {
  2369.     /*----------------------------------------------------------------*/
  2370.     /* Local Variables                                                */
  2371.     /*----------------------------------------------------------------*/
  2372.     /*----------------------------------------------------------------*/
  2373.     /* Code Body                                                      */
  2374.     /*----------------------------------------------------------------*/
  2375.     FreeVoiceMailData();
  2376.     GoBackHistory();
  2377. }
  2378. /*****************************************************************************
  2379.  * FUNCTION
  2380.  *  mmi_msg_end_key_from_voice_mail_server
  2381.  * DESCRIPTION
  2382.  *  Free voice mail data before go to idle
  2383.  * PARAMETERS
  2384.  *  void
  2385.  * RETURNS
  2386.  *  void
  2387.  *****************************************************************************/
  2388. void mmi_msg_end_key_from_voice_mail_server(void)
  2389. {
  2390.     /*----------------------------------------------------------------*/
  2391.     /* Local Variables                                                */
  2392.     /*----------------------------------------------------------------*/
  2393.     /*----------------------------------------------------------------*/
  2394.     /* Code Body                                                      */
  2395.     /*----------------------------------------------------------------*/
  2396.     if (!isInCall())
  2397.     {
  2398.         FreeVoiceMailData();
  2399.     }
  2400.     ExecCurrEndKeyDownHandler();
  2401. }
  2402. /*****************************************************************************
  2403.  * FUNCTION
  2404.  *  mmi_msg_pre_entry_voice_mail_server
  2405.  * DESCRIPTION
  2406.  *  Before entry voice mail server list, get mailbox address
  2407.  * PARAMETERS
  2408.  *  void
  2409.  * RETURNS
  2410.  *  void
  2411.  *****************************************************************************/
  2412. void mmi_msg_pre_entry_voice_mail_server(void)
  2413. {
  2414. #ifdef MMI_ON_HARDWARE_P
  2415.     /*----------------------------------------------------------------*/
  2416.     /* Local Variables                                                */
  2417.     /*----------------------------------------------------------------*/
  2418.     /*----------------------------------------------------------------*/
  2419.     /* Code Body                                                      */
  2420.     /*----------------------------------------------------------------*/
  2421.     FreeVoiceMailData();
  2422.     ClearInputEventHandler(MMI_DEVICE_ALL);
  2423.     if (mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX)
  2424.     {
  2425.         DisplayPopup(
  2426.             (PU8) GetString(STR_VOICE_MAIL_NOT_READY_YET),
  2427.             IMG_GLOBAL_UNFINISHED,
  2428.             1,
  2429.             MESSAGES_POPUP_TIME_OUT,
  2430.             (U8) ERROR_TONE);
  2431.         return;
  2432.     }
  2433.     /* disallow re-entering SMS application when there is a pending SMS job running in the background */
  2434.     else if (mmi_frm_sms_check_action_pending())
  2435.     {
  2436.         DisplayPopup(
  2437.             (PU8) GetString(STR_SMS_MSG_NOT_READY_YET),
  2438.             IMG_GLOBAL_UNFINISHED,
  2439.             1,
  2440.             MESSAGES_POPUP_TIME_OUT,
  2441.             (U8) ERROR_TONE);
  2442.         return;
  2443.     }
  2444. #endif /* MMI_ON_HARDWARE_P */ 
  2445.     mmi_msg_get_mailbox_list_req();
  2446. }
  2447. /*****************************************************************************
  2448.  * FUNCTION
  2449.  *  mmi_msg_entry_voice_mail_server
  2450.  * DESCRIPTION
  2451.  *  Entry voice mail server list screen
  2452.  * PARAMETERS
  2453.  *  void
  2454.  * RETURNS
  2455.  *  void
  2456.  *****************************************************************************/
  2457. void mmi_msg_entry_voice_mail_server(void)
  2458. {
  2459.     /*----------------------------------------------------------------*/
  2460.     /* Local Variables                                                */
  2461.     /*----------------------------------------------------------------*/
  2462.     U8 *guiBuffer = NULL;
  2463.     S32 hiliteitem = 0;
  2464.     /*----------------------------------------------------------------*/
  2465.     /* Code Body                                                      */
  2466.     /*----------------------------------------------------------------*/
  2467.     EntryNewScreen(SCR_ID_MSG_VOICE_MAIL_LIST, mmi_msg_exit_generic, mmi_msg_entry_voice_mail_server, NULL);
  2468.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_VOICE_MAIL_LIST);
  2469.     if (guiBuffer != NULL)
  2470.     {
  2471.         hiliteitem = (g_msg_cntx.currHiliteIndex < mmi_msg_mailbox_num) ? g_msg_cntx.currHiliteIndex : 0;
  2472.     }
  2473.     RegisterHighlightHandler(GetHiliteIndex);
  2474.     SetMessagesCurrScrnID(SCR_ID_MSG_VOICE_MAIL_LIST);
  2475.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_VOICE_MAIL_LIST);
  2476.     GetCurrEndKeyDownHandler();
  2477.     ShowCategory184Screen(
  2478.         STR_VMAIL_MENUENTRY,
  2479.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2480.         STR_GLOBAL_OPTIONS,
  2481.         IMG_GLOBAL_OPTIONS,
  2482.         STR_GLOBAL_BACK,
  2483.         IMG_GLOBAL_BACK,
  2484.         (S32)mmi_msg_mailbox_num,
  2485.         mmi_msg_voice_mail_server_get_item,
  2486.         mmi_msg_voice_mail_server_get_hint,
  2487.         hiliteitem,
  2488.         guiBuffer);
  2489.     SetKeyHandler(mmi_msg_dial_mailbox_address, KEY_SEND, KEY_EVENT_UP);
  2490.     SetLeftSoftkeyFunction(mmi_msg_entry_voice_mail_server_option, KEY_EVENT_UP);
  2491.     SetKeyHandler(mmi_msg_entry_voice_mail_server_option, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2492.     SetRightSoftkeyFunction(mmi_msg_go_back_from_voice_mail_server, KEY_EVENT_UP);
  2493.     SetKeyHandler(mmi_msg_go_back_from_voice_mail_server, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2494.     SetKeyHandler(mmi_msg_end_key_from_voice_mail_server, KEY_END, KEY_EVENT_DOWN);
  2495. }
  2496. /*****************************************************************************
  2497.  * FUNCTION
  2498.  *  mmi_msg_voice_mail_server_get_item
  2499.  * DESCRIPTION
  2500.  *  Display voice mail server item
  2501.  * PARAMETERS
  2502.  *  item_index          [IN]            
  2503.  *  str_buff            [IN]            
  2504.  *  img_buff_p          [?]             
  2505.  *  str_img_mask        [IN]            
  2506.  *  a(?)                [IN]            Current item index
  2507.  *  d(?)                [IN/OUT]        Current item mask
  2508.  *  c(?)                [IN/OUT]        Current item icon
  2509.  *  b(?)                [IN/OUT]        Current item string
  2510.  * RETURNS
  2511.  * TRUE
  2512.  *****************************************************************************/
  2513. pBOOL mmi_msg_voice_mail_server_get_item(S32 item_index, UI_string_type str_buff, PU8 *img_buff_p, U8 str_img_mask)
  2514. {
  2515.     /*----------------------------------------------------------------*/
  2516.     /* Local Variables                                                */
  2517.     /*----------------------------------------------------------------*/
  2518.     /*----------------------------------------------------------------*/
  2519.     /* Code Body                                                      */
  2520.     /*----------------------------------------------------------------*/
  2521.     if ((item_index < 0) || (item_index >= MAX_MAILBOX_PS_SUPPORT))
  2522.     {
  2523.         return FALSE;
  2524.     }
  2525.     if (pfnUnicodeStrlen((S8*) pMailBoxName[item_index]) != 0)
  2526.     {
  2527.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) pMailBoxName[item_index]);
  2528.     }
  2529.     else if (pfnUnicodeStrlen((S8*) pMailBoxNumber[item_index]) != 0)
  2530.     {
  2531.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) pMailBoxNumber[item_index]);
  2532.     }
  2533.     else
  2534.     {
  2535.         pfnUnicodeStrcpy((S8*) str_buff, (S8*) GetString((U16) STR_GLOBAL_EMPTY_LIST));
  2536.     }
  2537.     *img_buff_p = get_image(gIndexIconsImageList[item_index]);
  2538.     return TRUE;
  2539. }
  2540. /*****************************************************************************
  2541.  * FUNCTION
  2542.  *  mmi_msg_voice_mail_server_get_hint
  2543.  * DESCRIPTION
  2544.  *  Display voice mail server hint
  2545.  * PARAMETERS
  2546.  *  item_index      [IN]            
  2547.  *  hint_array      [?]             
  2548.  *  a(?)            [IN]            Current item index
  2549.  *  b(?)            [IN/OUT]        Current item hint
  2550.  * RETURNS
  2551.  *  the description of return value, if any.
  2552.  *****************************************************************************/
  2553. S32 mmi_msg_voice_mail_server_get_hint(S32 item_index, UI_string_type *hint_array)
  2554. {
  2555.     /*----------------------------------------------------------------*/
  2556.     /* Local Variables                                                */
  2557.     /*----------------------------------------------------------------*/
  2558.     /*----------------------------------------------------------------*/
  2559.     /* Code Body                                                      */
  2560.     /*----------------------------------------------------------------*/
  2561.     if ((pfnUnicodeStrlen((S8*) pMailBoxName[item_index]) != 0)
  2562.         && (pfnUnicodeStrlen((S8*) pMailBoxNumber[item_index]) != 0))
  2563.     {
  2564.         pfnUnicodeStrcpy((S8*) hint_array[0], (S8*) pMailBoxNumber[item_index]);
  2565.         return 1;
  2566.     }
  2567.     else
  2568.     {
  2569.         return 0;
  2570.     }
  2571. }
  2572. /*****************************************************************************
  2573.  * FUNCTION
  2574.  *  mmi_msg_entry_voice_mail_server_option
  2575.  * DESCRIPTION
  2576.  *  Entry voice mail server option
  2577.  * PARAMETERS
  2578.  *  void
  2579.  * RETURNS
  2580.  *  void
  2581.  *****************************************************************************/
  2582. void mmi_msg_entry_voice_mail_server_option(void)
  2583. {
  2584.     /*----------------------------------------------------------------*/
  2585.     /* Local Variables                                                */
  2586.     /*----------------------------------------------------------------*/
  2587.     U8 *guiBuffer = NULL;
  2588.     U16 numItems = 0;
  2589.     U16 nStrItemList[MAX_SUB_MENUS];
  2590.     /*----------------------------------------------------------------*/
  2591.     /* Code Body                                                      */
  2592.     /*----------------------------------------------------------------*/
  2593.     EntryNewScreen(SCR_ID_MSG_VOICE_MAIL_OPTION, mmi_msg_exit_generic, mmi_msg_entry_voice_mail_server_option, NULL);
  2594.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsMoMtGuiInterface.c] mmi_msg_entry_option_other -------*n"));
  2595.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_VOICE_MAIL_OPTION);
  2596.     numItems = GetNumOfChild(MENU_ITEM_VOICE_MAIL_OPTION);
  2597.     GetSequenceStringIds(MENU_ITEM_VOICE_MAIL_OPTION, nStrItemList);
  2598.     SetParentHandler(MENU_ITEM_VOICE_MAIL_OPTION);
  2599.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2600.     SetMessagesCurrScrnID(SCR_ID_MSG_VOICE_MAIL_OPTION);
  2601.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_VOICE_MAIL_OPTION);
  2602.     GetCurrEndKeyDownHandler();
  2603.     ShowCategory52Screen(
  2604.         STR_VOICE_MAIL_OPTION_ID,
  2605.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2606.         STR_GLOBAL_OK,
  2607.         IMG_GLOBAL_OK,
  2608.         STR_GLOBAL_BACK,
  2609.         IMG_GLOBAL_BACK,
  2610.         numItems,
  2611.         nStrItemList,
  2612.         (U16*) gIndexIconsImageList,
  2613.         NULL,
  2614.         0,
  2615.         0,
  2616.         guiBuffer);
  2617.     SetKeyHandler(mmi_msg_end_key_from_voice_mail_server, KEY_END, KEY_EVENT_DOWN);
  2618. }
  2619. /*****************************************************************************
  2620.  * FUNCTION
  2621.  *  mmi_msg_set_mailbox_inline_item
  2622.  * DESCRIPTION
  2623.  *  Entry voice mail server edit screen
  2624.  * PARAMETERS
  2625.  *  void
  2626.  * RETURNS
  2627.  *  void
  2628.  *****************************************************************************/
  2629. void mmi_msg_set_mailbox_inline_item(void)
  2630. {
  2631.     /*----------------------------------------------------------------*/
  2632.     /* Local Variables                                                */
  2633.     /*----------------------------------------------------------------*/
  2634.     /*----------------------------------------------------------------*/
  2635.     /* Code Body                                                      */
  2636.     /*----------------------------------------------------------------*/
  2637.     /* say activate these items */
  2638.     SetInlineItemActivation(&wgui_inline_items[0], KEY_LSK, KEY_EVENT_UP);
  2639.     /* profile name */
  2640.     SetInlineItemFullScreenEdit(
  2641.         &wgui_inline_items[0],
  2642.         STR_VOICE_MAIL_NAME,
  2643.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2644.         (PU8) psMailboxEditInfo.mailboxName,
  2645.         /* MAX_PROFILE_NAME_LEN */ psMailboxEditInfo.malboxNameLength + 1,
  2646.         INPUT_TYPE_USE_ENCODING_BASED_LENGTH | INPUT_TYPE_ONE_LESS_CHARACTER | INPUT_TYPE_ALPHANUMERIC_SENTENCECASE | INPUT_TYPE_GSM_EXTENDED_HANDLING);
  2647.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[0], mmi_msg_inline_generic_custom_function);
  2648.     /* service center */
  2649.     SetInlineItemActivation(&wgui_inline_items[1], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2650.     SetInlineItemTextEdit(
  2651.         &wgui_inline_items[1],
  2652.         (PU8) psMailboxEditInfo.mailboxAddress,
  2653.         MAX_DIGITS_SMS,
  2654.         INPUT_TYPE_PHONE_NUMBER | INPUT_TYPE_PLUS_CHARACTER_HANDLING);
  2655.     DisableInlineItemHighlight(&wgui_inline_items[1]);
  2656.     /* validity period */
  2657. }
  2658. /*****************************************************************************
  2659.  * FUNCTION
  2660.  *  mmi_msg_voice_mail_server_edit_highlight_handler
  2661.  * DESCRIPTION
  2662.  *  
  2663.  * PARAMETERS
  2664.  *  index       [IN]        
  2665.  * RETURNS
  2666.  *  void
  2667.  *****************************************************************************/
  2668. void mmi_msg_voice_mail_server_edit_highlight_handler(S32 index)
  2669. {
  2670.     /*----------------------------------------------------------------*/
  2671.     /* Local Variables                                                */
  2672.     /*----------------------------------------------------------------*/
  2673.     /*----------------------------------------------------------------*/
  2674.     /* Code Body                                                      */
  2675.     /*----------------------------------------------------------------*/
  2676.     ChangeTitleString((PU8) GetString(profileEditStrings[index]));
  2677.     draw_title();
  2678.     /* voice server name */
  2679.     if (index == 0)
  2680.     {
  2681.         /* The length of voice server name is zero. */
  2682.         if (psMailboxEditInfo.malboxNameLength == 0)
  2683.         {
  2684.             ChangeLeftSoftkey(0, 0);
  2685.         }
  2686.     }
  2687. }
  2688. /*****************************************************************************
  2689.  * FUNCTION
  2690.  *  mmi_msg_exit_voice_mail_server_edit
  2691.  * DESCRIPTION
  2692.  *  Exit profile edit screen
  2693.  * PARAMETERS
  2694.  *  void
  2695.  * RETURNS
  2696.  *  void
  2697.  *****************************************************************************/
  2698. void mmi_msg_exit_voice_mail_server_edit(void)
  2699. {
  2700.     /*----------------------------------------------------------------*/
  2701.     /* Local Variables                                                */
  2702.     /*----------------------------------------------------------------*/
  2703.     history currHistory;
  2704.     U16 inputBufferSize = 0;    /* added for inline edit history */
  2705.     S16 nHistory = 0;
  2706.     /*----------------------------------------------------------------*/
  2707.     /* Code Body                                                      */
  2708.     /*----------------------------------------------------------------*/
  2709.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[SmsSettingsGuiInterface.c] ExitScrProfileSetting -------*n"));
  2710.     if (GetUCS2Flag((PS8) psMailboxEditInfo.mailboxName))
  2711.     {
  2712.         psMailboxEditInfo.mailboxNameDcs = PHB_UCS2;
  2713.     }
  2714.     else
  2715.     {
  2716.         psMailboxEditInfo.mailboxNameDcs = PHB_ASCII;
  2717.     }
  2718.     g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes = SCR_ID_MSG_VOICE_MAIL_EDIT;
  2719.     SetMessagesCurrScrnID(0);
  2720.     currHistory.scrnID = SCR_ID_MSG_VOICE_MAIL_EDIT;
  2721.     CloseCategory57Screen();
  2722.     currHistory.entryFuncPtr = mmi_msg_entry_voice_mail_server_edit;
  2723.     pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
  2724.     GetCategory57History(currHistory.guiBuffer);
  2725.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  2726.     GetCategory57Data((U8*) currHistory.inputBuffer);   /* added for inline edit history */
  2727.     AddNHistory(currHistory, inputBufferSize);          /* added for inline edit history */
  2728. }
  2729. /*****************************************************************************
  2730.  * FUNCTION
  2731.  *  mmi_msg_entry_voice_mail_server_edit
  2732.  * DESCRIPTION
  2733.  *  
  2734.  * PARAMETERS
  2735.  *  void
  2736.  * RETURNS
  2737.  *  void
  2738.  *****************************************************************************/
  2739. void mmi_msg_entry_voice_mail_server_edit(void)
  2740. {
  2741.     /*----------------------------------------------------------------*/
  2742.     /* Local Variables                                                */
  2743.     /*----------------------------------------------------------------*/
  2744.     U8 *guiBuffer = NULL;
  2745.     U8 *inputBuffer = NULL;
  2746.     U16 inputBufferSize = 0;
  2747.     U8 numOfItems = MAX_MAILBOX_PS_SUPPORT;
  2748.     /*----------------------------------------------------------------*/
  2749.     /* Code Body                                                      */
  2750.     /*----------------------------------------------------------------*/
  2751.     EntryNewScreen(SCR_ID_MSG_VOICE_MAIL_EDIT, mmi_msg_exit_voice_mail_server_edit, NULL, NULL);
  2752.     InitializeCategory57Screen();
  2753.     guiBuffer = GetCurrGuiBuffer(SCR_ID_MSG_VOICE_MAIL_EDIT);
  2754.     inputBuffer = GetCurrNInputBuffer(SCR_ID_MSG_VOICE_MAIL_EDIT, &inputBufferSize);
  2755.     RegisterHighlightHandler(mmi_msg_voice_mail_server_edit_highlight_handler);
  2756.     profileEditStrings[0] = STR_VOICE_MAIL_NAME;
  2757.     profileEditStrings[1] = STR_VOICE_MAIL_NUM;
  2758.     psMailboxEditInfo.mailboxIndex = g_msg_cntx.currHiliteIndex;
  2759.     psMailboxEditInfo.mailboxNameDcs = psMailBoxDCS[psMailboxEditInfo.mailboxIndex];
  2760.     pfnUnicodeStrcpy((S8*) psMailboxEditInfo.mailboxName, (S8*) pMailBoxName[psMailboxEditInfo.mailboxIndex]);
  2761.     pfnUnicodeStrcpy((S8*) psMailboxEditInfo.mailboxAddress, (S8*) pMailBoxNumber[psMailboxEditInfo.mailboxIndex]);
  2762. #ifndef MMI_ON_HARDWARE_P
  2763.     psMailboxEditInfo.malboxNameLength = pfnUnicodeStrlen((S8*) psMailboxEditInfo.mailboxName);
  2764. #endif 
  2765.     mmi_msg_set_mailbox_inline_item();
  2766.     if (guiBuffer != NULL)
  2767.     {
  2768.         SetCategory57Data(wgui_inline_items, numOfItems, inputBuffer);
  2769.     }
  2770.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_MSG_VOICE_MAIL_EDIT);
  2771.     SetMessagesCurrScrnID(SCR_ID_MSG_VOICE_MAIL_EDIT);
  2772.     mmi_msg_set_confirm_screen(STR_GLOBAL_SAVE, mmi_msg_set_mailbox_inline_item_req, Messages2GoBackHistory);
  2773.     ShowCategory57Screen(
  2774.         STR_VMAIL_MENUENTRY,
  2775.         IMG_SMS_ENTRY_SCRN_CAPTION,
  2776.         STR_GLOBAL_EDIT,
  2777.         IMG_GLOBAL_OK,
  2778.         STR_GLOBAL_BACK,
  2779.         IMG_GLOBAL_BACK,
  2780.         numOfItems,
  2781.         profileEditIcons,
  2782.         wgui_inline_items,
  2783.         0,
  2784.         guiBuffer);
  2785.     SetCategory57RightSoftkeyFunctions(mmi_msg_entry_confirm_generic, GoBackHistory);
  2786.     SetKeyHandler(mmi_msg_end_key_from_voice_mail_server, KEY_END, KEY_EVENT_DOWN);
  2787. }
  2788. /*****************************************************************************
  2789.  * FUNCTION
  2790.  *  mmi_msg_highlight_msg_settings
  2791.  * DESCRIPTION
  2792.  *  Handle highlight on message settings menu item
  2793.  * PARAMETERS
  2794.  *  void
  2795.  * RETURNS
  2796.  *  void
  2797.  *****************************************************************************/
  2798. void mmi_msg_highlight_msg_settings(void)
  2799. {
  2800.     /*----------------------------------------------------------------*/
  2801.     /* Local Variables                                                */
  2802.     /*----------------------------------------------------------------*/
  2803.     /*----------------------------------------------------------------*/
  2804.     /* Code Body                                                      */
  2805.     /*----------------------------------------------------------------*/
  2806.     mmi_msg_highlight_generic(
  2807.         STR_GLOBAL_OK,
  2808.         IMG_GLOBAL_OK,
  2809.         STR_GLOBAL_BACK,
  2810.         IMG_GLOBAL_BACK,
  2811.         mmi_msg_pre_entry_msg_settings,
  2812.         GoBackHistory);
  2813. }
  2814. /*****************************************************************************
  2815.  * FUNCTION
  2816.  *  mmi_msg_highlight_profile_settings
  2817.  * DESCRIPTION
  2818.  *  Handle highlight on profile settings menu item
  2819.  * PARAMETERS
  2820.  *  void
  2821.  * RETURNS
  2822.  *  void
  2823.  *****************************************************************************/
  2824. void mmi_msg_highlight_profile_settings(void)
  2825. {
  2826.     /*----------------------------------------------------------------*/
  2827.     /* Local Variables                                                */
  2828.     /*----------------------------------------------------------------*/
  2829.     /*----------------------------------------------------------------*/
  2830.     /* Code Body                                                      */
  2831.     /*----------------------------------------------------------------*/
  2832.     mmi_msg_highlight_generic(
  2833.         STR_GLOBAL_OK,
  2834.         IMG_GLOBAL_OK,
  2835.         STR_GLOBAL_BACK,
  2836.         IMG_GLOBAL_BACK,
  2837.         mmi_msg_get_profile_list_req,
  2838.         GoBackHistory);
  2839. }
  2840. /*****************************************************************************
  2841.  * FUNCTION
  2842.  *  mmi_msg_highlight_common_settings
  2843.  * DESCRIPTION
  2844.  *  Handle highlight on common settings menu item
  2845.  * PARAMETERS
  2846.  *  void
  2847.  *  a(?)        [IN/OUT]        First variable, used as returns
  2848.  *  b(?)        [IN]            Second variable
  2849.  * RETURNS
  2850.  *  the description of return value, if any.(?)
  2851.  *****************************************************************************/
  2852. void mmi_msg_highlight_common_settings(void)
  2853. {
  2854.     /*----------------------------------------------------------------*/
  2855.     /* Local Variables                                                */
  2856.     /*----------------------------------------------------------------*/
  2857.     /*----------------------------------------------------------------*/
  2858.     /* Code Body                                                      */
  2859.     /*----------------------------------------------------------------*/
  2860.     mmi_msg_highlight_generic(
  2861.         STR_GLOBAL_OK,
  2862.         IMG_GLOBAL_OK,
  2863.         STR_GLOBAL_BACK,
  2864.         IMG_GLOBAL_BACK,
  2865.         mmi_msg_get_common_settings_req,
  2866.         GoBackHistory);
  2867. }
  2868. #ifdef __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__
  2869. /*****************************************************************************
  2870.  * FUNCTION
  2871.  *  mmi_msg_highlight_memory_status
  2872.  * DESCRIPTION
  2873.  *  Handle highlight on memory status menu item
  2874.  * PARAMETERS
  2875.  *  void
  2876.  * RETURNS
  2877.  *  void
  2878.  *****************************************************************************/
  2879. void mmi_msg_highlight_memory_status(void)
  2880. {
  2881.     /*----------------------------------------------------------------*/
  2882.     /* Local Variables                                                */
  2883.     /*----------------------------------------------------------------*/
  2884.     /*----------------------------------------------------------------*/
  2885.     /* Code Body                                                      */
  2886.     /*----------------------------------------------------------------*/
  2887.     mmi_msg_highlight_generic(
  2888.         STR_GLOBAL_OK,
  2889.         IMG_GLOBAL_OK,
  2890.         STR_GLOBAL_BACK,
  2891.         IMG_GLOBAL_BACK,
  2892.         mmi_msg_get_memory_status_req,
  2893.         GoBackHistory);
  2894. }
  2895. /*****************************************************************************
  2896.  * FUNCTION
  2897.  *  mmi_msg_highlight_preferred_storage
  2898.  * DESCRIPTION
  2899.  *  Handle highlight on preferred storage menu item
  2900.  * PARAMETERS
  2901.  *  void
  2902.  * RETURNS
  2903.  *  void
  2904.  *****************************************************************************/
  2905. void mmi_msg_highlight_preferred_storage(void)
  2906. {
  2907.     /*----------------------------------------------------------------*/
  2908.     /* Local Variables                                                */
  2909.     /*----------------------------------------------------------------*/
  2910.     /*----------------------------------------------------------------*/
  2911.     /* Code Body                                                      */
  2912.     /*----------------------------------------------------------------*/
  2913.     mmi_msg_highlight_generic(
  2914.         STR_GLOBAL_OK,
  2915.         IMG_GLOBAL_OK,
  2916.         STR_GLOBAL_BACK,
  2917.         IMG_GLOBAL_BACK,
  2918.         mmi_msg_get_preferred_memory_status_req,
  2919.         GoBackHistory);
  2920. }
  2921. /*****************************************************************************
  2922.  * FUNCTION
  2923.  *  mmi_msg_hint_preferred_storage
  2924.  * DESCRIPTION
  2925.  *  Handle hint on preferred storage
  2926.  * PARAMETERS
  2927.  *  index       [IN]        
  2928.  *  a(?)        [IN]        Current highlight index
  2929.  * RETURNS
  2930.  *  void
  2931.  *****************************************************************************/
  2932. void mmi_msg_hint_preferred_storage(U16 index)
  2933. {
  2934.     /*----------------------------------------------------------------*/
  2935.     /* Local Variables                                                */
  2936.     /*----------------------------------------------------------------*/
  2937.     PU8 StorageStr;
  2938.     /*----------------------------------------------------------------*/
  2939.     /* Code Body                                                      */
  2940.     /*----------------------------------------------------------------*/
  2941.     if (memStatus.prefStorage == 0)
  2942.     {
  2943.         StorageStr = (PU8) GetString((U16) STR_SIM_STORAGE_MENUENTRY);
  2944.     }
  2945.     else
  2946.     {
  2947.         StorageStr = (PU8) GetString((U16) STR_ME_STORAGE_MENUENTRY);
  2948.     }
  2949.     memset((PS8) hintData[index], 0, sizeof(hintData[index]));
  2950.     pfnUnicodeStrcpy((PS8) hintData[index], (PS8) StorageStr);
  2951. }
  2952. #endif /* __MMI_MESSAGES_PREFER_STORAGE_MEMORY_STATUS__ */ 
  2953. #ifdef __MMI_GPRS_FEATURES__
  2954. /*****************************************************************************
  2955.  * FUNCTION
  2956.  *  mmi_msg_highlight_bearer_settings
  2957.  * DESCRIPTION
  2958.  *  Handle highlight on bearer settings menu item
  2959.  * PARAMETERS
  2960.  *  void
  2961.  * RETURNS
  2962.  *  void
  2963.  *****************************************************************************/
  2964. void mmi_msg_highlight_bearer_settings(void)
  2965. {
  2966.     /*----------------------------------------------------------------*/
  2967.     /* Local Variables                                                */
  2968.     /*----------------------------------------------------------------*/
  2969.     /*----------------------------------------------------------------*/
  2970.     /* Code Body                                                      */
  2971.     /*----------------------------------------------------------------*/
  2972.     mmi_msg_highlight_generic(
  2973.         STR_GLOBAL_OK,
  2974.         IMG_GLOBAL_OK,
  2975.         STR_GLOBAL_BACK,
  2976.         IMG_GLOBAL_BACK,
  2977.         mmi_msg_entry_bearer_settings,
  2978.         GoBackHistory);
  2979. }
  2980. /*****************************************************************************
  2981.  * FUNCTION
  2982.  *  mmi_msg_hint_bearer_settings
  2983.  * DESCRIPTION
  2984.  *  Handle hint on bearer settings menu item
  2985.  * PARAMETERS
  2986.  *  index       [IN]        
  2987.  *  a(?)        [IN]        Current highlight index
  2988.  * RETURNS
  2989.  *  void
  2990.  *****************************************************************************/
  2991. void mmi_msg_hint_bearer_settings(U16 index)
  2992. {
  2993.     /*----------------------------------------------------------------*/
  2994.     /* Local Variables                                                */
  2995.     /*----------------------------------------------------------------*/
  2996.     PU8 BearerStr;
  2997.     /*----------------------------------------------------------------*/
  2998.     /* Code Body                                                      */
  2999.     /*----------------------------------------------------------------*/
  3000.     switch (preferBearer)
  3001.     {
  3002.         case MMI_SMS_PREFER_GPRS:
  3003.             BearerStr = (PU8) GetString((U16) STR_PREFER_GPRS_BEARER_MENUENTRY);
  3004.             break;
  3005.         case MMI_SMS_PREFER_GSM:
  3006.             BearerStr = (PU8) GetString((U16) STR_PREFER_GSM_BEARER_MENUENTRY);
  3007.             break;
  3008.         case MMI_SMS_GSM_ONLY:
  3009.             BearerStr = (PU8) GetString((U16) STR_GSM_BEARER_MENUENTRY);
  3010.             break;
  3011.         default:
  3012.             BearerStr = (PU8) GetString((U16) STR_PREFER_GPRS_BEARER_MENUENTRY);
  3013.             break;
  3014.     }
  3015.     memset((PS8) hintData[index], 0, sizeof(hintData[index]));
  3016.     pfnUnicodeStrcpy((PS8) hintData[index], (PS8) BearerStr);
  3017. }
  3018. #endif /* __MMI_GPRS_FEATURES__ */ 
  3019. /*****************************************************************************
  3020.  * FUNCTION
  3021.  *  mmi_msg_highlight_voice_mail_server_edit
  3022.  * DESCRIPTION
  3023.  *  Handle highlight on voice mail server edit menu item
  3024.  * PARAMETERS
  3025.  *  void
  3026.  * RETURNS
  3027.  *  void
  3028.  *****************************************************************************/
  3029. void mmi_msg_highlight_voice_mail_server_edit(void)
  3030. {
  3031.     /*----------------------------------------------------------------*/
  3032.     /* Local Variables                                                */
  3033.     /*----------------------------------------------------------------*/
  3034.     /*----------------------------------------------------------------*/
  3035.     /* Code Body                                                      */
  3036.     /*----------------------------------------------------------------*/
  3037.     mmi_msg_highlight_generic(
  3038.         STR_GLOBAL_OK,
  3039.         IMG_GLOBAL_OK,
  3040.         STR_GLOBAL_BACK,
  3041.         IMG_GLOBAL_BACK,
  3042.         mmi_msg_entry_voice_mail_server_edit,
  3043.         GoBackHistory);
  3044. }
  3045. /*****************************************************************************
  3046.  * FUNCTION
  3047.  *  mmi_msg_highlight_voice_mail_server_dial
  3048.  * DESCRIPTION
  3049.  *  Handle highlight on voice mail server dial menu item
  3050.  * PARAMETERS
  3051.  *  void
  3052.  * RETURNS
  3053.  *  void
  3054.  *****************************************************************************/
  3055. void mmi_msg_highlight_voice_mail_server_dial(void)
  3056. {
  3057.     /*----------------------------------------------------------------*/
  3058.     /* Local Variables                                                */
  3059.     /*----------------------------------------------------------------*/
  3060.     /*----------------------------------------------------------------*/
  3061.     /* Code Body                                                      */
  3062.     /*----------------------------------------------------------------*/
  3063.     mmi_msg_highlight_generic(
  3064.         STR_GLOBAL_OK,
  3065.         IMG_GLOBAL_OK,
  3066.         STR_GLOBAL_BACK,
  3067.         IMG_GLOBAL_BACK,
  3068.         mmi_msg_dial_mailbox_address,
  3069.         GoBackHistory);
  3070.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  3071. }
  3072. /*****************************************************************************
  3073.  * FUNCTION
  3074.  *  ConvertL4NumberStructToDisplay
  3075.  * DESCRIPTION
  3076.  *  Convert L4 number structure to display
  3077.  * PARAMETERS
  3078.  *  number      [?]         
  3079.  *  length      [IN]        
  3080.  *  type        [IN]        
  3081.  *  a(?)        [IN]        Number from L4
  3082.  *  c(?)        [IN]        Type from L4
  3083.  *  b(?)        [IN]        Length from L4
  3084.  * RETURNS
  3085.  *  converted number
  3086.  *****************************************************************************/
  3087. U8 *ConvertL4NumberStructToDisplay(U8 *number, U8 length, U8 type)
  3088. {
  3089.     /*----------------------------------------------------------------*/
  3090.     /* Local Variables                                                */
  3091.     /*----------------------------------------------------------------*/
  3092.     U8 *convertedData;
  3093.     U8 typeInternational = 0;
  3094.     /*----------------------------------------------------------------*/
  3095.     /* Code Body                                                      */
  3096.     /*----------------------------------------------------------------*/
  3097.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*-------[MessagesMiscell.c] ConvertL4NumberStructToDisplay -------*n"));
  3098.     if (length)
  3099.     {
  3100.         if (type == CSMCC_INTERNATIONAL_ADDR)
  3101.         {
  3102.             typeInternational = 1;
  3103.         }
  3104.         else
  3105.         {
  3106.             typeInternational = 0;
  3107.         }
  3108.         convertedData = OslMalloc(((length + typeInternational) * ENCODING_LENGTH) + ENCODING_LENGTH);
  3109.     #ifdef __UCS2_ENCODING
  3110.         if (typeInternational)
  3111.         {
  3112.             AnsiiToUnicodeString((PS8) convertedData, (PS8) "+");
  3113.         }
  3114.         AnsiiNToUnicodeString((PS8) convertedData + (typeInternational * ENCODING_LENGTH), (PS8) number, length);
  3115.         memset((void*)&convertedData[(length + typeInternational) * ENCODING_LENGTH], 0, ENCODING_LENGTH);
  3116.     #else /* __UCS2_ENCODING */ 
  3117.         if (typeInternational)
  3118.         {
  3119.             pfnUnicodeStrcpy((PS8) convertedData, (PS8) "+");
  3120.         }
  3121.         pfnUnicodeStrcpy((PS8) convertedData + typeInternational, (PS8) number, length);
  3122.         convertedData[length + typeInternational] = '';
  3123.     #endif /* __UCS2_ENCODING */ 
  3124.         return convertedData;
  3125.     }
  3126.     else
  3127.     {
  3128.         convertedData = OslMalloc(ENCODING_LENGTH);
  3129.         memset((void*)convertedData, 0, ENCODING_LENGTH);
  3130.         return convertedData;
  3131.     }
  3132. }
  3133. /*****************************************************************************
  3134.  * FUNCTION
  3135.  *  DialVoiceMail
  3136.  * DESCRIPTION
  3137.  *  Dial voice mail server number
  3138.  * PARAMETERS
  3139.  *  void
  3140.  * RETURNS
  3141.  *  void
  3142.  *****************************************************************************/
  3143. void DialVoiceMail(void)
  3144. {
  3145.     /*----------------------------------------------------------------*/
  3146.     /* Local Variables                                                */
  3147.     /*----------------------------------------------------------------*/
  3148.     /*----------------------------------------------------------------*/
  3149.     /* Code Body                                                      */
  3150.     /*----------------------------------------------------------------*/
  3151. #ifdef __MMI_TOUCH_DIAL_SCREEN__
  3152.     g_idle_context.AvoidHistoryofDialerScreen = 1; /* Not save dialer screen to history for long press to dial mailbox */
  3153. #endif
  3154.     ClearInputEventHandler(MMI_DEVICE_ALL);
  3155.     mmi_msg_dial_mailbox_req();
  3156. }
  3157. /*****************************************************************************
  3158.  * FUNCTION
  3159.  *  FreeVoiceMailData
  3160.  * DESCRIPTION
  3161.  *  Free voice mail server data
  3162.  * PARAMETERS
  3163.  *  void
  3164.  * RETURNS
  3165.  *  void
  3166.  *****************************************************************************/
  3167. void FreeVoiceMailData(void)
  3168. {
  3169.     /*----------------------------------------------------------------*/
  3170.     /* Local Variables                                                */
  3171.     /*----------------------------------------------------------------*/
  3172.     U8 i = 0;
  3173.     /*----------------------------------------------------------------*/
  3174.     /* Code Body                                                      */
  3175.     /*----------------------------------------------------------------*/
  3176.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "n [VoiceMail]@@@@@ FreeVoiceMailData -  @@@@@"));
  3177.     for (i = 0; i < MAX_MAILBOX_PS_SUPPORT; i++)
  3178.     {
  3179.         if (pMailBoxName[i])
  3180.         {
  3181.             OslMfree(pMailBoxName[i]);
  3182.             pMailBoxName[i] = NULL;
  3183.         }
  3184.         if (pMailBoxNumber[i])
  3185.         {
  3186.             OslMfree(pMailBoxNumber[i]);
  3187.             pMailBoxNumber[i] = NULL;
  3188.         }
  3189.     }
  3190. }
  3191. /*****************************************************************************
  3192.  * FUNCTION
  3193.  *  DeInitVoiceMailApp
  3194.  * DESCRIPTION
  3195.  *  Deinit voice mail application (free voice mail server data)
  3196.  * PARAMETERS
  3197.  *  void
  3198.  * RETURNS
  3199.  *  void
  3200.  *****************************************************************************/
  3201. void DeInitVoiceMailApp(void)
  3202. {
  3203.     /*----------------------------------------------------------------*/
  3204.     /* Local Variables                                                */
  3205.     /*----------------------------------------------------------------*/
  3206.     /*----------------------------------------------------------------*/
  3207.     /* Code Body                                                      */
  3208.     /*----------------------------------------------------------------*/
  3209.     FreeVoiceMailData();
  3210. }
  3211. #ifndef MMI_ON_HARDWARE_P
  3212. /*****************************************************************************
  3213.  * FUNCTION
  3214.  *  InitSMSSetting
  3215.  * DESCRIPTION
  3216.  *  
  3217.  * PARAMETERS
  3218.  *  void
  3219.  * RETURNS
  3220.  *  void
  3221.  *****************************************************************************/
  3222. void InitSMSSetting(void)
  3223. {
  3224.     /*----------------------------------------------------------------*/
  3225.     /* Local Variables                                                */
  3226.     /*----------------------------------------------------------------*/
  3227.     /*----------------------------------------------------------------*/
  3228.     /* Code Body                                                      */
  3229.     /*----------------------------------------------------------------*/
  3230.     memStatus.prefStorage = SMSAL_SM_PREFER;
  3231.     memStatus.simUsed = 1;
  3232.     memStatus.simTotal = 10;
  3233.     memStatus.meUsed = 0;
  3234.     memStatus.meTotal = 10;
  3235. #ifdef __MMI_GPRS_FEATURES__
  3236.     preferBearer = MMI_SMS_PREFER_GPRS;
  3237. #endif 
  3238.     DeliveryRepyStates[0] = 0;
  3239.     DeliveryRepyStates[1] = 0;
  3240.     psProfileNameList.currMaxPsProfiles = 1;
  3241.     AnsiiToUnicodeString((PS8) psProfileNameList.profileName[0], (PS8) "profile name");
  3242.     memcpy((PS8) psProfileEditInfo.profileName, (PS8) psProfileNameList.profileName, 24);
  3243.     AnsiiToUnicodeString((PS8) psProfileEditInfo.scAddress, (PS8) "+12345");
  3244.     psProfileEditInfo.vpIndex = 4;
  3245.     psProfileEditInfo.msgTypeIndex = 0;
  3246. }
  3247. #endif /* MMI_ON_HARDWARE_P */ 
  3248. #endif /* __MOD_SMSAL__ */