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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2002
  8. *
  9. *****************************************************************************/
  10. /*****************************************************************************
  11.  *
  12.  * Filename:
  13.  * ---------
  14.  *  jmms_message_settings.C
  15.  *
  16.  * Project:
  17.  * --------
  18.  *  MAUI
  19.  *
  20.  * Description:
  21.  * ------------
  22.  *  This file contans the ui and NVRAm integration for message settings
  23.  *
  24.  * Author:
  25.  * -------
  26.  * -------
  27.  *
  28.  *============================================================================
  29.  *             HISTORY
  30.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  31.  *------------------------------------------------------------------------------
  32.  * removed!
  33.  *
  34.  * removed!
  35.  * removed!
  36.  * removed!
  37.  *
  38.  * removed!
  39.  * removed!
  40.  * removed!
  41.  *
  42.  * removed!
  43.  * removed!
  44.  * removed!
  45.  *
  46.  * removed!
  47.  * removed!
  48.  * removed!
  49.  *
  50.  * removed!
  51.  * removed!
  52.  * removed!
  53.  *
  54.  * removed!
  55.  * removed!
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  *------------------------------------------------------------------------------
  63.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  64.  *============================================================================
  65.  ****************************************************************************/
  66. #ifndef _MMI_JMMSMMSSETTINGS_C
  67. #define _MMI_JMMSMMSSETTINGS_C
  68. /***************************************************************************** 
  69. * Include
  70. *****************************************************************************/
  71. #include "MMI_features.h"
  72. #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
  73. #include "PixtelDataTypes.h"
  74. #include "Unicodexdcl.h"
  75. #include "HistoryGprot.h"
  76. #include "GlobalDefs.h"
  77. #include "SettingProfile.h"
  78. #include "DebugInitDef.h"
  79. #include "CommonScreens.h"
  80. #include "EventsGprot.h"
  81. #include "wgui_inputs.h"
  82. #include "wgui_categories.h"
  83. #include "wgui_categories_inputs.h"
  84. #include "MainMenuDef.h"
  85. #include "NVRAMEnum.h"
  86. #include "NVRAMType.h"
  87. #include "NVRAMProt.h"
  88. #include "JMMSExdcl.h"
  89. #include "JMMSStructs.h"
  90. /* PMT DARA  PROFILE HANDLER 020106 */
  91. #include "JProfileHandlerTypes.h"
  92. #include "JProfileHandlerProts.h"
  93. #include "JMMSConfig.h"
  94. #include "JMMSMessageSettings.h"
  95. #include "JMMSCoreAPI.h"
  96. #include "JMMSDrafts.h"
  97. #include "JMMSExdcl.h"
  98. /* /#include "JMMSGdcl.h" */
  99. #include "JMMSCompose.h"
  100. #include "JMMSGprot.h"
  101. #include "JMMSInbox.h"
  102. #include "JMMSJSRHandler.h"
  103. #include "JMMSMainMMS.h"
  104. #include "JMMSMessageSettingsUtils.h"
  105. #include "JMMSOutbox.h"
  106. #include "JMMSProtocols.h"
  107. #include "JMMSPushHandling.h"
  108. #include "JMMSResEnum.h"
  109. #include "JMMSSent.h"
  110. #include "JMMSStoreHandling.h"
  111. #include "JMMSStructs.h"
  112. #include "JMMSTemplates.h"
  113. #include "JMMSUseDetails.h"
  114. #include "JMMSView.h"
  115. #include "JMMSWriteMMS.h"
  116. #include "custom_wap_config.h"
  117. #include "PrvStoreDataTypes.h"
  118. #include "PrvStoreHandleInterfaces.h"
  119. #ifdef __MMI_UNIFIED_MESSAGE__
  120. #include "UnifiedMessageDef.h"
  121. #endif 
  122. /***************************************************************************** 
  123. * Define
  124. *****************************************************************************/
  125. /***************************************************************************** 
  126. * Typedef 
  127. *****************************************************************************/
  128. /***************************************************************************** 
  129. * Local Variable
  130. *****************************************************************************/
  131. /***************************************************************************** 
  132. * Local Function
  133. *****************************************************************************/
  134. /***************************************************************************** 
  135. * Global Variable
  136. *****************************************************************************/
  137. static jmms_send_settings_entry_control_enum g_jmms_control = E_ENTRY_FROM_MMS_SETTINGS;
  138. static U8 g_reply_charging_done = 0;    /* /to check whether something done in reply charging screen */
  139. static U8 g_recieve_filter_done = 0;    /* /to check whether something done in filters screen */
  140. /***************************************************************************** 
  141. * Global Function
  142. *****************************************************************************/
  143. extern void set_leading_zero(U8 u8type);
  144. /*****************************************************************************
  145.  * FUNCTION
  146.  *  mmi_jmms_highlight_messages_settings
  147.  * DESCRIPTION
  148.  *  This function is the highlight handler of message settings
  149.  * PARAMETERS
  150.  *  void
  151.  * RETURNS
  152.  *  void
  153.  *****************************************************************************/
  154. void mmi_jmms_highlight_messages_settings(void)
  155. {
  156.     /*----------------------------------------------------------------*/
  157.     /* Local Variables                                                */
  158.     /*----------------------------------------------------------------*/
  159.     /*----------------------------------------------------------------*/
  160.     /* Code Body                                                      */
  161.     /*----------------------------------------------------------------*/
  162.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  163.     SetLeftSoftkeyFunction(mmi_jmms_entry_message_settings, KEY_EVENT_UP);
  164.     SetKeyHandler(mmi_jmms_entry_message_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  165.     SetKeyHandler(mmi_jmms_entry_message_settings, KEY_WAP, KEY_EVENT_DOWN);
  166. }
  167. /*****************************************************************************
  168.  * FUNCTION
  169.  *  mmi_jmms_message_settings_init
  170.  * DESCRIPTION
  171.  *  This function init the hilight handlers of message settings menu items.
  172.  *  This is called at boot up time
  173.  * PARAMETERS
  174.  *  void
  175.  * RETURNS
  176.  *  void
  177.  *****************************************************************************/
  178. void mmi_jmms_message_settings_init(void)
  179. {
  180.     /*----------------------------------------------------------------*/
  181.     /* Local Variables                                                */
  182.     /*----------------------------------------------------------------*/
  183.     /*----------------------------------------------------------------*/
  184.     /* Code Body                                                      */
  185.     /*----------------------------------------------------------------*/
  186.     /* mESSAGE sETTINGS options Highlight handlers */
  187.     SetHiliteHandler(MENU_ID_JMMS_MMS_SETTINGS_COMPOSE, mmi_jmms_highlight_compose_setings);
  188.     SetHiliteHandler(MENU_ID_JMMS_MMS_SETTINGS_SENDING, mmi_jmms_highlight_sending_setings);
  189.     SetHiliteHandler(MENU_ID_JMMS_MMS_SETTINGS_RETRIEVAL, mmi_jmms_highlight_retrieval_setings);
  190.     SetHiliteHandler(MENU_ID_JMMS_MMS_SETTINGS_EDIT_PROFILE, mmi_jmms_highlight_edit_profile);
  191.     SetHiliteHandler(MENU_ID_JMMS_MMS_SETTINGS_MEMORY_STATUS, mmi_jmms_highlight_memory_status);
  192.     mmi_jmms_read_nvram_message_settings();
  193. }
  194. /*****************************************************************************
  195.  * FUNCTION
  196.  *  mmi_jmms_entry_message_settings
  197.  * DESCRIPTION
  198.  *  This function is the entry  handler of message settings
  199.  * PARAMETERS
  200.  *  void
  201.  * RETURNS
  202.  *  void
  203.  *****************************************************************************/
  204. void mmi_jmms_entry_message_settings(void)
  205. {
  206.     /*----------------------------------------------------------------*/
  207.     /* Local Variables                                                */
  208.     /*----------------------------------------------------------------*/
  209.     PU8 gui_buffer;                     /* Buffer holding history data */
  210.     U16 str_item_list[MAX_SUB_MENUS];   /* Stores the strings id of submenus returned */
  211.     U16 num_item;                       /* Stores no of children in the submenu */
  212.     /*----------------------------------------------------------------*/
  213.     /* Code Body                                                      */
  214.     /*----------------------------------------------------------------*/
  215.     EntryNewScreen(SCR_ID_JMMS_MESSAGE_SETTINGS, NULL, mmi_jmms_entry_message_settings, NULL);
  216.     gui_buffer = GetCurrGuiBuffer(SCR_ID_JMMS_MESSAGE_SETTINGS);
  217.     num_item = GetNumOfChild(MENU_ID_JMMS_MMS_SETTINGS);
  218.     GetSequenceStringIds(MENU_ID_JMMS_MMS_SETTINGS, str_item_list);
  219.     SetParentHandler(MENU_ID_JMMS_MMS_SETTINGS);
  220.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  221.     ShowCategory52Screen(
  222.         STR_ID_JMMS_MMS_SETTINGS,
  223.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  224.         STR_GLOBAL_OK,
  225.         IMG_GLOBAL_OK,
  226.         STR_GLOBAL_BACK,
  227.         IMG_GLOBAL_BACK,
  228.         num_item,
  229.         str_item_list,
  230.         (U16*) gIndexIconsImageList,
  231.         NULL,
  232.         0,
  233.         0,
  234.         gui_buffer);
  235.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  236.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  237. }
  238. /*****************************************************************************
  239.  * FUNCTION
  240.  *  mmi_jmms_highlight_compose_setings
  241.  * DESCRIPTION
  242.  *  This function is the highlight handler of compose message settings
  243.  * PARAMETERS
  244.  *  void
  245.  * RETURNS
  246.  *  void
  247.  *****************************************************************************/
  248. void mmi_jmms_highlight_compose_setings(void)
  249. {
  250.     /*----------------------------------------------------------------*/
  251.     /* Local Variables                                                */
  252.     /*----------------------------------------------------------------*/
  253.     /*----------------------------------------------------------------*/
  254.     /* Code Body                                                      */
  255.     /*----------------------------------------------------------------*/
  256.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  257.     SetLeftSoftkeyFunction(mmi_jmms_pre_entry_compose_settings, KEY_EVENT_UP);
  258.     SetKeyHandler(mmi_jmms_pre_entry_compose_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  259.     SetKeyHandler(mmi_jmms_pre_entry_compose_settings, KEY_WAP, KEY_EVENT_DOWN);
  260. }
  261. /*****************************************************************************
  262.  * FUNCTION
  263.  *  mmi_jmms_highlight_sending_setings
  264.  * DESCRIPTION
  265.  *  This function is the highlight handler of sending message settings
  266.  * PARAMETERS
  267.  *  void
  268.  * RETURNS
  269.  *  void
  270.  *****************************************************************************/
  271. void mmi_jmms_highlight_sending_setings(void)
  272. {
  273.     /*----------------------------------------------------------------*/
  274.     /* Local Variables                                                */
  275.     /*----------------------------------------------------------------*/
  276.     /*----------------------------------------------------------------*/
  277.     /* Code Body                                                      */
  278.     /*----------------------------------------------------------------*/
  279.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  280.     SetLeftSoftkeyFunction(mmi_jmms_pre_entry_sending_settings, KEY_EVENT_UP);
  281.     SetKeyHandler(mmi_jmms_pre_entry_sending_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  282.     SetKeyHandler(mmi_jmms_pre_entry_sending_settings, KEY_WAP, KEY_EVENT_DOWN);
  283. }
  284. /*****************************************************************************
  285.  * FUNCTION
  286.  *  mmi_jmms_highlight_retrieval_setings
  287.  * DESCRIPTION
  288.  *  This function is the highlight handler of retrieval message settings
  289.  * PARAMETERS
  290.  *  void
  291.  * RETURNS
  292.  *  void
  293.  *****************************************************************************/
  294. void mmi_jmms_highlight_retrieval_setings(void)
  295. {
  296.     /*----------------------------------------------------------------*/
  297.     /* Local Variables                                                */
  298.     /*----------------------------------------------------------------*/
  299.     /*----------------------------------------------------------------*/
  300.     /* Code Body                                                      */
  301.     /*----------------------------------------------------------------*/
  302.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  303.     SetLeftSoftkeyFunction(mmi_jmms_pre_entry_retrieval_settings, KEY_EVENT_UP);
  304.     SetKeyHandler(mmi_jmms_pre_entry_retrieval_settings, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  305.     SetKeyHandler(mmi_jmms_pre_entry_retrieval_settings, KEY_WAP, KEY_EVENT_DOWN);
  306. }
  307. /*****************************************************************************
  308.  * FUNCTION
  309.  *  mmi_jmms_highlight_edit_profile
  310.  * DESCRIPTION
  311.  *  This function is the highlight handler of edit profile
  312.  * PARAMETERS
  313.  *  void
  314.  * RETURNS
  315.  *  void
  316.  *****************************************************************************/
  317. void mmi_jmms_highlight_edit_profile(void)
  318. {
  319.     /*----------------------------------------------------------------*/
  320.     /* Local Variables                                                */
  321.     /*----------------------------------------------------------------*/
  322.     /*----------------------------------------------------------------*/
  323.     /* Code Body                                                      */
  324.     /*----------------------------------------------------------------*/
  325.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  326.     /* PMT DARA  PROFILE HANDLER 020106 */
  327.     SetLeftSoftkeyFunction(mmi_jmms_show_profile_list, KEY_EVENT_UP);
  328.     SetKeyHandler(mmi_jmms_show_profile_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  329.     SetKeyHandler(mmi_jmms_show_profile_list, KEY_WAP, KEY_EVENT_DOWN);
  330. }
  331. /* PMT DARA  PROFILE HANDLER 020106 */
  332. /*****************************************************************************
  333.  * FUNCTION
  334.  *  mmi_jmms_show_profile_list
  335.  * DESCRIPTION
  336.  *  
  337.  * PARAMETERS
  338.  *  void
  339.  * RETURNS
  340.  *  void
  341.  *****************************************************************************/
  342. void mmi_jmms_show_profile_list(void)
  343. {
  344.     /*----------------------------------------------------------------*/
  345.     /* Local Variables                                                */
  346.     /*----------------------------------------------------------------*/
  347.     /*----------------------------------------------------------------*/
  348.     /* Code Body                                                      */
  349.     /*----------------------------------------------------------------*/
  350.     mmi_ph_pre_entry_show_profile_list_menu(PH_MMS_PROFILE);
  351. }
  352. /*****************************************************************************
  353.  * FUNCTION
  354.  *  mmi_jmms_get_profile_title_icon
  355.  * DESCRIPTION
  356.  *  
  357.  * PARAMETERS
  358.  *  void
  359.  * RETURNS
  360.  *  void
  361.  *****************************************************************************/
  362. U16 mmi_jmms_get_profile_title_icon(void)
  363. {
  364.     /*----------------------------------------------------------------*/
  365.     /* Local Variables                                                */
  366.     /*----------------------------------------------------------------*/
  367.     /*----------------------------------------------------------------*/
  368.     /* Code Body                                                      */
  369.     /*----------------------------------------------------------------*/
  370. #ifdef __MMI_UNIFIED_MESSAGE__
  371.     return (MENU_ID_UM_MAIN);
  372. #else 
  373.     return (MAIN_MENU_MESSAGES_MENUID);
  374. #endif 
  375. }
  376. /*****************************************************************************
  377.  * FUNCTION
  378.  *  mmi_jmms_highlight_memory_status
  379.  * DESCRIPTION
  380.  *  This function is the highlight handler of memory sttaus item
  381.  * PARAMETERS
  382.  *  void
  383.  * RETURNS
  384.  *  void
  385.  *****************************************************************************/
  386. void mmi_jmms_highlight_memory_status(void)
  387. {
  388.     /*----------------------------------------------------------------*/
  389.     /* Local Variables                                                */
  390.     /*----------------------------------------------------------------*/
  391.     /*----------------------------------------------------------------*/
  392.     /* Code Body                                                      */
  393.     /*----------------------------------------------------------------*/
  394.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  395.     SetLeftSoftkeyFunction(mmi_jmms_entry_memory_status, KEY_EVENT_UP);
  396.     SetKeyHandler(mmi_jmms_entry_memory_status, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  397.     SetKeyHandler(mmi_jmms_entry_memory_status, KEY_WAP, KEY_EVENT_DOWN);
  398. }
  399. /*****************************************************************************
  400.  * FUNCTION
  401.  *  mmi_jmms_entry_memory_status
  402.  * DESCRIPTION
  403.  *  
  404.  * PARAMETERS
  405.  *  void
  406.  * RETURNS
  407.  *  void
  408.  *****************************************************************************/
  409. void mmi_jmms_entry_memory_status(void)
  410. {
  411.     /*----------------------------------------------------------------*/
  412.     /* Local Variables                                                */
  413.     /*----------------------------------------------------------------*/
  414.     /* PMT VIKAS START 20060325 */
  415.     U8 *guiBuffer;
  416.     S8 tempBuf[20];
  417.     S8 tempBufUnicode[20 * ENCODING_LENGTH];
  418.     S8 spaceBuf[20];
  419.     U8 messageStatusTotal;
  420.     U8 messageStatusUsed;
  421.     int used_space = 0;
  422.     U32 free_space;
  423.     U32 size;
  424.     S32 size_kb;
  425.     S32 size_bytes;
  426.     JDD_FSHANDLE fs_handle;
  427.     JC_CHAR *content_fname = NULL;
  428.     STORAGE_CTX *pStorageHandle = NULL;
  429.     /* /manish incraesing size by 6(100 to 106) bytes as chnaging "Free" by "Free Space" */
  430.     S8 memoryStatus[106 * ENCODING_LENGTH];
  431.     U64 disk_free_space;
  432.     JC_RETCODE eRet = JC_OK;
  433.     /*----------------------------------------------------------------*/
  434.     /* Code Body                                                      */
  435.     /*----------------------------------------------------------------*/
  436.     EntryNewScreen(SCR_ID_JMMS_MMS_MESSAGE_STATUS, NULL, mmi_jmms_entry_memory_status, NULL);
  437.     messageStatusTotal = MAX_POSSIBLE_MESSAGES;
  438.     eRet = mmi_jmms_get_total_number_of_messages(&messageStatusUsed);
  439.     if (eRet != JC_OK)
  440.     {
  441.         DisplayPopup((U8*) GetString(STR_GLOBAL_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, (U8) ERROR_TONE);
  442.         return;
  443.     }
  444.     //    memset(spaceBuf, 0, 20);
  445.     //    AnsiiToUnicodeString(spaceBuf, "n");
  446.     //    pfnUnicodeStrcpy(memoryStatus, spaceBuf);
  447.     pfnUnicodeStrcpy(memoryStatus, (S8*) GetString(STR_ID_JMMS_SETTINGS_MESSAGE_STATUS_TOTAL));
  448.     memset(spaceBuf, 0, 20);
  449.     AnsiiToUnicodeString(spaceBuf, ": ");
  450.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  451.     memset(spaceBuf, 0, 20);
  452.     sprintf(tempBuf, "%d/%d", messageStatusUsed, messageStatusTotal);
  453.     AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  454.     pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  455.     AnsiiToUnicodeString(spaceBuf, "n");
  456.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  457.     pStorageHandle = (STORAGE_CTX*) g_jmms_context->hStoreHandle;
  458.     if ((jdd_FSInitialize(&fs_handle)) == JC_OK)
  459.     {
  460.         content_fname = (JC_CHAR*) jdd_FSFileNameTranslate(fs_handle, (JC_CHAR*) pStorageHandle->pRootPath);
  461.         jdd_FSDeinitialize(fs_handle);
  462.     }
  463.     if (content_fname != NULL)
  464.     {
  465.         used_space = FS_GetFolderSize(content_fname, FS_COUNT_IN_BYTE, NULL, 0);
  466.         jdd_MemFree(content_fname);
  467.         if (used_space < 0)
  468.         {
  469.             used_space = 0;
  470.         }
  471.     }
  472.     pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_ID_JMMS_SETTINGS_MESSAGE_STATUS_USAGE));
  473.     memset(spaceBuf, 0, 20);
  474.     AnsiiToUnicodeString(spaceBuf, ": ");
  475.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  476.     memset(spaceBuf, 0, 20);
  477.     /* Added a New line after "Used Space:" */
  478.     AnsiiToUnicodeString(spaceBuf, "n");
  479.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  480.     memset(spaceBuf, 0, 20);
  481.     memset(tempBuf, 0, 20);
  482.     memset(tempBufUnicode, 0, 20 * ENCODING_LENGTH);
  483.     size = used_space;
  484.     size_kb = size / 1024;
  485.     size_bytes = size % 1024;
  486.     if (size_kb >= 1)
  487.     {
  488.         if (size_bytes > 512)
  489.         {
  490.             size_kb++;
  491.         }
  492.         sprintf(tempBuf, "%d ", size_kb);
  493.         AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  494.         pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  495.         pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_ID_JMMS_KB));
  496.     }
  497.     else
  498.     {
  499.         sprintf(tempBuf, "%d ", size);
  500.         AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  501.         pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  502.         pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_ID_JMMS_BYTES));
  503.     }
  504.     disk_free_space = jdd_FSGetMMSFolderFreeSpace();
  505.     /* mmi_jmms_get_free_size_for_mms(&disk_free_space); */
  506.     AnsiiToUnicodeString(spaceBuf, "n");
  507.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  508.     pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_ID_SETTINGS_FREE_SPACE));
  509.     memset(spaceBuf, 0, 20);
  510.     AnsiiToUnicodeString(spaceBuf, ": ");
  511.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  512.     memset(spaceBuf, 0, 20);
  513.     /* Added a New line after "Free Space:" */
  514.     AnsiiToUnicodeString(spaceBuf, "n");
  515.     pfnUnicodeStrcat(memoryStatus, spaceBuf);
  516.     memset(spaceBuf, 0, 20);
  517.     memset(tempBuf, 0, 20);
  518.     memset(tempBufUnicode, 0, 20 * ENCODING_LENGTH);
  519.     free_space = disk_free_space;
  520.     size = free_space;
  521.     size_kb = size / 1024;
  522.     size_bytes = size % 1024;
  523.     if (size_kb >= 1)
  524.     {
  525.         if (size_bytes > 512)
  526.         {
  527.             size_kb++;
  528.         }
  529.         sprintf(tempBuf, "%d ", size_kb);
  530.         AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  531.         pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  532.         pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_ID_JMMS_KB));
  533.     }
  534.     else
  535.     {
  536.         sprintf(tempBuf, "%d ", size);
  537.         AnsiiToUnicodeString(tempBufUnicode, tempBuf);
  538.         pfnUnicodeStrcat(memoryStatus, tempBufUnicode);
  539.         pfnUnicodeStrcat(memoryStatus, (S8*) GetString(STR_ID_JMMS_BYTES));
  540.     }
  541.     memset(spaceBuf, 0, 20);
  542.     memset(tempBuf, 0, 20);
  543.     memset(tempBufUnicode, 0, 20 * ENCODING_LENGTH);
  544.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_MMS_MESSAGE_STATUS);
  545.     if ((guiBuffer != NULL) || (g_msg_cntx.MessagesScrnIdDelUptoHistoryNodes == SCR_ID_JMMS_MMS_MESSAGE_STATUS))
  546.     {
  547.         DeleteNScrId(SCR_ID_JMMS_MMS_MESSAGE_STATUS);
  548.     }
  549.     SetMessagesCurrScrnID(SCR_ID_JMMS_MMS_MESSAGE_STATUS);
  550.     SetMessagesScrnIdToDelHistoryNodes(SCR_ID_JMMS_MMS_MESSAGE_STATUS);
  551.     ShowCategory7Screen(
  552.         STR_ID_MESSAGE_SETTINGS_MEMORY_STATUS,
  553.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  554.         0,
  555.         0,
  556.         STR_GLOBAL_BACK,
  557.         IMG_GLOBAL_BACK,
  558.         (PU8) memoryStatus,
  559.         guiBuffer);
  560.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  561.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  562.     /* PMT VIKAS END 20060325 */
  563. }
  564. /*****************************************************************************
  565.  * FUNCTION
  566.  *  mmi_jmms_pre_entry_compose_settings
  567.  * DESCRIPTION
  568.  *  this is pre entry fn for compose settings. Init the inline items for compose settings
  569.  * PARAMETERS
  570.  *  void
  571.  * RETURNS
  572.  *  void
  573.  *****************************************************************************/
  574. void mmi_jmms_pre_entry_compose_settings(void)
  575. {
  576.     /*----------------------------------------------------------------*/
  577.     /* Local Variables                                                */
  578.     /*----------------------------------------------------------------*/
  579.     S32 temp_max_no_pages = g_jmms_context->nvram_compose_settings.max_no_pages;
  580.     /*----------------------------------------------------------------*/
  581.     /* Code Body                                                      */
  582.     /*----------------------------------------------------------------*/
  583.     gui_itoa(
  584.         (S32) g_jmms_context->nvram_compose_settings.default_slide_time,
  585.         (UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer,
  586.         10);
  587. #ifdef __DRM_SUPPORT__
  588.     g_jmms_context->jmms_inline_items.compose_items_list.add_drm = g_jmms_context->nvram_compose_settings.add_drm;
  589. #endif 
  590. //#ifdef __MMI_MMS_SIGNATURE__
  591.     g_jmms_context->jmms_inline_items.compose_items_list.auto_signature =
  592.         g_jmms_context->nvram_compose_settings.auto_signature;
  593. //#endif /* __MMI_MMS_SIGNATURE__ */ 
  594.     g_jmms_context->jmms_inline_items.compose_items_list.best_page_duration =
  595.         g_jmms_context->nvram_compose_settings.best_page_duration;
  596.     g_jmms_context->jmms_inline_items.compose_items_list.creation_mode =
  597.         g_jmms_context->nvram_compose_settings.creation_mode;
  598.     /* HIMANSHU 05122006 START */
  599. #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  600.     g_jmms_context->jmms_inline_items.compose_items_list.image_resize_option =
  601.         g_jmms_context->nvram_compose_settings.image_resize_option;
  602. #endif /* __MMI_MMS_MEGA_PIXEL_SUPPORT__ */ 
  603.     /* HIMANSHU 05122006 END */
  604.     g_jmms_context->jmms_inline_items.compose_items_list.layout = g_jmms_context->nvram_compose_settings.layout;
  605.     gui_itoa(
  606.         temp_max_no_pages,
  607.         (UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer,
  608.         10);
  609.     mmi_jmms_entry_compose_settings();
  610. }
  611. /*****************************************************************************
  612.  * FUNCTION
  613.  *  mmi_jmms_entry_compose_settings
  614.  * DESCRIPTION
  615.  *  This is entry fn for compose settings
  616.  * PARAMETERS
  617.  *  void
  618.  * RETURNS
  619.  *  void
  620.  *****************************************************************************/
  621. void mmi_jmms_entry_compose_settings(void)
  622. {
  623.     /*----------------------------------------------------------------*/
  624.     /* Local Variables                                                */
  625.     /*----------------------------------------------------------------*/
  626.     U8 *guiBuffer;
  627.     U8 *inputBuffer;        /* added for inline edit history */
  628.     U16 inputBufferSize;    /* added for inline edit history */
  629.     U16 image_list[COMPOSE_INLINE_TOTAL] = {0};
  630.     U8 count = 0;
  631.     /*----------------------------------------------------------------*/
  632.     /* Code Body                                                      */
  633.     /*----------------------------------------------------------------*/
  634.     EntryNewScreen(SCR_ID_JMMS_COMPOSE_SETTINGS, mmi_jmms_exit_compose_settings, NULL, NULL);
  635.     set_leading_zero(FALSE);
  636.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_COMPOSE_SETTINGS);
  637.     InitializeCategory57Screen();
  638.     mmi_jmms_compose_fill_inline_struct();
  639.     /* RegisterHighlightHandler(ExecuteCurrHiliteHandler); */
  640.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_COMPOSE_SETTINGS);
  641.     inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_COMPOSE_SETTINGS, &inputBufferSize);  /* added for inline edit history */
  642.     if (inputBuffer)    /* added for inline edit history */
  643.     {
  644.         SetCategory57Data(wgui_inline_items, COMPOSE_INLINE_TOTAL, inputBuffer);        /* sets the data */
  645.     }
  646.     image_list[E_COMPOSE_DEFAULT_SLIDE_TIME_CAPTION] = gIndexIconsImageList[count];
  647.     image_list[E_COMPOSE_LAYOUT_CAPTION] = gIndexIconsImageList[++count];
  648. #ifdef __DRM_SUPPORT__
  649.     image_list[E_COMPOSE_ADD_DRM_CAPTION] = gIndexIconsImageList[++count];
  650. #endif 
  651.     image_list[E_COMPOSE_CREATION_MODES_CAPTION] = gIndexIconsImageList[++count];
  652. #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  653.     image_list[E_COMPOSE_IMAGE_RESIZE_CAPTION] = gIndexIconsImageList[++count];
  654. #endif /* #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__ */
  655.     image_list[E_COMPOSE_MAX_NO_PAGES_CAPTION] = gIndexIconsImageList[++count];
  656.     image_list[E_COMPOSE_BEST_PAGE_DURATION_CAPTION] = gIndexIconsImageList[++count];
  657. //#ifdef __MMI_MMS_SIGNATURE__
  658.     image_list[E_COMPOSE_AUTO_SIGNATURE_CAPTION] = gIndexIconsImageList[++count];
  659.     image_list[E_COMPOSE_AUTO_SIGNATURE_CONTENT] = IMG_ID_JMMS_WRITE_MESSAGE;
  660. //#endif /* __MMI_MMS_SIGNATURE__ */ 
  661.     ShowCategory57Screen(
  662.         STR_ID_MESSAGE_SETTINGS_COMPOSE,
  663.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  664.         NULL,
  665.         NULL,
  666.         STR_GLOBAL_BACK,
  667.         IMG_GLOBAL_BACK,
  668.         COMPOSE_INLINE_TOTAL,
  669.         image_list,
  670.         wgui_inline_items,
  671.         0,
  672.         guiBuffer);
  673.     SetCategory57RightSoftkeyFunctions(mmi_jmms_confirm_save_compose_settings, GoBackHistory);
  674. if (isInCall() == FALSE)
  675. SetKeyHandler(mmi_jmms_read_back_auto_sign_content, KEY_END, KEY_EVENT_DOWN);
  676. }
  677. /*****************************************************************************
  678.  * FUNCTION
  679.  *  mmi_jmms_confirm_save_compose_settings
  680.  * DESCRIPTION
  681.  *  It checks for default slide time value and auto sign (on/Off). If deafult slide time
  682.  *  input 0 then error pop up. If auto sign is on buyt content is empty then also error pop up.
  683.  *  If more than 20 slide then also error pop up.Otherwise  ask confirmation to save compose settings
  684.  * PARAMETERS
  685.  *  void
  686.  * RETURNS
  687.  *  void
  688.  *****************************************************************************/
  689. void mmi_jmms_confirm_save_compose_settings(void)
  690. {
  691.     /*----------------------------------------------------------------*/
  692.     /* Local Variables                                                */
  693.     /*----------------------------------------------------------------*/
  694.     U32 temp;
  695.     /*----------------------------------------------------------------*/
  696.     /* Code Body                                                      */
  697.     /*----------------------------------------------------------------*/
  698.     temp = gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer);
  699.     //PMT VIKAS START 20060325
  700.     //For empty value of slide time and no of slide field.  
  701.     if (pfnUnicodeStrncmp
  702.         ((S8*) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer, "",
  703.          1 * ENCODING_LENGTH) == 0)
  704.     {
  705.         DisplayPopup((U8*) GetString(STR_ID_MAX_PAGES_LIMIT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  706.     }
  707.     else if (pfnUnicodeStrncmp
  708.              ((S8*) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer, "",
  709.               1 * ENCODING_LENGTH) == 0)
  710.     {
  711.         DisplayPopup((U8*) GetString(STR_ID_SLIDE_TIME_ZERO_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  712.     }
  713.     else if (temp > MAX_POSSIBLE_SLIDES)
  714.         /* PMT VIKAS END 20060325 */
  715.     {
  716.         DisplayPopup((U8*) GetString(STR_ID_MAX_PAGES_LIMIT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  717.     }
  718.     /* dilip 26 aug 2006 to prevent user from setting max page less than 1 */
  719.     else if (temp < 1)
  720.         /* PMT VIKAS END 20060325 */
  721.     {
  722.         DisplayPopup((U8*) GetString(STR_ID_MAX_PAGES_LIMIT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  723.     }
  724. //#ifdef __MMI_MMS_SIGNATURE__
  725.     else if ((g_jmms_context->jmms_inline_items.compose_items_list.auto_signature == E_ON)
  726.              &&
  727.              (pfnUnicodeStrncmp
  728.               ((S8*) g_jmms_context->nvram_compose_settings.auto_signature_content, "",
  729.                MAX_AUTO_SIGN_LENGTH * ENCODING_LENGTH) == 0))
  730.     {
  731.         DisplayPopup((U8*) GetString(STR_ID_AUTO_SIGN_ERROR), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  732.     }
  733. //#endif /* __MMI_MMS_SIGNATURE__ */ 
  734.     else
  735.     {
  736.         DisplayConfirm(
  737.             STR_GLOBAL_YES,
  738.             IMG_GLOBAL_YES,
  739.             STR_GLOBAL_NO,
  740.             IMG_GLOBAL_NO,
  741.             get_string(STR_GLOBAL_SAVE),
  742.             IMG_GLOBAL_QUESTION,
  743.             WARNING_TONE);
  744.         SetLeftSoftkeyFunction(mmi_jmms_save_compose_settings, KEY_EVENT_UP);
  745.         SetRightSoftkeyFunction(mmi_jmms_exit_confirm_screen, KEY_EVENT_UP);
  746. if (isInCall() == FALSE)
  747. SetKeyHandler(mmi_jmms_read_back_auto_sign_content, KEY_END, KEY_EVENT_DOWN);
  748.     }
  749. }
  750. /*****************************************************************************
  751.  * FUNCTION
  752.  *  mmi_jmms_exit_confirm_screen
  753.  * DESCRIPTION
  754.  *  exit from the confirmation screen
  755.  * PARAMETERS
  756.  *  void
  757.  * RETURNS
  758.  *  void
  759.  *****************************************************************************/
  760. void mmi_jmms_exit_confirm_screen(void)
  761. {
  762.     /*----------------------------------------------------------------*/
  763.     /* Local Variables                                                */
  764.     /*----------------------------------------------------------------*/
  765.     S16 error;
  766.     /*----------------------------------------------------------------*/
  767.     /* Code Body                                                      */
  768.     /*----------------------------------------------------------------*/
  769.     ///read back the auto sign content.Required because we are using the original auto sign buffer for input
  770.     ///the auto sign content
  771.     ReadRecord(
  772.         NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  773.         1,
  774.         &g_jmms_context->nvram_compose_settings,
  775.         NVRAM_JMMS_COMPOSE_SETTINGS_SIZE /* NVRAM_JMMS_COMPOSE_SETTINGS_SIZE */ ,
  776.         &error);
  777.     GoBacknHistory(1);
  778. }
  779. /*****************************************************************************
  780.  * FUNCTION
  781.  *  mmi_jmms_save_compose_settings
  782.  * DESCRIPTION
  783.  *  write the compose settings to nvram
  784.  * PARAMETERS
  785.  *  void
  786.  * RETURNS
  787.  *  void
  788.  *****************************************************************************/
  789. void mmi_jmms_save_compose_settings(void)
  790. {
  791.     /*----------------------------------------------------------------*/
  792.     /* Local Variables                                                */
  793.     /*----------------------------------------------------------------*/
  794.     S16 temp_max_no_pages, error;
  795.     /*----------------------------------------------------------------*/
  796.     /* Code Body                                                      */
  797.     /*----------------------------------------------------------------*/
  798.     /* /write global struct into values into NVRAM */
  799.     temp_max_no_pages = gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer);
  800.     g_jmms_context->nvram_compose_settings.default_slide_time =
  801.         (U32) gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer);
  802. //#ifdef __MMI_MMS_SIGNATURE__
  803.     g_jmms_context->nvram_compose_settings.auto_signature =
  804.         g_jmms_context->jmms_inline_items.compose_items_list.auto_signature;
  805. //#endif /* __MMI_MMS_SIGNATURE__ */ 
  806.     g_jmms_context->nvram_compose_settings.best_page_duration =
  807.         g_jmms_context->jmms_inline_items.compose_items_list.best_page_duration;
  808.     g_jmms_context->nvram_compose_settings.creation_mode =
  809.         g_jmms_context->jmms_inline_items.compose_items_list.creation_mode;
  810.     /* HIMANSHU 05122006 START */
  811. #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  812.     g_jmms_context->nvram_compose_settings.image_resize_option =
  813.         g_jmms_context->jmms_inline_items.compose_items_list.image_resize_option;
  814. #endif /* __MMI_MMS_MEGA_PIXEL_SUPPORT__ */ 
  815.     /* HIMANSHU 05122006 END */
  816. #ifdef __DRM_SUPPORT__
  817.     g_jmms_context->nvram_compose_settings.add_drm = g_jmms_context->jmms_inline_items.compose_items_list.add_drm;
  818. #endif 
  819.     g_jmms_context->nvram_compose_settings.layout = g_jmms_context->jmms_inline_items.compose_items_list.layout;
  820.     g_jmms_context->nvram_compose_settings.max_no_pages = (U8) temp_max_no_pages;
  821.     WriteRecord(
  822.         NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  823.         1,
  824.         &g_jmms_context->nvram_compose_settings,
  825.         NVRAM_JMMS_COMPOSE_SETTINGS_SIZE,
  826.         &error);
  827.     DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
  828.     DeleteUptoScrID(SCR_ID_JMMS_MESSAGE_SETTINGS);
  829. }
  830. /*****************************************************************************
  831.  * FUNCTION
  832.  *  mmi_jmms_read_back_auto_sign_content
  833.  * DESCRIPTION
  834.  *  Read the Compose setting from NVRAm for the auto sign content
  835.  *  Read back is required because we are using the original auto sign buffer for input
  836.  *  the auto sign content
  837.  * PARAMETERS
  838.  *  void
  839.  * RETURNS
  840.  *  void
  841.  *****************************************************************************/
  842. void mmi_jmms_read_back_auto_sign_content(void)
  843. {
  844.     /*----------------------------------------------------------------*/
  845.     /* Local Variables                                                */
  846.     /*----------------------------------------------------------------*/
  847.     S16 error;
  848.     /*----------------------------------------------------------------*/
  849.     /* Code Body                                                      */
  850.     /*----------------------------------------------------------------*/
  851.     ReadRecord(
  852.         NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  853.         1,
  854.         &g_jmms_context->nvram_compose_settings,
  855.         NVRAM_JMMS_COMPOSE_SETTINGS_SIZE /* NVRAM_JMMS_COMPOSE_SETTINGS_SIZE */ ,
  856.         &error);
  857.     DisplayIdleScreen();
  858. }
  859. /*****************************************************************************
  860.  * FUNCTION
  861.  *  mmi_jmms_compose_inline_custom_func
  862.  * DESCRIPTION
  863.  *  custom fn for Auto sign Full screen editor
  864.  * PARAMETERS
  865.  *  void
  866.  * RETURNS
  867.  *  void
  868.  *****************************************************************************/
  869. void mmi_jmms_compose_inline_custom_func(void)
  870. {
  871.     /*----------------------------------------------------------------*/
  872.     /* Local Variables                                                */
  873.     /*----------------------------------------------------------------*/
  874.     /*----------------------------------------------------------------*/
  875.     /* Code Body                                                      */
  876.     /*----------------------------------------------------------------*/
  877.     ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  878.     SetLeftSoftkeyFunction(EntryScrForInputMethodAndDone, KEY_EVENT_UP);
  879.     SetInputMethodAndDoneCaptionIcon(GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID));
  880. if (isInCall() == FALSE)
  881.         SetKeyHandler(mmi_jmms_read_back_auto_sign_content, KEY_END, KEY_EVENT_DOWN);
  882. }
  883. /*****************************************************************************
  884.  * FUNCTION
  885.  *  mmi_jmms_compose_fill_inline_struct
  886.  * DESCRIPTION
  887.  *  Fills the inline items for compose settings screen
  888.  * PARAMETERS
  889.  *  void
  890.  * RETURNS
  891.  *  void
  892.  *****************************************************************************/
  893. void mmi_jmms_compose_fill_inline_struct(void)
  894. {
  895.     /*----------------------------------------------------------------*/
  896.     /* Local Variables                                                */
  897.     /*----------------------------------------------------------------*/
  898.     /*----------------------------------------------------------------*/
  899.     /* Code Body                                                      */
  900.     /*----------------------------------------------------------------*/
  901.     if (g_jmms_context->jmms_inline_lists == NULL)
  902.     {
  903.         g_jmms_context->jmms_inline_lists =
  904.             (jmms_common_inline_lists_struct*) jdd_MemAlloc(sizeof(jmms_common_inline_lists_struct), 1);
  905.         if (g_jmms_context->jmms_inline_lists == NULL)
  906.         {
  907.             DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  908.             return;
  909.         }
  910.     }
  911.     g_jmms_context->jmms_inline_items.compose_items_list.layout_list[0] = GetString(STR_ID_SETTINGS_POTRAIT);
  912.     g_jmms_context->jmms_inline_items.compose_items_list.layout_list[1] = GetString(STR_ID_SETTINGS_LANDSCAPE);
  913.     g_jmms_context->jmms_inline_lists->on_off_list[0] = GetString(STR_ID_SETTINGS_OFF);
  914.     g_jmms_context->jmms_inline_lists->on_off_list[1] = GetString(STR_ID_SETTINGS_ON);
  915.     g_jmms_context->jmms_inline_items.compose_items_list.creation_modes_list[0] = GetString(STR_ID_SETTINGS_RESTRICTED);
  916.     g_jmms_context->jmms_inline_items.compose_items_list.creation_modes_list[1] = GetString(STR_ID_SETTINGS_WARNING);
  917.     g_jmms_context->jmms_inline_items.compose_items_list.creation_modes_list[2] = GetString(STR_ID_SETTINGS_FREE);
  918.     /* HIMANSHU 05122006 START */
  919. #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  920.     g_jmms_context->jmms_inline_items.compose_items_list.image_resize_list[0] = GetString(STR_ID_SETTINGS_OFF);
  921.     g_jmms_context->jmms_inline_items.compose_items_list.image_resize_list[1] = GetString(STR_ID_SETTINGS_160_X_120);
  922.     g_jmms_context->jmms_inline_items.compose_items_list.image_resize_list[2] = GetString(STR_ID_SETTINGS_320_X_240);
  923.     g_jmms_context->jmms_inline_items.compose_items_list.image_resize_list[3] = GetString(STR_ID_SETTINGS_640_X_480);
  924. #endif /* __MMI_MMS_MEGA_PIXEL_SUPPORT__ */ 
  925.     /* HIMANSHU 05122006 END */
  926.     SetInlineItemActivation(
  927.         &wgui_inline_items[E_COMPOSE_DEFAULT_SLIDE_TIME_CAPTION],
  928.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  929.         0);
  930.     SetInlineItemCaption(
  931.         &wgui_inline_items[E_COMPOSE_DEFAULT_SLIDE_TIME_CAPTION],
  932.         (U8*) GetString(STR_ID_SETTINGS_DEFAULT_SLIDE_TIMING));
  933.     SetInlineItemActivation(
  934.         &wgui_inline_items[E_COMPOSE_DEFAULT_SLIDE_TIME],
  935.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  936.         0);
  937.     SetInlineItemTextEdit(
  938.         &wgui_inline_items[E_COMPOSE_DEFAULT_SLIDE_TIME],
  939.         (U8*) g_jmms_context->jmms_inline_items.compose_items_list.defualt_slide_time_buffer,
  940.         (MAX_DEFAULT_SLIDE_TIME_INPUT + 1),
  941.         INPUT_TYPE_NUMERIC);
  942.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_LAYOUT_CAPTION], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  943.     SetInlineItemCaption(&wgui_inline_items[E_COMPOSE_LAYOUT_CAPTION], (U8*) GetString(STR_ID_SETTINGS_LAYOUT));
  944.     SetInlineItemSelect(
  945.         &wgui_inline_items[E_COMPOSE_LAYOUT],
  946.         2,
  947.         (U8 **) g_jmms_context->jmms_inline_items.compose_items_list.layout_list,
  948.         &g_jmms_context->jmms_inline_items.compose_items_list.layout);
  949.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_LAYOUT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  950. #ifdef __DRM_SUPPORT__
  951.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_ADD_DRM_CAPTION], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  952.     SetInlineItemCaption(&wgui_inline_items[E_COMPOSE_ADD_DRM_CAPTION], (U8*) GetString(STR_ID_SETTINGS_ADD_DRM));
  953.     SetInlineItemSelect(
  954.         &wgui_inline_items[E_COMPOSE_ADD_DRM],
  955.         2,
  956.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  957.         &g_jmms_context->jmms_inline_items.compose_items_list.add_drm);
  958.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_ADD_DRM], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  959. #endif /* __DRM_SUPPORT__ */ 
  960.     SetInlineItemActivation(
  961.         &wgui_inline_items[E_COMPOSE_CREATION_MODES_CAPTION],
  962.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  963.         0);
  964.     SetInlineItemCaption(
  965.         &wgui_inline_items[E_COMPOSE_CREATION_MODES_CAPTION],
  966.         (U8*) GetString(STR_ID_SETTINGS_CREATION_MODES));
  967.     SetInlineItemSelect(
  968.         &wgui_inline_items[E_COMPOSE_CREATION_MODES],
  969.         3,
  970.         (U8 **) g_jmms_context->jmms_inline_items.compose_items_list.creation_modes_list,
  971.         &g_jmms_context->jmms_inline_items.compose_items_list.creation_mode);
  972.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_CREATION_MODES], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  973. #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  974.     /* PMT Umesh START - Added for Image resizing */
  975.     SetInlineItemActivation(
  976.         &wgui_inline_items[E_COMPOSE_IMAGE_RESIZE_CAPTION],
  977.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  978.         0);
  979.     SetInlineItemCaption(
  980.         &wgui_inline_items[E_COMPOSE_IMAGE_RESIZE_CAPTION],
  981.         (U8*) GetString(STR_ID_SETTINGS_IMAGE_RESIZE));
  982.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_IMAGE_RESIZING], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  983.     SetInlineItemSelect(
  984.         &wgui_inline_items[E_COMPOSE_IMAGE_RESIZING],
  985.         4,
  986.         (U8 **) g_jmms_context->jmms_inline_items.compose_items_list.image_resize_list,
  987.         &g_jmms_context->jmms_inline_items.compose_items_list.image_resize_option);
  988.     /* PMT Umesh END - Added for Image resizing */
  989. #endif /* __MMI_MMS_MEGA_PIXEL_SUPPORT__ */ 
  990.     SetInlineItemActivation(
  991.         &wgui_inline_items[E_COMPOSE_MAX_NO_PAGES_CAPTION],
  992.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  993.         0);
  994.     SetInlineItemCaption(
  995.         &wgui_inline_items[E_COMPOSE_MAX_NO_PAGES_CAPTION],
  996.         (U8*) GetString(STR_ID_SETTINGS_MAX_NUM_PAGES));
  997.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_MAX_NO_PAGES], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  998.     SetInlineItemTextEdit(
  999.         &wgui_inline_items[E_COMPOSE_MAX_NO_PAGES],
  1000.         (U8*) g_jmms_context->jmms_inline_items.compose_items_list.max_num_pages_buffer,
  1001.         (MAX_NO_PAGES_INPUT + 1),
  1002.         INPUT_TYPE_NUMERIC);
  1003.     SetInlineItemActivation(
  1004.         &wgui_inline_items[E_COMPOSE_BEST_PAGE_DURATION_CAPTION],
  1005.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1006.         0);
  1007.     SetInlineItemCaption(
  1008.         &wgui_inline_items[E_COMPOSE_BEST_PAGE_DURATION_CAPTION],
  1009.         (U8*) GetString(STR_ID_SETTINGS_BEST_PAGE_DURATION));
  1010.     SetInlineItemSelect(
  1011.         &wgui_inline_items[E_COMPOSE_BEST_PAGE_DURATION],
  1012.         2,
  1013.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1014.         &g_jmms_context->jmms_inline_items.compose_items_list.best_page_duration);
  1015.     SetInlineItemActivation(
  1016.         &wgui_inline_items[E_COMPOSE_BEST_PAGE_DURATION],
  1017.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1018.         0);
  1019. //#ifdef __MMI_MMS_SIGNATURE__
  1020.     SetInlineItemActivation(
  1021.         &wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE_CAPTION],
  1022.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1023.         0);
  1024.     SetInlineItemCaption(
  1025.         &wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE_CAPTION],
  1026.         (U8*) GetString(STR_ID_SETTINGS_AUTO_SIGNATURE));
  1027.     SetInlineItemSelect(
  1028.         &wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE],
  1029.         2,
  1030.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1031.         &g_jmms_context->jmms_inline_items.compose_items_list.auto_signature);
  1032.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1033.     SetInlineItemActivation(&wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE_CONTENT], KEY_LSK, KEY_EVENT_UP);
  1034.     SetInlineItemFullScreenEdit(
  1035.         &wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE_CONTENT],
  1036.         STR_ID_SETTINGS_EDIT_CONTENT,
  1037.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1038.         (PU8) g_jmms_context->nvram_compose_settings.auto_signature_content,
  1039.         MAX_AUTO_SIGN_LENGTH + 1,
  1040.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
  1041.     SetInlineFullScreenEditCustomFunction(
  1042.         &wgui_inline_items[E_COMPOSE_AUTO_SIGNATURE_CONTENT],
  1043.         mmi_jmms_compose_inline_custom_func);
  1044. //#endif /* __MMI_MMS_SIGNATURE__ */ 
  1045. }
  1046. /*****************************************************************************
  1047.  * FUNCTION
  1048.  *  mmi_jmms_exit_compose_settings
  1049.  * DESCRIPTION
  1050.  *  Exit fn for compose settings screeen
  1051.  * PARAMETERS
  1052.  *  void
  1053.  * RETURNS
  1054.  *  void
  1055.  *****************************************************************************/
  1056. void mmi_jmms_exit_compose_settings(void)
  1057. {
  1058.     /*----------------------------------------------------------------*/
  1059.     /* Local Variables                                                */
  1060.     /*----------------------------------------------------------------*/
  1061.     history history_buff;
  1062.     U16 inputBufferSize;    /* added for inline edit history */
  1063.     S16 nhistory = 0;
  1064.     /*----------------------------------------------------------------*/
  1065.     /* Code Body                                                      */
  1066.     /*----------------------------------------------------------------*/
  1067.     set_leading_zero(TRUE);
  1068.     CloseCategory57Screen();
  1069.     history_buff.scrnID = SCR_ID_JMMS_COMPOSE_SETTINGS;
  1070.     history_buff.entryFuncPtr = mmi_jmms_entry_compose_settings;
  1071.     pfnUnicodeStrcpy((S8*) history_buff.inputBuffer, (S8*) & nhistory);
  1072.     GetCategory57History(history_buff.guiBuffer);
  1073.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  1074.     GetCategory57Data((U8*) history_buff.inputBuffer);  /* added for inline edit history */
  1075.     AddNHistory(history_buff, inputBufferSize);         /* added for inline edit history */
  1076.     if (g_jmms_context->jmms_inline_lists != NULL)
  1077.     {
  1078.         jdd_MemFree(g_jmms_context->jmms_inline_lists);
  1079.         g_jmms_context->jmms_inline_lists = NULL;
  1080.     }
  1081. }
  1082. /*****************************************************************************
  1083.  * FUNCTION
  1084.  *  mmi_jmms_pre_entry_sending_settings
  1085.  * DESCRIPTION
  1086.  *  pre entry fn for sending settings. Init the value of inline items for the screeen
  1087.  * PARAMETERS
  1088.  *  void
  1089.  * RETURNS
  1090.  *  void
  1091.  *****************************************************************************/
  1092. void mmi_jmms_pre_entry_sending_settings(void)
  1093. {
  1094.     /*----------------------------------------------------------------*/
  1095.     /* Local Variables                                                */
  1096.     /*----------------------------------------------------------------*/
  1097.     /*----------------------------------------------------------------*/
  1098.     /* Code Body                                                      */
  1099.     /*----------------------------------------------------------------*/
  1100.     gui_itoa(
  1101.         (S32) g_jmms_context->nvram_sending_settings.deadline_for_reply,
  1102.         (UI_string_type) g_jmms_context->jmms_inline_items.sending_items_list.deadline_for_reply_buffer,
  1103.         10);
  1104.     g_jmms_context->jmms_inline_items.sending_items_list.delivery_report =
  1105.         (S32) g_jmms_context->nvram_sending_settings.delivery_report;
  1106.     g_jmms_context->jmms_inline_items.sending_items_list.delivery_time =
  1107.         (S32) g_jmms_context->nvram_sending_settings.delivery_time;
  1108.     g_jmms_context->jmms_inline_items.sending_items_list.hide_sender =
  1109.         (S32) g_jmms_context->nvram_sending_settings.hide_sender;
  1110.     g_jmms_context->jmms_inline_items.sending_items_list.priority =
  1111.         (S32) g_jmms_context->nvram_sending_settings.priority;
  1112.     g_jmms_context->jmms_inline_items.sending_items_list.read_report =
  1113.         (S32) g_jmms_context->nvram_sending_settings.read_report;
  1114.     g_jmms_context->jmms_inline_items.sending_items_list.reply_charging =
  1115.         (S32) g_jmms_context->nvram_sending_settings.reply_charging;
  1116.     g_jmms_context->jmms_inline_items.sending_items_list.request_type =
  1117.         (S32) g_jmms_context->nvram_sending_settings.request_type;
  1118.     g_jmms_context->jmms_inline_items.sending_items_list.validity_period =
  1119.         (S32) g_jmms_context->nvram_sending_settings.validity_period;
  1120.     gui_itoa(
  1121.         (S32) g_jmms_context->nvram_sending_settings.size,
  1122.         (UI_string_type) g_jmms_context->jmms_inline_items.sending_items_list.reply_msg_size_buffer,
  1123.         10);
  1124.     mmi_jmms_check_sending_settings_control(0);
  1125. }
  1126. /*****************************************************************************
  1127.  * FUNCTION
  1128.  *  mmi_jmms_check_sending_settings_control
  1129.  * DESCRIPTION
  1130.  *  Pre entry fn for sending settings.It check from where the this screen will be opened i.e. from Send Options
  1131.  *  during writins MMS or from Message Settings itself
  1132.  * PARAMETERS
  1133.  *  control     [IN]        
  1134.  * RETURNS
  1135.  *  void
  1136.  *****************************************************************************/
  1137. void mmi_jmms_check_sending_settings_control(U8 control)
  1138. {
  1139.     /*----------------------------------------------------------------*/
  1140.     /* Local Variables                                                */
  1141.     /*----------------------------------------------------------------*/
  1142.     /*----------------------------------------------------------------*/
  1143.     /* Code Body                                                      */
  1144.     /*----------------------------------------------------------------*/
  1145.     if (control == 2)   /* /control from send options during writing mms */
  1146.     {
  1147.         g_jmms_control = E_ENTRY_FROM_WRITE_MMS;
  1148.     }
  1149.     else
  1150.     {
  1151.         g_jmms_control = E_ENTRY_FROM_MMS_SETTINGS;
  1152.     }
  1153.     g_reply_charging_done = 0;
  1154.     mmi_jmms_entry_sending_settings();
  1155. }
  1156. /*****************************************************************************
  1157.  * FUNCTION
  1158.  *  mmi_jmms_entry_sending_settings
  1159.  * DESCRIPTION
  1160.  *  Entry fn for sendin settings
  1161.  * PARAMETERS
  1162.  *  void
  1163.  * RETURNS
  1164.  *  void
  1165.  *****************************************************************************/
  1166. void mmi_jmms_entry_sending_settings(void)
  1167. {
  1168.     /*----------------------------------------------------------------*/
  1169.     /* Local Variables                                                */
  1170.     /*----------------------------------------------------------------*/
  1171.     U8 *guiBuffer;
  1172.     U8 *inputBuffer;        /* added for inline edit history */
  1173.     U16 inputBufferSize;    /* added for inline edit history */
  1174.     U16 image_list[SENDING_INLINE_TOTAL] = {0};
  1175.     U16 strid = STR_ID_MESSAGE_SETTINGS_SENDING;
  1176.     extern U8 global_mms_version;
  1177.     /*----------------------------------------------------------------*/
  1178.     /* Code Body                                                      */
  1179.     /*----------------------------------------------------------------*/
  1180.     EntryNewScreen(SCR_ID_JMMS_SENDING_SETTINGS, mmi_jmms_exit_sending_settings, NULL, NULL);
  1181.     set_leading_zero(FALSE);
  1182.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_SENDING_SETTINGS);
  1183.     InitializeCategory57Screen();
  1184.     mmi_jmms_sending_fill_inline_struct();
  1185.     RegisterHighlightHandler(mmi_jmms_sending_settings_highlight_hdlr);
  1186.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_SENDING_SETTINGS);
  1187.     inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_SENDING_SETTINGS, &inputBufferSize);  /* added for inline edit history */
  1188.     if (inputBuffer)    /* added for inline edit history */
  1189.     {
  1190.         SetCategory57Data(wgui_inline_items, SENDING_INLINE_TOTAL, inputBuffer);        /* sets the data */
  1191.     }
  1192.     if (global_mms_version > 1)
  1193.     {
  1194.         image_list[E_SENDING_VALIDITY_PERIOD_CAPTION] = gIndexIconsImageList[0];
  1195.         image_list[E_SENDING_DELIVERY_REPORT_CAPTION] = gIndexIconsImageList[1];
  1196.         image_list[E_SENDING_READ_REPORT_CAPTION] = gIndexIconsImageList[2];
  1197.         image_list[E_SENDING_PRIORITY_CAPTION] = gIndexIconsImageList[3];
  1198.         image_list[E_SENDING_DELIVERY_TIME_CAPTION] = gIndexIconsImageList[4];
  1199.         image_list[E_SENDING_REPLY_CHARGING_CAPTION] = gIndexIconsImageList[6];
  1200.         image_list[E_SENDING_HIDE_SENDER_CAPTION] = gIndexIconsImageList[5];
  1201.     }
  1202.     else
  1203.     {
  1204.         image_list[E_SENDING_VALIDITY_PERIOD_CAPTION] = gIndexIconsImageList[0];
  1205.         image_list[E_SENDING_DELIVERY_REPORT_CAPTION] = gIndexIconsImageList[1];
  1206.         image_list[E_SENDING_READ_REPORT_CAPTION] = gIndexIconsImageList[2];
  1207.         image_list[E_SENDING_PRIORITY_CAPTION] = gIndexIconsImageList[3];
  1208.         image_list[E_SENDING_DELIVERY_TIME_CAPTION] = gIndexIconsImageList[4];
  1209.         /* image_list[E_SENDING_REPLY_CHARGING_CAPTION] = gIndexIconsImageList[5]; */
  1210.         image_list[E_SENDING_HIDE_SENDER_CAPTION] = gIndexIconsImageList[5];
  1211.     }
  1212.     if (g_jmms_control == E_ENTRY_FROM_WRITE_MMS)
  1213.     {
  1214.         strid = STR_ID_JMMS_WRITE_MMS_SEND_OPTIONS;
  1215.     }
  1216.     if (global_mms_version > 1)
  1217.     {
  1218.         ShowCategory57Screen(
  1219.             strid,
  1220.             GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1221.             NULL,
  1222.             NULL,
  1223.             STR_GLOBAL_BACK,
  1224.             IMG_GLOBAL_BACK,
  1225.             SENDING_INLINE_TOTAL,
  1226.             image_list,
  1227.             wgui_inline_items,
  1228.             0,
  1229.             guiBuffer);
  1230.     }
  1231.     else
  1232.     {
  1233.         ShowCategory57Screen(
  1234.             strid,
  1235.             GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1236.             NULL,
  1237.             NULL,
  1238.             STR_GLOBAL_BACK,
  1239.             IMG_GLOBAL_BACK,
  1240.             SENDING_INLINE_TOTAL - 2,
  1241.             image_list,
  1242.             wgui_inline_items,
  1243.             0,
  1244.             guiBuffer);
  1245.     }
  1246.     SetCategory57RightSoftkeyFunctions(mmi_jmms_confirm_save_sending_settings, GoBackHistory);
  1247. /*    if (g_jmms_control == E_ENTRY_FROM_WRITE_MMS)
  1248.     {
  1249.         SetKeyHandler(mmi_jmms_free_addresses_list_on_end, KEY_END, KEY_EVENT_DOWN);
  1250.     }
  1251. */
  1252. }
  1253. /*****************************************************************************
  1254.  * FUNCTION
  1255.  *  mmi_jmms_confirm_save_sending_settings
  1256.  * DESCRIPTION
  1257.  *  Ask for the confirmation for saving sending settings
  1258.  * PARAMETERS
  1259.  *  void
  1260.  * RETURNS
  1261.  *  void
  1262.  *****************************************************************************/
  1263. void mmi_jmms_confirm_save_sending_settings(void)
  1264. {
  1265.     /*----------------------------------------------------------------*/
  1266.     /* Local Variables                                                */
  1267.     /*----------------------------------------------------------------*/
  1268.     /*----------------------------------------------------------------*/
  1269.     /* Code Body                                                      */
  1270.     /*----------------------------------------------------------------*/
  1271.     DisplayConfirm(
  1272.         STR_GLOBAL_YES,
  1273.         IMG_GLOBAL_YES,
  1274.         STR_GLOBAL_NO,
  1275.         IMG_GLOBAL_NO,
  1276.         get_string(STR_GLOBAL_SAVE),
  1277.         IMG_GLOBAL_QUESTION,
  1278.         WARNING_TONE);
  1279.     SetLeftSoftkeyFunction(mmi_jmms_save_sending_settings, KEY_EVENT_UP);
  1280.     SetRightSoftkeyFunction(mmi_jmms_exit_confirm_screen, KEY_EVENT_UP);
  1281. /*    if (g_jmms_control == E_ENTRY_FROM_WRITE_MMS)
  1282.     {
  1283.         SetKeyHandler(mmi_jmms_free_addresses_list_on_end, KEY_END, KEY_EVENT_DOWN);
  1284.     }
  1285.     */
  1286. }
  1287. /*****************************************************************************
  1288.  * FUNCTION
  1289.  *  mmi_jmms_save_sending_settings
  1290.  * DESCRIPTION
  1291.  *  save the send settings into NVRAM
  1292.  * PARAMETERS
  1293.  *  void
  1294.  * RETURNS
  1295.  *  void
  1296.  *****************************************************************************/
  1297. void mmi_jmms_save_sending_settings(void)
  1298. {
  1299.     /*----------------------------------------------------------------*/
  1300.     /* Local Variables                                                */
  1301.     /*----------------------------------------------------------------*/
  1302.     S16 error;
  1303.     /*----------------------------------------------------------------*/
  1304.     /* Code Body                                                      */
  1305.     /*----------------------------------------------------------------*/
  1306.     if (g_jmms_control == E_ENTRY_FROM_MMS_SETTINGS)
  1307.     {
  1308.         /* /write global struct into values into NVRAM */
  1309.         g_jmms_context->nvram_sending_settings.delivery_report =
  1310.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.delivery_report;
  1311.         g_jmms_context->nvram_sending_settings.delivery_time =
  1312.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.delivery_time;
  1313.         g_jmms_context->nvram_sending_settings.hide_sender =
  1314.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.hide_sender;
  1315.         g_jmms_context->nvram_sending_settings.priority =
  1316.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.priority;
  1317.         g_jmms_context->nvram_sending_settings.read_report =
  1318.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.read_report;
  1319.         g_jmms_context->nvram_sending_settings.reply_charging =
  1320.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.reply_charging;
  1321.         g_jmms_context->nvram_sending_settings.request_type =
  1322.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.request_type;
  1323.         g_jmms_context->nvram_sending_settings.validity_period =
  1324.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.validity_period;
  1325.         g_jmms_context->nvram_sending_settings.deadline_for_reply =
  1326.             (U32) gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.sending_items_list.
  1327.                            deadline_for_reply_buffer);
  1328.         g_jmms_context->nvram_sending_settings.size =
  1329.             (U32) gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.sending_items_list.reply_msg_size_buffer);
  1330.         WriteRecord(
  1331.             NVRAM_EF_JMMS_SENDING_SETTINGS_LID,
  1332.             1,
  1333.             &g_jmms_context->nvram_sending_settings,
  1334.             NVRAM_JMMS_SENDING_SETTINGS_SIZE,
  1335.             &error);
  1336.         DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
  1337.         DeleteUptoScrID(SCR_ID_JMMS_MESSAGE_SETTINGS);
  1338.     }
  1339.     else if (g_jmms_control == E_ENTRY_FROM_WRITE_MMS)
  1340.     {
  1341. /* MAUI_00227929 Start */
  1342. g_jmms_context->sending_settings.delivery_report =
  1343.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.delivery_report;
  1344.         g_jmms_context->sending_settings.delivery_time =
  1345.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.delivery_time;
  1346.         g_jmms_context->sending_settings.hide_sender =
  1347.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.hide_sender;
  1348.         g_jmms_context->sending_settings.priority =
  1349.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.priority;
  1350.         g_jmms_context->sending_settings.read_report =
  1351.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.read_report;
  1352.         g_jmms_context->sending_settings.reply_charging =
  1353.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.reply_charging;
  1354.         g_jmms_context->sending_settings.request_type =
  1355.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.request_type;
  1356.         g_jmms_context->sending_settings.validity_period =
  1357.             (U8) g_jmms_context->jmms_inline_items.sending_items_list.validity_period;
  1358.         /*g_jmms_context->sending_settings.deadline_for_reply_buffer =
  1359.             (U32) gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.sending_items_list.
  1360.                            deadline_for_reply_buffer);
  1361.         g_jmms_context->sending_settings.reply_msg_size_buffer =
  1362.             (U32) gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.sending_items_list.reply_msg_size_buffer);*/
  1363. strcpy((S8*)g_jmms_context->sending_settings.deadline_for_reply_buffer, 
  1364.             (S8*) g_jmms_context->jmms_inline_items.sending_items_list.deadline_for_reply_buffer);
  1365.              
  1366.         strcpy((S8*)g_jmms_context->sending_settings.reply_msg_size_buffer,
  1367.             (S8*) g_jmms_context->jmms_inline_items.sending_items_list.reply_msg_size_buffer);
  1368. /* MAUI_00227929 End */
  1369.         DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
  1370.         g_jmms_context->g_use_local_send_setings = 1;
  1371.         DeleteUptoScrID(SCR_ID_WRITE_MMS_DONE_OPTIONS);
  1372.     }
  1373. }
  1374. /*****************************************************************************
  1375.  * FUNCTION
  1376.  *  mmi_jmms_sending_fill_inline_struct
  1377.  * DESCRIPTION
  1378.  *  Fill the inline struct for send settings screeen
  1379.  * PARAMETERS
  1380.  *  void
  1381.  * RETURNS
  1382.  *  void
  1383.  *****************************************************************************/
  1384. void mmi_jmms_sending_fill_inline_struct(void)
  1385. {
  1386.     /*----------------------------------------------------------------*/
  1387.     /* Local Variables                                                */
  1388.     /*----------------------------------------------------------------*/
  1389.     /*----------------------------------------------------------------*/
  1390.     /* Code Body                                                      */
  1391.     /*----------------------------------------------------------------*/
  1392.     extern U8 global_mms_version;
  1393.     if (g_jmms_context->jmms_inline_lists == NULL)
  1394.     {
  1395.         g_jmms_context->jmms_inline_lists =
  1396.             (jmms_common_inline_lists_struct*) jdd_MemAlloc(sizeof(jmms_common_inline_lists_struct), 1);
  1397.         if (g_jmms_context->jmms_inline_lists == NULL)
  1398.         {
  1399.             DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  1400.             return;
  1401.         }
  1402.     }
  1403.     g_jmms_context->jmms_inline_items.sending_items_list.validity_period_list[0] = GetString(STR_ID_JMMS_MAXIMUM);
  1404.     g_jmms_context->jmms_inline_items.sending_items_list.validity_period_list[1] = GetString(STR_ID_SETTINGS_1_HR);
  1405.     g_jmms_context->jmms_inline_items.sending_items_list.validity_period_list[2] = GetString(STR_ID_SETTINGS_12_HRS);
  1406.     g_jmms_context->jmms_inline_items.sending_items_list.validity_period_list[3] = GetString(STR_ID_SETTINGS_1_DAY);
  1407.     g_jmms_context->jmms_inline_items.sending_items_list.validity_period_list[4] = GetString(STR_ID_SETTINGS_1_WEEK);
  1408.     g_jmms_context->jmms_inline_lists->on_off_list[0] = GetString(STR_ID_SETTINGS_OFF);
  1409.     g_jmms_context->jmms_inline_lists->on_off_list[1] = GetString(STR_ID_SETTINGS_ON);
  1410.     g_jmms_context->jmms_inline_items.sending_items_list.priority_list[0] = GetString(STR_ID_SETTINGS_LOW);
  1411.     g_jmms_context->jmms_inline_items.sending_items_list.priority_list[1] = GetString(STR_GLOBAL_NORMAL);
  1412.     g_jmms_context->jmms_inline_items.sending_items_list.priority_list[2] = GetString(STR_ID_SETTINGS_HIGH);
  1413.     g_jmms_context->jmms_inline_items.sending_items_list.delivery_time_list[0] = GetString(STR_ID_SETTINGS_IMMEDIATE);
  1414.     g_jmms_context->jmms_inline_items.sending_items_list.delivery_time_list[1] = GetString(STR_ID_SETTINGS_1_HR);
  1415.     g_jmms_context->jmms_inline_items.sending_items_list.delivery_time_list[2] = GetString(STR_ID_SETTINGS_12_HRS);
  1416.     g_jmms_context->jmms_inline_items.sending_items_list.delivery_time_list[3] = GetString(STR_ID_SETTINGS_24_HRS);
  1417.     SetInlineItemActivation(
  1418.         &wgui_inline_items[E_SENDING_VALIDITY_PERIOD_CAPTION],
  1419.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1420.         0);
  1421.     SetInlineItemCaption(
  1422.         &wgui_inline_items[E_SENDING_VALIDITY_PERIOD_CAPTION],
  1423.         (U8*) GetString(STR_ID_SETTINGS_VALIDITY_PERIOD));
  1424.     SetInlineItemSelect(
  1425.         &wgui_inline_items[E_SENDING_VALIDITY_PERIOD],
  1426.         5,
  1427.         (U8 **) g_jmms_context->jmms_inline_items.sending_items_list.validity_period_list,
  1428.         &g_jmms_context->jmms_inline_items.sending_items_list.validity_period);
  1429.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_VALIDITY_PERIOD], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1430.     SetInlineItemActivation(
  1431.         &wgui_inline_items[E_SENDING_DELIVERY_REPORT_CAPTION],
  1432.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1433.         0);
  1434.     SetInlineItemCaption(
  1435.         &wgui_inline_items[E_SENDING_DELIVERY_REPORT_CAPTION],
  1436.         (U8*) GetString(STR_ID_JMMS_DELIVERY_REPORT));
  1437.     SetInlineItemSelect(
  1438.         &wgui_inline_items[E_SENDING_DELIVERY_REPORT],
  1439.         2,
  1440.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1441.         &g_jmms_context->jmms_inline_items.sending_items_list.delivery_report);
  1442.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_DELIVERY_REPORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1443.     SetInlineItemActivation(
  1444.         &wgui_inline_items[E_SENDING_READ_REPORT_CAPTION],
  1445.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1446.         0);
  1447.     SetInlineItemCaption(
  1448.         &wgui_inline_items[E_SENDING_READ_REPORT_CAPTION],
  1449.         (U8*) GetString(STR_ID_SETTINGS_READ_REPORT));
  1450.     SetInlineItemSelect(
  1451.         &wgui_inline_items[E_SENDING_READ_REPORT],
  1452.         2,
  1453.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1454.         &g_jmms_context->jmms_inline_items.sending_items_list.read_report);
  1455.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_READ_REPORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1456.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_PRIORITY_CAPTION], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1457.     SetInlineItemCaption(&wgui_inline_items[E_SENDING_PRIORITY_CAPTION], (U8*) GetString(STR_ID_SETTINGS_PRIORITY));
  1458.     SetInlineItemSelect(
  1459.         &wgui_inline_items[E_SENDING_PRIORITY],
  1460.         3,
  1461.         (U8 **) g_jmms_context->jmms_inline_items.sending_items_list.priority_list,
  1462.         &g_jmms_context->jmms_inline_items.sending_items_list.priority);
  1463.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_PRIORITY], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1464.     SetInlineItemActivation(
  1465.         &wgui_inline_items[E_SENDING_DELIVERY_TIME_CAPTION],
  1466.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1467.         0);
  1468.     SetInlineItemCaption(
  1469.         &wgui_inline_items[E_SENDING_DELIVERY_TIME_CAPTION],
  1470.         (U8*) GetString(STR_ID_SETTINGS_DELIVERY_TIME));
  1471.     SetInlineItemSelect(
  1472.         &wgui_inline_items[E_SENDING_DELIVERY_TIME],
  1473.         4,
  1474.         (U8 **) g_jmms_context->jmms_inline_items.sending_items_list.delivery_time_list,
  1475.         &g_jmms_context->jmms_inline_items.sending_items_list.delivery_time);
  1476.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_DELIVERY_TIME], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1477.     SetInlineItemActivation(
  1478.         &wgui_inline_items[E_SENDING_HIDE_SENDER_CAPTION],
  1479.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1480.         0);
  1481.     SetInlineItemCaption(
  1482.         &wgui_inline_items[E_SENDING_HIDE_SENDER_CAPTION],
  1483.         (U8*) GetString(STR_ID_SETTINGS_HIDE_SENDER));
  1484.     SetInlineItemSelect(
  1485.         &wgui_inline_items[E_SENDING_HIDE_SENDER],
  1486.         2,
  1487.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1488.         &g_jmms_context->jmms_inline_items.sending_items_list.hide_sender);
  1489.     SetInlineItemActivation(&wgui_inline_items[E_SENDING_HIDE_SENDER], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1490.     if (global_mms_version > 1)
  1491.     {
  1492.         SetInlineItemActivation(
  1493.             &wgui_inline_items[E_SENDING_REPLY_CHARGING_CAPTION],
  1494.             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1495.             0);
  1496.         SetInlineItemCaption(
  1497.             &wgui_inline_items[E_SENDING_REPLY_CHARGING_CAPTION],
  1498.             (U8*) GetString(STR_ID_SETTINGS_REPLY_CHARGING));
  1499.         SetInlineItemSelect(
  1500.             &wgui_inline_items[E_SENDING_REPLY_CHARGING],
  1501.             2,
  1502.             (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1503.             &g_jmms_context->jmms_inline_items.sending_items_list.reply_charging);
  1504.         SetInlineItemActivation(
  1505.             &wgui_inline_items[E_SENDING_REPLY_CHARGING],
  1506.             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1507.             0);
  1508.         RegisterInlineSelectHighlightHandler(
  1509.             &wgui_inline_items[E_SENDING_REPLY_CHARGING],
  1510.             mmi_jmms_reply_charging_highlight_hdlr);
  1511.     }
  1512.     /* end */
  1513. }
  1514. /*****************************************************************************
  1515.  * FUNCTION
  1516.  *  mmi_jmms_exit_sending_settings
  1517.  * DESCRIPTION
  1518.  *  Exit fn for the send setting screeen
  1519.  * PARAMETERS
  1520.  *  void
  1521.  * RETURNS
  1522.  *  void
  1523.  *****************************************************************************/
  1524. void mmi_jmms_exit_sending_settings(void)
  1525. {
  1526.     /*----------------------------------------------------------------*/
  1527.     /* Local Variables                                                */
  1528.     /*----------------------------------------------------------------*/
  1529.     history history_buff;
  1530.     U16 inputBufferSize;    /* added for inline edit history */
  1531.     S16 nhistory = 0;
  1532.     /*----------------------------------------------------------------*/
  1533.     /* Code Body                                                      */
  1534.     /*----------------------------------------------------------------*/
  1535.     set_leading_zero(TRUE);
  1536.     CloseCategory57Screen();
  1537.     history_buff.scrnID = SCR_ID_JMMS_SENDING_SETTINGS;
  1538.     history_buff.entryFuncPtr = mmi_jmms_entry_sending_settings;
  1539.     pfnUnicodeStrcpy((S8*) history_buff.inputBuffer, (S8*) & nhistory);
  1540.     GetCategory57History(history_buff.guiBuffer);
  1541.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  1542.     GetCategory57Data((U8*) history_buff.inputBuffer);  /* added for inline edit history */
  1543.     AddNHistory(history_buff, inputBufferSize);         /* added for inline edit history */
  1544.     if (g_jmms_context->jmms_inline_lists != NULL)
  1545.     {
  1546.         jdd_MemFree(g_jmms_context->jmms_inline_lists);
  1547.         g_jmms_context->jmms_inline_lists = NULL;
  1548.     }
  1549. }
  1550. /*****************************************************************************
  1551.  * FUNCTION
  1552.  *  mmi_jmms_reply_charging_highlight_hdlr
  1553.  * DESCRIPTION
  1554.  *  Highligh handler fro reply charging inline item
  1555.  * PARAMETERS
  1556.  *  index       [IN]        
  1557.  * RETURNS
  1558.  *  void
  1559.  *****************************************************************************/
  1560. void mmi_jmms_reply_charging_highlight_hdlr(S32 index)
  1561. {
  1562.     /*----------------------------------------------------------------*/
  1563.     /* Local Variables                                                */
  1564.     /*----------------------------------------------------------------*/
  1565.     /*----------------------------------------------------------------*/
  1566.     /* Code Body                                                      */
  1567.     /*----------------------------------------------------------------*/
  1568.     if (g_reply_charging_done == 1)
  1569.     {
  1570.         ChangeRightSoftkey(STR_GLOBAL_DONE, NULL);
  1571.         SetRightSoftkeyFunction(mmi_jmms_confirm_save_sending_settings, KEY_EVENT_UP);
  1572.     }
  1573.     if (index == E_ON)
  1574.     {
  1575.         ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  1576.         SetLeftSoftkeyFunction(mmi_jmms_pre_entry_sending_reply_charging_settings, KEY_EVENT_UP);
  1577.     }
  1578.     else
  1579.     {
  1580.         ChangeLeftSoftkey(NULL, NULL);
  1581.     }
  1582. }
  1583. /*****************************************************************************
  1584.  * FUNCTION
  1585.  *  mmi_jmms_entry_sending_reply_charging_settings
  1586.  * DESCRIPTION
  1587.  *  Entry fn for the Reply charging settings
  1588.  * PARAMETERS
  1589.  *  void
  1590.  * RETURNS
  1591.  *  void
  1592.  *****************************************************************************/
  1593. void mmi_jmms_entry_sending_reply_charging_settings(void)
  1594. {
  1595.     /*----------------------------------------------------------------*/
  1596.     /* Local Variables                                                */
  1597.     /*----------------------------------------------------------------*/
  1598.     U8 *guiBuffer;
  1599.     U8 *inputBuffer;        /* added for inline edit history */
  1600.     U16 inputBufferSize;    /* added for inline edit history */
  1601.     U16 image_list[SENDING_REPLY_CHARGING_INLINE_TOTAL] = {0};
  1602.     /*----------------------------------------------------------------*/
  1603.     /* Code Body                                                      */
  1604.     /*----------------------------------------------------------------*/
  1605.     EntryNewScreen(SCR_ID_JMMS_SENDING_SETTINGS, mmi_jmms_exit_sending_reply_charging_settings, NULL, NULL);
  1606.     set_leading_zero(FALSE);
  1607.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_SENDING_REPLY_CHARGING_SETTINGS);
  1608.     InitializeCategory57Screen();
  1609.     mmi_jmms_sending_reply_charging_fill_inline_struct();
  1610.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_SENDING_REPLY_CHARGING_SETTINGS);
  1611.     inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_SENDING_REPLY_CHARGING_SETTINGS, &inputBufferSize);   /* added for inline edit history */
  1612.     if (inputBuffer)    /* added for inline edit history */
  1613.     {
  1614.         SetCategory57Data(wgui_inline_items, SENDING_REPLY_CHARGING_INLINE_TOTAL, inputBuffer); /* sets the data */
  1615.     }
  1616.     image_list[E_SENDING_REPLY_CHARGING_REQUEST_TYPE_CAPTION] = gIndexIconsImageList[0];
  1617.     image_list[E_SENDING_REPLY_CHARGING_DEADLINE_CAPTION] = gIndexIconsImageList[1];
  1618.     image_list[E_SENDING_REPLY_CHARGING_SIZE_CAPTION] = gIndexIconsImageList[2];
  1619.     ShowCategory57Screen(
  1620.         STR_GLOBAL_OPTIONS,
  1621.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1622.         NULL,
  1623.         NULL,
  1624.         STR_GLOBAL_BACK,
  1625.         IMG_GLOBAL_BACK,
  1626.         SENDING_REPLY_CHARGING_INLINE_TOTAL,
  1627.         image_list,
  1628.         wgui_inline_items,
  1629.         0,
  1630.         guiBuffer);
  1631.     SetCategory57RightSoftkeyFunctions(mmi_jmms_sending_reply_charging_settings_done, GoBackHistory);
  1632. /*    if (g_jmms_control == E_ENTRY_FROM_WRITE_MMS)
  1633.     {
  1634.         SetKeyHandler(mmi_jmms_free_addresses_list_on_end, KEY_END, KEY_EVENT_DOWN);
  1635.     }
  1636. */
  1637. }
  1638. /*****************************************************************************
  1639.  * FUNCTION
  1640.  *  mmi_jmms_sending_reply_charging_fill_inline_struct
  1641.  * DESCRIPTION
  1642.  *  Fills the inline items for reply charging settings screen
  1643.  * PARAMETERS
  1644.  *  void
  1645.  * RETURNS
  1646.  *  void
  1647.  *****************************************************************************/
  1648. void mmi_jmms_sending_reply_charging_fill_inline_struct(void)
  1649. {
  1650.     /*----------------------------------------------------------------*/
  1651.     /* Local Variables                                                */
  1652.     /*----------------------------------------------------------------*/
  1653.     /*----------------------------------------------------------------*/
  1654.     /* Code Body                                                      */
  1655.     /*----------------------------------------------------------------*/
  1656.     g_jmms_context->jmms_inline_items.sending_items_list.reply_charging_request_list[0] = GetString(STR_ID_SETTINGS_REQUEST_TYPE_FULL_MMS);
  1657.     g_jmms_context->jmms_inline_items.sending_items_list.reply_charging_request_list[1] = GetString(STR_ID_SETTINGS_REQUEST_TYPE_ONLY_TEXT);
  1658.     SetInlineItemActivation(
  1659.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_REQUEST_TYPE_CAPTION],
  1660.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1661.         0);
  1662.     SetInlineItemCaption(
  1663.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_REQUEST_TYPE_CAPTION],
  1664.         (U8*) GetString(STR_ID_SETTINGS_REQUEST_TYPE));
  1665.     SetInlineItemSelect(
  1666.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_REQUEST_TYPE],
  1667.         2,
  1668.         (U8 **) g_jmms_context->jmms_inline_items.sending_items_list.reply_charging_request_list,
  1669.         &g_jmms_context->jmms_inline_items.sending_items_list.request_type);
  1670.     SetInlineItemActivation(
  1671.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_REQUEST_TYPE],
  1672.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1673.         0);
  1674.     SetInlineItemActivation(
  1675.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_DEADLINE_CAPTION],
  1676.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1677.         0);
  1678.     SetInlineItemCaption(
  1679.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_DEADLINE_CAPTION],
  1680.         (U8*) GetString(STR_ID_SETTINGS_REPLY_DEADLINE));
  1681.     SetInlineItemActivation(
  1682.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_DEADLINE],
  1683.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1684.         0);
  1685.     SetInlineItemTextEdit(
  1686.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_DEADLINE],
  1687.         (U8*) g_jmms_context->jmms_inline_items.sending_items_list.deadline_for_reply_buffer,
  1688.         (MAX_DEADLINE_TIME_VALUE_INPUT + 1),
  1689.         INPUT_TYPE_NUMERIC);
  1690.     SetInlineItemActivation(
  1691.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_SIZE_CAPTION],
  1692.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1693.         0);
  1694.     SetInlineItemCaption(
  1695.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_SIZE_CAPTION],
  1696.         (U8*) GetString(STR_ID_SETTINGS_REPLY_CHARGE_SIZE));
  1697.     SetInlineItemActivation(
  1698.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_SIZE],
  1699.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1700.         0);
  1701.     SetInlineItemTextEdit(
  1702.         &wgui_inline_items[E_SENDING_REPLY_CHARGING_SIZE],
  1703.         (U8*) g_jmms_context->jmms_inline_items.sending_items_list.reply_msg_size_buffer,
  1704.         (MAX_REPLY_CHARGE_SIZE_INPUT + 1),
  1705.         INPUT_TYPE_NUMERIC);
  1706. }
  1707. /*****************************************************************************
  1708.  * FUNCTION
  1709.  *  mmi_jmms_exit_sending_reply_charging_settings
  1710.  * DESCRIPTION
  1711.  *  Exit fn for reply charging setting screen
  1712.  * PARAMETERS
  1713.  *  void
  1714.  * RETURNS
  1715.  *  void
  1716.  *****************************************************************************/
  1717. void mmi_jmms_exit_sending_reply_charging_settings(void)
  1718. {
  1719.     /*----------------------------------------------------------------*/
  1720.     /* Local Variables                                                */
  1721.     /*----------------------------------------------------------------*/
  1722.     history history_buff;
  1723.     U16 inputBufferSize;    /* added for inline edit history */
  1724.     S16 nhistory = 0;
  1725.     /*----------------------------------------------------------------*/
  1726.     /* Code Body                                                      */
  1727.     /*----------------------------------------------------------------*/
  1728.     set_leading_zero(TRUE);
  1729.     CloseCategory57Screen();
  1730.     history_buff.scrnID = SCR_ID_JMMS_SENDING_REPLY_CHARGING_SETTINGS;
  1731.     history_buff.entryFuncPtr = mmi_jmms_entry_sending_reply_charging_settings;
  1732.     pfnUnicodeStrcpy((S8*) history_buff.inputBuffer, (S8*) & nhistory);
  1733.     GetCategory57History(history_buff.guiBuffer);
  1734.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  1735.     GetCategory57Data((U8*) history_buff.inputBuffer);  /* added for inline edit history */
  1736.     AddNHistory(history_buff, inputBufferSize);         /* added for inline edit history */
  1737. }
  1738. /*****************************************************************************
  1739.  * FUNCTION
  1740.  *  mmi_jmms_pre_entry_retrieval_settings
  1741.  * DESCRIPTION
  1742.  *  Pre Entry fn for retrieval setting screeen.It init the retreival inline items
  1743.  * PARAMETERS
  1744.  *  void
  1745.  * RETURNS
  1746.  *  void
  1747.  *****************************************************************************/
  1748. void mmi_jmms_pre_entry_retrieval_settings(void)
  1749. {
  1750.     /*----------------------------------------------------------------*/
  1751.     /* Local Variables                                                */
  1752.     /*----------------------------------------------------------------*/
  1753.     /*----------------------------------------------------------------*/
  1754.     /* Code Body                                                      */
  1755.     /*----------------------------------------------------------------*/
  1756.     g_jmms_context->jmms_inline_items.retrieval_items_list.advertisement_filter =
  1757.         (S32) g_jmms_context->nvram_retrieval_settings.advertisement_filter;
  1758.     g_jmms_context->jmms_inline_items.retrieval_items_list.anonymous_filter =
  1759.         (S32) g_jmms_context->nvram_retrieval_settings.anonymous_filter;
  1760.     g_jmms_context->jmms_inline_items.retrieval_items_list.delivery_report =
  1761.         (S32) g_jmms_context->nvram_retrieval_settings.delivery_report;
  1762.     g_jmms_context->jmms_inline_items.retrieval_items_list.home_network =
  1763.         (S32) g_jmms_context->nvram_retrieval_settings.home_network - 1;
  1764.     g_jmms_context->jmms_inline_items.retrieval_items_list.read_report =
  1765.         (S32) g_jmms_context->nvram_retrieval_settings.read_report;
  1766.     g_jmms_context->jmms_inline_items.retrieval_items_list.roaming =
  1767.         (S32) g_jmms_context->nvram_retrieval_settings.roaming;
  1768. #ifndef __MMI_MMS_OMA_CONF_273__
  1769.     gui_itoa(
  1770.         (S32) g_jmms_context->nvram_retrieval_settings.msgsize_filter,
  1771.         (UI_string_type) g_jmms_context->jmms_inline_items.retrieval_items_list.msg_size_filter_buffer,
  1772.         10);
  1773. #endif /* __MMI_MMS_OMA_CONF_273__ */ 
  1774.     g_recieve_filter_done = 0;
  1775.     mmi_jmms_entry_retrieval_settings();
  1776. }
  1777. /*****************************************************************************
  1778.  * FUNCTION
  1779.  *  mmi_jmms_entry_retrieval_settings
  1780.  * DESCRIPTION
  1781.  *  Entry fn for retrieval setting screen
  1782.  * PARAMETERS
  1783.  *  void
  1784.  * RETURNS
  1785.  *  void
  1786.  *****************************************************************************/
  1787. void mmi_jmms_entry_retrieval_settings(void)
  1788. {
  1789.     /*----------------------------------------------------------------*/
  1790.     /* Local Variables                                                */
  1791.     /*----------------------------------------------------------------*/
  1792.     U8 *guiBuffer;
  1793.     U8 *inputBuffer;        /* added for inline edit history */
  1794.     U16 inputBufferSize;    /* added for inline edit history */
  1795.     U16 image_list[RETRIEVAL_INLINE_TOTAL] = {0};
  1796.     /*----------------------------------------------------------------*/
  1797.     /* Code Body                                                      */
  1798.     /*----------------------------------------------------------------*/
  1799.     EntryNewScreen(SCR_ID_JMMS_RETRIEVAL_SETTINGS, mmi_jmms_exit_retrieval_settings, NULL, NULL);
  1800.     set_leading_zero(FALSE);
  1801.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVAL_SETTINGS);
  1802.     InitializeCategory57Screen();
  1803.     mmi_jmms_retrieval_fill_inline_struct();
  1804.     RegisterHighlightHandler(mmi_jmms_retrieval_settings_highlight_hdlr);
  1805.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVAL_SETTINGS);
  1806.     inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_RETRIEVAL_SETTINGS, &inputBufferSize);        /* added for inline edit history */
  1807.     if (inputBuffer)    /* added for inline edit history */
  1808.     {
  1809.         SetCategory57Data(wgui_inline_items, RETRIEVAL_INLINE_TOTAL, inputBuffer);      /* sets the data */
  1810.     }
  1811.     image_list[E_RETRIEVAL_HOME_NETWORK_CAPTION] = gIndexIconsImageList[0];
  1812.     image_list[E_RETRIEVAL_ROAMING_CAPTION] = gIndexIconsImageList[1];
  1813.     image_list[E_RETRIEVAL_FILTERS_CAPTION] = gIndexIconsImageList[2];
  1814.     image_list[E_RETRIEVAL_READ_REPORT_CAPTION] = gIndexIconsImageList[3];
  1815.     image_list[E_RETRIEVAL_DELIVERY_REPORT_CAPTION] = gIndexIconsImageList[4];
  1816.     ShowCategory57Screen(
  1817.         STR_ID_MESSAGE_SETTINGS_RETRIEVAL,
  1818.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  1819.         NULL,
  1820.         NULL,
  1821.         STR_GLOBAL_BACK,
  1822.         IMG_GLOBAL_BACK,
  1823.         RETRIEVAL_INLINE_TOTAL,
  1824.         image_list,
  1825.         wgui_inline_items,
  1826.         0,
  1827.         guiBuffer);
  1828.     SetCategory57RightSoftkeyFunctions(mmi_jmms_confirm_save_retrieval_settings, GoBackHistory);
  1829. }
  1830. /*****************************************************************************
  1831.  * FUNCTION
  1832.  *  mmi_jmms_confirm_save_retrieval_settings
  1833.  * DESCRIPTION
  1834.  *  Confirmation screen entry fn for saving retrieval settings
  1835.  * PARAMETERS
  1836.  *  void
  1837.  * RETURNS
  1838.  *  void
  1839.  *****************************************************************************/
  1840. void mmi_jmms_confirm_save_retrieval_settings(void)
  1841. {
  1842.     /*----------------------------------------------------------------*/
  1843.     /* Local Variables                                                */
  1844.     /*----------------------------------------------------------------*/
  1845.     /*----------------------------------------------------------------*/
  1846.     /* Code Body                                                      */
  1847.     /*----------------------------------------------------------------*/
  1848.     DisplayConfirm(
  1849.         STR_GLOBAL_YES,
  1850.         IMG_GLOBAL_YES,
  1851.         STR_GLOBAL_NO,
  1852.         IMG_GLOBAL_NO,
  1853.         get_string(STR_GLOBAL_SAVE),
  1854.         IMG_GLOBAL_QUESTION,
  1855.         WARNING_TONE);
  1856.     SetLeftSoftkeyFunction(mmi_jmms_save_retrieval_settings, KEY_EVENT_UP);
  1857.     SetRightSoftkeyFunction(mmi_jmms_exit_confirm_screen, KEY_EVENT_UP);
  1858. }
  1859. /*****************************************************************************
  1860.  * FUNCTION
  1861.  *  mmi_jmms_save_retrieval_settings
  1862.  * DESCRIPTION
  1863.  *  write the retrieval settings to NVRAM
  1864.  * PARAMETERS
  1865.  *  void
  1866.  * RETURNS
  1867.  *  void
  1868.  *****************************************************************************/
  1869. void mmi_jmms_save_retrieval_settings(void)
  1870. {
  1871.     /*----------------------------------------------------------------*/
  1872.     /* Local Variables                                                */
  1873.     /*----------------------------------------------------------------*/
  1874. #ifndef __MMI_MMS_OMA_CONF_273__
  1875.     S32 temp_msg_size_filter_value;
  1876. #endif 
  1877.     S16 error;
  1878.     /*----------------------------------------------------------------*/
  1879.     /* Code Body                                                      */
  1880.     /*----------------------------------------------------------------*/
  1881.     g_jmms_context->nvram_retrieval_settings.advertisement_filter =
  1882.         (U8) g_jmms_context->jmms_inline_items.retrieval_items_list.advertisement_filter;
  1883.     g_jmms_context->nvram_retrieval_settings.anonymous_filter =
  1884.         (U8) g_jmms_context->jmms_inline_items.retrieval_items_list.anonymous_filter;
  1885.     g_jmms_context->nvram_retrieval_settings.delivery_report =
  1886.         (U8) g_jmms_context->jmms_inline_items.retrieval_items_list.delivery_report;
  1887.     g_jmms_context->nvram_retrieval_settings.home_network =
  1888.         (U8) g_jmms_context->jmms_inline_items.retrieval_items_list.home_network + 1;
  1889.     g_jmms_context->nvram_retrieval_settings.read_report =
  1890.         (U8) g_jmms_context->jmms_inline_items.retrieval_items_list.read_report;
  1891.     g_jmms_context->nvram_retrieval_settings.roaming =
  1892.         (U8) g_jmms_context->jmms_inline_items.retrieval_items_list.roaming;
  1893. #ifndef __MMI_MMS_OMA_CONF_273__
  1894.     temp_msg_size_filter_value = gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.retrieval_items_list.msg_size_filter_buffer);
  1895.     g_jmms_context->nvram_retrieval_settings.msgsize_filter = (U16) temp_msg_size_filter_value;
  1896. #endif /* __MMI_MMS_OMA_CONF_273__ */ 
  1897.     WriteValue(NVRAM_JMMS_RETRIEVAL_SETTINGS, &g_jmms_context->nvram_retrieval_settings, DS_DOUBLE, &error);
  1898.     DisplayPopup((U8*) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, JMMS_POPUP_TIME, SUCCESS_TONE);
  1899.     DeleteUptoScrID(SCR_ID_JMMS_MESSAGE_SETTINGS);
  1900. }
  1901. /*****************************************************************************
  1902.  * FUNCTION
  1903.  *  mmi_jmms_retrieval_fill_inline_struct
  1904.  * DESCRIPTION
  1905.  *  Fills the inline items for retrieval settings screen
  1906.  * PARAMETERS
  1907.  *  void
  1908.  * RETURNS
  1909.  *  void
  1910.  *****************************************************************************/
  1911. void mmi_jmms_retrieval_fill_inline_struct(void)
  1912. {
  1913.     /*----------------------------------------------------------------*/
  1914.     /* Local Variables                                                */
  1915.     /*----------------------------------------------------------------*/
  1916.     /*----------------------------------------------------------------*/
  1917.     /* Code Body                                                      */
  1918.     /*----------------------------------------------------------------*/
  1919.     if (g_jmms_context->jmms_inline_lists == NULL)
  1920.     {
  1921.         g_jmms_context->jmms_inline_lists =
  1922.             (jmms_common_inline_lists_struct*) jdd_MemAlloc(sizeof(jmms_common_inline_lists_struct), 1);
  1923.         if (g_jmms_context->jmms_inline_lists == NULL)
  1924.         {
  1925.             DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  1926.             return;
  1927.         }
  1928.     }
  1929.     g_jmms_context->jmms_inline_items.retrieval_items_list.home_network_list[0] = GetString(STR_ID_SETTINGS_IMMEDIATE);
  1930.     g_jmms_context->jmms_inline_items.retrieval_items_list.home_network_list[1] = GetString(STR_ID_SETTINGS_DEFFERED);
  1931.     g_jmms_context->jmms_inline_items.retrieval_items_list.home_network_list[2] = GetString(STR_ID_SETTINGS_REJECT);
  1932.     g_jmms_context->jmms_inline_items.retrieval_items_list.roaming_list[0] = GetString(STR_ID_SETTINGS_AS_HOME);
  1933.     g_jmms_context->jmms_inline_items.retrieval_items_list.roaming_list[1] = GetString(STR_ID_SETTINGS_IMMEDIATE);
  1934.     g_jmms_context->jmms_inline_items.retrieval_items_list.roaming_list[2] = GetString(STR_ID_SETTINGS_DEFFERED);
  1935.     g_jmms_context->jmms_inline_items.retrieval_items_list.roaming_list[3] = GetString(STR_ID_SETTINGS_REJECT);
  1936.     g_jmms_context->jmms_inline_items.retrieval_items_list.read_report_list[0] = GetString(STR_ID_SETTINGS_ON_REQUEST);
  1937.     g_jmms_context->jmms_inline_items.retrieval_items_list.read_report_list[1] = GetString(STR_ID_SETTINGS_SEND);
  1938.     g_jmms_context->jmms_inline_items.retrieval_items_list.read_report_list[2] = GetString(STR_ID_SETTINGS_NEVER_SEND);
  1939.     g_jmms_context->jmms_inline_lists->on_off_list[0] = GetString(STR_ID_SETTINGS_OFF);
  1940.     g_jmms_context->jmms_inline_lists->on_off_list[1] = GetString(STR_ID_SETTINGS_ON);
  1941.     SetInlineItemActivation(
  1942.         &wgui_inline_items[E_RETRIEVAL_HOME_NETWORK_CAPTION],
  1943.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1944.         0);
  1945.     SetInlineItemCaption(
  1946.         &wgui_inline_items[E_RETRIEVAL_HOME_NETWORK_CAPTION],
  1947.         (U8*) GetString(STR_ID_SETTINGS_HOME_NETWORK));
  1948.     SetInlineItemSelect(
  1949.         &wgui_inline_items[E_RETRIEVAL_HOME_NETWORK],
  1950.         3,
  1951.         (U8 **) g_jmms_context->jmms_inline_items.retrieval_items_list.home_network_list,
  1952.         &g_jmms_context->jmms_inline_items.retrieval_items_list.home_network);
  1953.     SetInlineItemActivation(&wgui_inline_items[E_RETRIEVAL_HOME_NETWORK], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1954.     SetInlineItemActivation(&wgui_inline_items[E_RETRIEVAL_ROAMING_CAPTION], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1955.     SetInlineItemCaption(&wgui_inline_items[E_RETRIEVAL_ROAMING_CAPTION], (U8*) GetString(STR_ID_SETTINGS_ROAMING));
  1956.     SetInlineItemSelect(
  1957.         &wgui_inline_items[E_RETRIEVAL_ROAMING],
  1958.         4,
  1959.         (U8 **) g_jmms_context->jmms_inline_items.retrieval_items_list.roaming_list,
  1960.         &g_jmms_context->jmms_inline_items.retrieval_items_list.roaming);
  1961.     SetInlineItemActivation(&wgui_inline_items[E_RETRIEVAL_ROAMING], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1962.     SetInlineItemActivation(&wgui_inline_items[E_RETRIEVAL_FILTERS_CAPTION], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1963.     SetInlineItemDisplayOnly(
  1964.         &wgui_inline_items[E_RETRIEVAL_FILTERS_CAPTION],
  1965.         (U8*) GetString(STR_ID_SETTINGS_FILTERS));
  1966.     SetInlineItemActivation(
  1967.         &wgui_inline_items[E_RETRIEVAL_READ_REPORT_CAPTION],
  1968.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1969.         0);
  1970.     SetInlineItemCaption(
  1971.         &wgui_inline_items[E_RETRIEVAL_READ_REPORT_CAPTION],
  1972.         (U8*) GetString(STR_ID_SETTINGS_READ_REPORT));
  1973.     SetInlineItemSelect(
  1974.         &wgui_inline_items[E_RETRIEVAL_READ_REPORT],
  1975.         3,
  1976.         (U8 **) g_jmms_context->jmms_inline_items.retrieval_items_list.read_report_list,
  1977.         &g_jmms_context->jmms_inline_items.retrieval_items_list.read_report);
  1978.     SetInlineItemActivation(&wgui_inline_items[E_RETRIEVAL_READ_REPORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1979.     SetInlineItemActivation(
  1980.         &wgui_inline_items[E_RETRIEVAL_DELIVERY_REPORT_CAPTION],
  1981.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1982.         0);
  1983.     SetInlineItemCaption(
  1984.         &wgui_inline_items[E_RETRIEVAL_DELIVERY_REPORT_CAPTION],
  1985.         (U8*) GetString(STR_ID_JMMS_DELIVERY_REPORT));
  1986.     SetInlineItemSelect(
  1987.         &wgui_inline_items[E_RETRIEVAL_DELIVERY_REPORT],
  1988.         2,
  1989.         (U8 **) g_jmms_context->jmms_inline_lists->on_off_list,
  1990.         &g_jmms_context->jmms_inline_items.retrieval_items_list.delivery_report);
  1991.     SetInlineItemActivation(&wgui_inline_items[E_RETRIEVAL_DELIVERY_REPORT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  1992. }
  1993. /*****************************************************************************
  1994.  * FUNCTION
  1995.  *  mmi_jmms_exit_retrieval_settings
  1996.  * DESCRIPTION
  1997.  *  Exit fn for the retrieval setting screen
  1998.  * PARAMETERS
  1999.  *  void
  2000.  * RETURNS
  2001.  *  void
  2002.  *****************************************************************************/
  2003. void mmi_jmms_exit_retrieval_settings(void)
  2004. {
  2005.     /*----------------------------------------------------------------*/
  2006.     /* Local Variables                                                */
  2007.     /*----------------------------------------------------------------*/
  2008.     history history_buff;
  2009.     U16 inputBufferSize;    /* added for inline edit history */
  2010.     S16 nhistory = 0;
  2011.     /*----------------------------------------------------------------*/
  2012.     /* Code Body                                                      */
  2013.     /*----------------------------------------------------------------*/
  2014.     set_leading_zero(TRUE);
  2015.     CloseCategory57Screen();
  2016.     history_buff.scrnID = SCR_ID_JMMS_RETRIEVAL_SETTINGS;
  2017.     history_buff.entryFuncPtr = mmi_jmms_entry_retrieval_settings;
  2018.     pfnUnicodeStrcpy((S8*) history_buff.inputBuffer, (S8*) & nhistory);
  2019.     GetCategory57History(history_buff.guiBuffer);
  2020.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  2021.     GetCategory57Data((U8*) history_buff.inputBuffer);  /* added for inline edit history */
  2022.     AddNHistory(history_buff, inputBufferSize);         /* added for inline edit history */
  2023.     if (g_jmms_context->jmms_inline_lists != NULL)
  2024.     {
  2025.         jdd_MemFree(g_jmms_context->jmms_inline_lists);
  2026.         g_jmms_context->jmms_inline_lists = NULL;
  2027.     }
  2028. }
  2029. /*****************************************************************************
  2030.  * FUNCTION
  2031.  *  mmi_jmms_retrieval_settings_highlight_hdlr
  2032.  * DESCRIPTION
  2033.  *  Highligh handler of retrieval settings screen items
  2034.  * PARAMETERS
  2035.  *  index       [IN]        
  2036.  * RETURNS
  2037.  *  void
  2038.  *****************************************************************************/
  2039. void mmi_jmms_retrieval_settings_highlight_hdlr(S32 index)
  2040. {
  2041.     /*----------------------------------------------------------------*/
  2042.     /* Local Variables                                                */
  2043.     /*----------------------------------------------------------------*/
  2044.     /*----------------------------------------------------------------*/
  2045.     /* Code Body                                                      */
  2046.     /*----------------------------------------------------------------*/
  2047.     if (index == E_RETRIEVAL_FILTERS_CAPTION)
  2048.     {
  2049.         ChangeLeftSoftkey(STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS);
  2050.         SetLeftSoftkeyFunction(mmi_jmms_entry_retrieval_filters_settings, KEY_EVENT_UP);
  2051.     }
  2052.     if (g_recieve_filter_done == 1)
  2053.     {
  2054.         ChangeRightSoftkey(STR_GLOBAL_DONE, NULL);
  2055.         SetRightSoftkeyFunction(mmi_jmms_confirm_save_retrieval_settings, KEY_EVENT_UP);
  2056.     }
  2057. }
  2058. /*****************************************************************************
  2059.  * FUNCTION
  2060.  *  mmi_jmms_entry_retrieval_filters_settings
  2061.  * DESCRIPTION
  2062.  *  Entry fn for filter settings screen
  2063.  * PARAMETERS
  2064.  *  void
  2065.  * RETURNS
  2066.  *  void
  2067.  *****************************************************************************/
  2068. void mmi_jmms_entry_retrieval_filters_settings(void)
  2069. {
  2070.     /*----------------------------------------------------------------*/
  2071.     /* Local Variables                                                */
  2072.     /*----------------------------------------------------------------*/
  2073.     U8 *guiBuffer;
  2074.     U8 *inputBuffer;        /* added for inline edit history */
  2075.     U16 inputBufferSize;    /* added for inline edit history */
  2076.     U16 image_list[RETRIEVAL_FILTER_INLINE_TOTAL] = {0};
  2077.     /*----------------------------------------------------------------*/
  2078.     /* Code Body                                                      */
  2079.     /*----------------------------------------------------------------*/
  2080.     EntryNewScreen(SCR_ID_JMMS_RETRIEVAL_FILTERS_SETTINGS, mmi_jmms_exit_retrieval_filters_settings, NULL, NULL);
  2081.     set_leading_zero(FALSE);
  2082.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVAL_FILTERS_SETTINGS);
  2083.     InitializeCategory57Screen();
  2084.     mmi_jmms_retrieval_filters_fill_inline_struct();
  2085.     guiBuffer = GetCurrGuiBuffer(SCR_ID_JMMS_RETRIEVAL_FILTERS_SETTINGS);
  2086.     inputBuffer = GetCurrNInputBuffer(SCR_ID_JMMS_RETRIEVAL_FILTERS_SETTINGS, &inputBufferSize);        /* added for inline edit history */
  2087.     if (inputBuffer)    /* added for inline edit history */
  2088.     {
  2089.         SetCategory57Data(wgui_inline_items, RETRIEVAL_FILTER_INLINE_TOTAL, inputBuffer);       /* sets the data */
  2090.     }
  2091.     image_list[E_RETRIEVAL_FILTERS_ANONYMOUS_CAPTION] = gIndexIconsImageList[0];
  2092. #ifndef __MMI_MMS_OMA_CONF_273__
  2093.     image_list[E_RETRIEVAL_FILTERS_MAX_MSG_SIZE_CAPTION] = gIndexIconsImageList[1];
  2094.     image_list[E_RETRIEVAL_FILTERS_ADVERTISEMENT_CAPTION] = gIndexIconsImageList[2];
  2095. #else /* __MMI_MMS_OMA_CONF_273__ */ 
  2096.     image_list[E_RETRIEVAL_FILTERS_ADVERTISEMENT_CAPTION] = gIndexIconsImageList[1];
  2097. #endif /* __MMI_MMS_OMA_CONF_273__ */ 
  2098.     ShowCategory57Screen(
  2099.         STR_ID_SETTINGS_FILTERS,
  2100.         GetRootTitleIcon(MAIN_MENU_MESSAGES_MENUID),
  2101.         NULL,
  2102.         NULL,
  2103.         STR_GLOBAL_BACK,
  2104.         IMG_GLOBAL_BACK,
  2105.         RETRIEVAL_FILTER_INLINE_TOTAL,
  2106.         image_list,
  2107.         wgui_inline_items,
  2108.         0,
  2109.         guiBuffer);
  2110.     SetCategory57RightSoftkeyFunctions(mmi_jmms_filter_done_handler, GoBackHistory);
  2111. }
  2112. /*****************************************************************************
  2113.  * FUNCTION
  2114.  *  mmi_jmms_filter_done_handler
  2115.  * DESCRIPTION
  2116.  *  Done handler of filter screen. it checks that msg size input is not > 148KB and not empty.or 0.
  2117.  * PARAMETERS
  2118.  *  void
  2119.  * RETURNS
  2120.  *  void
  2121.  *****************************************************************************/
  2122. void mmi_jmms_filter_done_handler(void)
  2123. {
  2124.     /*----------------------------------------------------------------*/
  2125.     /* Local Variables                                                */
  2126.     /*----------------------------------------------------------------*/
  2127. #ifndef __MMI_MMS_OMA_CONF_273__
  2128.     U32 temp;
  2129.     /*----------------------------------------------------------------*/
  2130.     /* Code Body                                                      */
  2131.     /*----------------------------------------------------------------*/
  2132.     temp = gui_atoi((UI_string_type) g_jmms_context->jmms_inline_items.retrieval_items_list.msg_size_filter_buffer);
  2133.     if ((temp > MAX_MMS_MSG_SIZE)
  2134.         || (g_jmms_context->jmms_inline_items.retrieval_items_list.msg_size_filter_buffer[0] == 48)
  2135.         ||
  2136.         (pfnUnicodeStrncmp
  2137.          ((S8*) g_jmms_context->jmms_inline_items.retrieval_items_list.msg_size_filter_buffer, "",
  2138.           MAX_FILTER_MSG_SIZE_INPUT * ENCODING_LENGTH) == 0))
  2139.     {
  2140.         DisplayPopup((U8*) GetString(STR_ID_MAX_MSG_SIZE_LIMT), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  2141.     }
  2142.     else
  2143. #endif /* __MMI_MMS_OMA_CONF_273__ */ 
  2144.     {
  2145.         g_recieve_filter_done = 1;
  2146.         GoBackHistory();
  2147.     }
  2148. }
  2149. /*****************************************************************************
  2150.  * FUNCTION
  2151.  *  mmi_jmms_retrieval_filters_fill_inline_struct
  2152.  * DESCRIPTION
  2153.  *  Fills the inline sttruct for filter settings screen
  2154.  * PARAMETERS
  2155.  *  void
  2156.  * RETURNS
  2157.  *  void
  2158.  *****************************************************************************/
  2159. void mmi_jmms_retrieval_filters_fill_inline_struct(void)
  2160. {
  2161.     /*----------------------------------------------------------------*/
  2162.     /* Local Variables                                                */
  2163.     /*----------------------------------------------------------------*/
  2164.     /*----------------------------------------------------------------*/
  2165.     /* Code Body                                                      */
  2166.     /*----------------------------------------------------------------*/
  2167.     if (g_jmms_context->jmms_inline_lists == NULL)
  2168.     {
  2169.         g_jmms_context->jmms_inline_lists =
  2170.             (jmms_common_inline_lists_struct*) jdd_MemAlloc(sizeof(jmms_common_inline_lists_struct), 1);
  2171.         if (g_jmms_context->jmms_inline_lists == NULL)
  2172.         {
  2173.             DisplayPopup((PU8) GetString(STR_ID_JMMS_OUT_OF_MEMORY), IMG_GLOBAL_ERROR, 1, JMMS_POPUP_TIME, ERROR_TONE);
  2174.             return;
  2175.         }
  2176.     }
  2177.     g_jmms_context->jmms_inline_lists->allow_reject_list[0] = GetString(STR_ID_SETTINGS_ALLOW);
  2178.     g_jmms_context->jmms_inline_lists->allow_reject_list[1] = GetString(STR_ID_SETTINGS_REJECT);
  2179.     SetInlineItemActivation(
  2180.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ANONYMOUS_CAPTION],
  2181.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2182.         0);
  2183.     SetInlineItemCaption(
  2184.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ANONYMOUS_CAPTION],
  2185.         (U8*) GetString(STR_ID_SETTINGS_ANNONYMOUS));
  2186.     SetInlineItemSelect(
  2187.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ANONYMOUS],
  2188.         2,
  2189.         (U8 **) g_jmms_context->jmms_inline_lists->allow_reject_list,
  2190.         &g_jmms_context->jmms_inline_items.retrieval_items_list.anonymous_filter);
  2191.     SetInlineItemActivation(
  2192.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ANONYMOUS],
  2193.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2194.         0);
  2195. #ifndef __MMI_MMS_OMA_CONF_273__
  2196.     SetInlineItemActivation(
  2197.         &wgui_inline_items[E_RETRIEVAL_FILTERS_MAX_MSG_SIZE_CAPTION],
  2198.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2199.         0);
  2200.     SetInlineItemCaption(
  2201.         &wgui_inline_items[E_RETRIEVAL_FILTERS_MAX_MSG_SIZE_CAPTION],
  2202.         (U8*) GetString(STR_ID_SETTINGS_MAX_MSG_SIZE));
  2203.     SetInlineItemActivation(
  2204.         &wgui_inline_items[E_RETRIEVAL_FILTERS_MAX_MSG_SIZE],
  2205.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2206.         0);
  2207.     SetInlineItemTextEdit(
  2208.         &wgui_inline_items[E_RETRIEVAL_FILTERS_MAX_MSG_SIZE],
  2209.         (U8*) g_jmms_context->jmms_inline_items.retrieval_items_list.msg_size_filter_buffer,
  2210.         (MAX_FILTER_MSG_SIZE_INPUT + 1),
  2211.         INPUT_TYPE_NUMERIC);
  2212. #endif /* __MMI_MMS_OMA_CONF_273__ */ 
  2213.     SetInlineItemActivation(
  2214.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ADVERTISEMENT_CAPTION],
  2215.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2216.         0);
  2217.     SetInlineItemCaption(
  2218.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ADVERTISEMENT_CAPTION],
  2219.         (U8*) GetString(STR_ID_SETTINGS_ADVERTISMENT));
  2220.     SetInlineItemSelect(
  2221.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ADVERTISEMENT],
  2222.         2,
  2223.         (U8 **) g_jmms_context->jmms_inline_lists->allow_reject_list,
  2224.         &g_jmms_context->jmms_inline_items.retrieval_items_list.advertisement_filter);
  2225.     SetInlineItemActivation(
  2226.         &wgui_inline_items[E_RETRIEVAL_FILTERS_ADVERTISEMENT],
  2227.         INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  2228.         0);
  2229. }
  2230. /*****************************************************************************
  2231.  * FUNCTION
  2232.  *  mmi_jmms_exit_retrieval_filters_settings
  2233.  * DESCRIPTION
  2234.  *  Exit fn for filter settings screen
  2235.  * PARAMETERS
  2236.  *  void
  2237.  * RETURNS
  2238.  *  void
  2239.  *****************************************************************************/
  2240. void mmi_jmms_exit_retrieval_filters_settings(void)
  2241. {
  2242.     /*----------------------------------------------------------------*/
  2243.     /* Local Variables                                                */
  2244.     /*----------------------------------------------------------------*/
  2245.     history history_buff;
  2246.     U16 inputBufferSize;    /* added for inline edit history */
  2247.     S16 nhistory = 0;
  2248.     /*----------------------------------------------------------------*/
  2249.     /* Code Body                                                      */
  2250.     /*----------------------------------------------------------------*/
  2251.     set_leading_zero(TRUE);
  2252.     CloseCategory57Screen();
  2253.     history_buff.scrnID = SCR_ID_JMMS_RETRIEVAL_FILTERS_SETTINGS;
  2254.     history_buff.entryFuncPtr = mmi_jmms_entry_retrieval_filters_settings;
  2255.     pfnUnicodeStrcpy((S8*) history_buff.inputBuffer, (S8*) & nhistory);
  2256.     GetCategory57History(history_buff.guiBuffer);
  2257.     inputBufferSize = (U16) GetCategory57DataSize();    /* added for inline edit history */
  2258.     GetCategory57Data((U8*) history_buff.inputBuffer);  /* added for inline edit history */
  2259.     AddNHistory(history_buff, inputBufferSize);         /* added for inline edit history */
  2260.     if (g_jmms_context->jmms_inline_lists != NULL)
  2261.     {
  2262.         jdd_MemFree(g_jmms_context->jmms_inline_lists);
  2263.         g_jmms_context->jmms_inline_lists = NULL;
  2264.     }
  2265. }
  2266. /*****************************************************************************
  2267.  * FUNCTION
  2268.  *  mmi_jmms_read_nvram_message_settings
  2269.  * DESCRIPTION
  2270.  *  Read the the message settings from NVRAM
  2271.  * PARAMETERS
  2272.  *  void
  2273.  * RETURNS
  2274.  *  void
  2275.  *****************************************************************************/
  2276. void mmi_jmms_read_nvram_message_settings(void)
  2277. {
  2278.     /*----------------------------------------------------------------*/
  2279.     /* Local Variables                                                */
  2280.     /*----------------------------------------------------------------*/
  2281.     S16 error;
  2282.     /*----------------------------------------------------------------*/
  2283.     /* Code Body                                                      */
  2284.     /*----------------------------------------------------------------*/
  2285.     ReadRecord(
  2286.         NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  2287.         1,
  2288.         &g_jmms_context->nvram_compose_settings,
  2289.         NVRAM_JMMS_COMPOSE_SETTINGS_SIZE /* NVRAM_JMMS_COMPOSE_SETTINGS_SIZE */ ,
  2290.         &error);
  2291.     if (g_jmms_context->nvram_compose_settings.layout == 0xFF)
  2292.     {
  2293.     //#ifdef __MMI_MMS_SIGNATURE__
  2294.         g_jmms_context->nvram_compose_settings.auto_signature = (U8) E_OFF;
  2295.     //#endif 
  2296.         g_jmms_context->nvram_compose_settings.best_page_duration = (U8) E_OFF;
  2297.         g_jmms_context->nvram_compose_settings.creation_mode = (U8) E_CREAT_MODE_FREE;     //Old:E_CREAT_MODE_WARNING;     //KP Jerry modify for setting MMS.creation_mode init value to FREE on 2007-3-13
  2298.         /* HIMANSHU 05122006 START */
  2299.     #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  2300.         g_jmms_context->nvram_compose_settings.image_resize_option = (U8) E_IMAGE_RESIZE_OFF;
  2301.     #endif 
  2302.         /* HIMANSHU 05122006 END */
  2303.     #ifdef __DRM_SUPPORT__
  2304.         g_jmms_context->nvram_compose_settings.add_drm = (U8) E_OFF;
  2305.     #endif 
  2306.         g_jmms_context->nvram_compose_settings.layout = (U8) E_MMS_LAYOUT_POTRAIT;
  2307.     //#ifdef __MMI_MMS_SIGNATURE__
  2308.         memset(
  2309.             g_jmms_context->nvram_compose_settings.auto_signature_content,
  2310.             0x00,
  2311.             (MAX_AUTO_SIGN_LENGTH + 1) * ENCODING_LENGTH);
  2312.     //#endif /* __MMI_MMS_SIGNATURE__ */ 
  2313.         g_jmms_context->nvram_compose_settings.max_no_pages = (U8) MAX_POSSIBLE_SLIDES;
  2314.         g_jmms_context->nvram_compose_settings.default_slide_time = ((U32) DEFAULT_SLIDE_DURATION) / 1000;      /* /convert to seconds */
  2315.         WriteRecord(
  2316.             NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  2317.             1,
  2318.             &g_jmms_context->nvram_compose_settings,
  2319.             NVRAM_JMMS_COMPOSE_SETTINGS_SIZE,
  2320.             &error);
  2321.         ReadRecord(
  2322.             NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  2323.             1,
  2324.             &g_jmms_context->nvram_compose_settings,
  2325.             NVRAM_JMMS_COMPOSE_SETTINGS_SIZE,
  2326.             &error);
  2327.     }
  2328.     ReadRecord(
  2329.         NVRAM_EF_JMMS_SENDING_SETTINGS_LID,
  2330.         1,
  2331.         &g_jmms_context->nvram_sending_settings,
  2332.         NVRAM_JMMS_SENDING_SETTINGS_SIZE,
  2333.         &error);
  2334.     if (g_jmms_context->nvram_sending_settings.delivery_report == 0xFF)
  2335.     {
  2336.         g_jmms_context->nvram_sending_settings.deadline_for_reply = (U32) 0;
  2337.         g_jmms_context->nvram_sending_settings.delivery_report = (U8) DEFAULT_DELIVERY_REPORT_DURING_SENDING;
  2338.         g_jmms_context->nvram_sending_settings.delivery_time = (U8) E_IMMEDIATE;
  2339.         g_jmms_context->nvram_sending_settings.hide_sender = (U8) E_OFF;
  2340.         g_jmms_context->nvram_sending_settings.priority = (U8) E_PRIORITY_NORMAL;
  2341.         g_jmms_context->nvram_sending_settings.read_report = (U8) DEFAULT_READ_REPORT_DURING_SENDING;
  2342.         g_jmms_context->nvram_sending_settings.reply_charging = (U8) E_OFF;
  2343.         g_jmms_context->nvram_sending_settings.request_type = (U8) E_FULL_MMS;
  2344.         g_jmms_context->nvram_sending_settings.size = (U32) 0;
  2345.         g_jmms_context->nvram_sending_settings.validity_period = (U8) E_VALIDITY_PERIOD_MAX;
  2346.         WriteRecord(
  2347.             NVRAM_EF_JMMS_SENDING_SETTINGS_LID,
  2348.             1,
  2349.             &g_jmms_context->nvram_sending_settings,
  2350.             NVRAM_JMMS_SENDING_SETTINGS_SIZE,
  2351.             &error);
  2352.         ReadRecord(
  2353.             NVRAM_EF_JMMS_SENDING_SETTINGS_LID,
  2354.             1,
  2355.             &g_jmms_context->nvram_sending_settings,
  2356.             NVRAM_JMMS_SENDING_SETTINGS_SIZE,
  2357.             &error);
  2358.     }
  2359.     ReadValue(NVRAM_JMMS_RETRIEVAL_SETTINGS, &g_jmms_context->nvram_retrieval_settings, DS_DOUBLE, &error);
  2360.     if (g_jmms_context->nvram_retrieval_settings.home_network == 0xFF)
  2361.     {
  2362.         g_jmms_context->nvram_retrieval_settings.home_network = (U8) DEFAULT_HOME_RETRIEVAL_MODE;
  2363.         g_jmms_context->nvram_retrieval_settings.roaming = (U8) DEFAULT_ROAMING_RETRIEVAL_MODE;
  2364.         g_jmms_context->nvram_retrieval_settings.anonymous_filter = (U8) DEFAULT_ANONYMOUS_FILTER_VALUE;
  2365.         g_jmms_context->nvram_retrieval_settings.advertisement_filter = (U8) DEFAULT_ADVERTISEMENT_FILTER_VALUE;
  2366.         g_jmms_context->nvram_retrieval_settings.read_report = (U8) DEFAULT_READ_REPORT_DURING_RETRIEVAL;
  2367.         g_jmms_context->nvram_retrieval_settings.delivery_report = (U8) DEFAULT_DELIVERY_REPORT_DURING_RETRIEVAL;
  2368.     #ifndef __MMI_MMS_OMA_CONF_273__
  2369.         g_jmms_context->nvram_retrieval_settings.msgsize_filter = (U16) MAX_MMS_MSG_SIZE;
  2370.     #endif 
  2371.         WriteValue(NVRAM_JMMS_RETRIEVAL_SETTINGS, &g_jmms_context->nvram_retrieval_settings, DS_DOUBLE, &error);
  2372.         ReadValue(NVRAM_JMMS_RETRIEVAL_SETTINGS, &g_jmms_context->nvram_retrieval_settings, DS_DOUBLE, &error);
  2373.     }
  2374. }
  2375. /*****************************************************************************
  2376.  * FUNCTION
  2377.  *  mmi_jmms_restore_nvram_default_settings
  2378.  * DESCRIPTION
  2379.  *  
  2380.  * PARAMETERS
  2381.  *  void
  2382.  * RETURNS
  2383.  *  void
  2384.  *****************************************************************************/
  2385. void mmi_jmms_restore_nvram_default_settings(void)
  2386. {
  2387.     /*----------------------------------------------------------------*/
  2388.     /* Local Variables                                                */
  2389.     /*----------------------------------------------------------------*/
  2390.     S16 error;
  2391.     /*----------------------------------------------------------------*/
  2392.     /* Code Body                                                      */
  2393.     /*----------------------------------------------------------------*/
  2394. //#ifdef __MMI_MMS_SIGNATURE__
  2395.     g_jmms_context->nvram_compose_settings.auto_signature = (U8) E_OFF;
  2396. //#endif 
  2397.     g_jmms_context->nvram_compose_settings.best_page_duration = (U8) E_OFF;
  2398.     g_jmms_context->nvram_compose_settings.creation_mode = (U8) E_CREAT_MODE_FREE;     //Old:E_CREAT_MODE_WARNING;     //KP Jerry modify for setting MMS.creation_mode init value to FREE on 2007-3-13
  2399.     /* HIMANSHU 05122006 START */
  2400. #ifdef __MMI_MMS_MEGA_PIXEL_SUPPORT__
  2401.     g_jmms_context->nvram_compose_settings.image_resize_option = (U8) E_IMAGE_RESIZE_OFF;
  2402. #endif 
  2403.     /* HIMANSHU 05122006 END */
  2404. #ifdef __DRM_SUPPORT__
  2405.     g_jmms_context->nvram_compose_settings.add_drm = (U8) E_OFF;
  2406. #endif 
  2407.     g_jmms_context->nvram_compose_settings.layout = (U8) E_MMS_LAYOUT_POTRAIT;
  2408. //#ifdef __MMI_MMS_SIGNATURE__
  2409.     memset(
  2410.         g_jmms_context->nvram_compose_settings.auto_signature_content,
  2411.         0x00,
  2412.         (MAX_AUTO_SIGN_LENGTH + 1) * ENCODING_LENGTH);
  2413. //#endif /* __MMI_MMS_SIGNATURE__ */ 
  2414.     g_jmms_context->nvram_compose_settings.max_no_pages = (U8) MAX_POSSIBLE_SLIDES;
  2415.     g_jmms_context->nvram_compose_settings.default_slide_time = ((U32) DEFAULT_SLIDE_DURATION) / 1000;  /* /convert to seconds */
  2416.     WriteRecord(
  2417.         NVRAM_EF_JMMS_COMPOSE_SETTINGS_LID,
  2418.         1,
  2419.         &g_jmms_context->nvram_compose_settings,
  2420.         NVRAM_JMMS_COMPOSE_SETTINGS_SIZE,
  2421.         &error);
  2422.     g_jmms_context->nvram_sending_settings.deadline_for_reply = (U32) 0;
  2423.     g_jmms_context->nvram_sending_settings.delivery_report = (U8) DEFAULT_DELIVERY_REPORT_DURING_SENDING;
  2424.     g_jmms_context->nvram_sending_settings.delivery_time = (U8) E_IMMEDIATE;
  2425.     g_jmms_context->nvram_sending_settings.hide_sender = (U8) E_OFF;
  2426.     g_jmms_context->nvram_sending_settings.priority = (U8) E_PRIORITY_NORMAL;
  2427.     g_jmms_context->nvram_sending_settings.read_report = (U8) DEFAULT_READ_REPORT_DURING_SENDING;
  2428.     g_jmms_context->nvram_sending_settings.reply_charging = (U8) E_OFF;
  2429.     g_jmms_context->nvram_sending_settings.request_type = (U8) E_FULL_MMS;
  2430.     g_jmms_context->nvram_sending_settings.size = (U32) 0;
  2431.     g_jmms_context->nvram_sending_settings.validity_period = (U8) E_VALIDITY_PERIOD_MAX;
  2432.     WriteRecord(
  2433.         NVRAM_EF_JMMS_SENDING_SETTINGS_LID,
  2434.         1,
  2435.         &g_jmms_context->nvram_sending_settings,
  2436.         NVRAM_JMMS_SENDING_SETTINGS_SIZE,
  2437.         &error);
  2438. }
  2439. /*****************************************************************************
  2440.  * FUNCTION
  2441.  *  mmi_jmms_sending_reply_charging_settings_done
  2442.  * DESCRIPTION
  2443.  *  Done handler of Reply charging settings
  2444.  * PARAMETERS
  2445.  *  void
  2446.  * RETURNS
  2447.  *  void
  2448.  *****************************************************************************/
  2449. void mmi_jmms_sending_reply_charging_settings_done(void)
  2450. {
  2451.     /*----------------------------------------------------------------*/
  2452.     /* Local Variables                                                */
  2453.     /*----------------------------------------------------------------*/
  2454.     /*----------------------------------------------------------------*/
  2455.     /* Code Body                                                      */
  2456.     /*----------------------------------------------------------------*/
  2457.     g_reply_charging_done = 1;
  2458.     if (pfnUnicodeStrncmp
  2459.         ((S8*) g_jmms_context->jmms_inline_items.sending_items_list.deadline_for_reply_buffer, "",
  2460.          MAX_DEADLINE_TIME_VALUE_INPUT * ENCODING_LENGTH) == 0)
  2461.     {
  2462.         DisplayPopup(
  2463.             (U8*) GetString(STR_ID_SETTINGS_REPLY_DEADLINE_ERROR),
  2464.             IMG_GLOBAL_ERROR,
  2465.             1,
  2466.             JMMS_POPUP_TIME,
  2467.             ERROR_TONE);
  2468.     }
  2469.     else if (pfnUnicodeStrncmp
  2470.              ((S8*) g_jmms_context->jmms_inline_items.sending_items_list.reply_msg_size_buffer, "",
  2471.               MAX_REPLY_CHARGE_SIZE_INPUT * ENCODING_LENGTH) == 0)
  2472.     {
  2473.         DisplayPopup(
  2474.             (U8*) GetString(STR_ID_SETTINGS_REPLY_CHARGE_SIZE_ERROR),
  2475.             IMG_GLOBAL_ERROR,
  2476.             1,
  2477.             JMMS_POPUP_TIME,
  2478.             ERROR_TONE);
  2479.     }
  2480.     else
  2481.     {
  2482.         GoBackHistory();
  2483.     }
  2484. }
  2485. /*****************************************************************************
  2486.  * FUNCTION
  2487.  *  mmi_jmms_pre_entry_sending_reply_charging_settings
  2488.  * DESCRIPTION
  2489.  *  Pre entry fn for reply charging settings
  2490.  * PARAMETERS
  2491.  *  void
  2492.  * RETURNS
  2493.  *  void
  2494.  *****************************************************************************/
  2495. void mmi_jmms_pre_entry_sending_reply_charging_settings(void)
  2496. {
  2497.     /*----------------------------------------------------------------*/
  2498.     /* Local Variables                                                */
  2499.     /*----------------------------------------------------------------*/
  2500.     /*----------------------------------------------------------------*/
  2501.     /* Code Body                                                      */
  2502.     /*----------------------------------------------------------------*/
  2503.     mmi_jmms_entry_sending_reply_charging_settings();
  2504. }
  2505. /*****************************************************************************
  2506.  * FUNCTION
  2507.  *  mmi_jmms_sending_settings_highlight_hdlr
  2508.  * DESCRIPTION
  2509.  *  Highlight hdlr for sending setting screen
  2510.  * PARAMETERS
  2511.  *  index       [IN]        
  2512.  * RETURNS
  2513.  *  void
  2514.  *****************************************************************************/
  2515. void mmi_jmms_sending_settings_highlight_hdlr(S32 index)
  2516. {
  2517.     /*----------------------------------------------------------------*/
  2518.     /* Local Variables                                                */
  2519.     /*----------------------------------------------------------------*/
  2520.     /*----------------------------------------------------------------*/
  2521.     /* Code Body                                                      */
  2522.     /*----------------------------------------------------------------*/
  2523.     if (g_reply_charging_done == 1)
  2524.     {
  2525.         ChangeRightSoftkey(STR_GLOBAL_DONE, NULL);
  2526.         SetRightSoftkeyFunction(mmi_jmms_confirm_save_sending_settings, KEY_EVENT_UP);
  2527.     }
  2528. }
  2529. /* MAUI_00227929 Start */
  2530. /*****************************************************************************
  2531.  * FUNCTION
  2532.  *  mmi_jmms_fill_mms_sending_settings
  2533.  * DESCRIPTION
  2534.  *  Filled mms sending settings structure either by using MMS PDU or NVRAM.
  2535.  * PARAMETERS
  2536.  *  void        
  2537.  * RETURNS
  2538.  *  void
  2539.  *****************************************************************************/
  2540. void mmi_jmms_fill_mms_sending_settings(void)
  2541. {
  2542.  
  2543.     if (g_jmms_context->g_use_local_send_setings == 0)
  2544.     {
  2545.         gui_itoa(
  2546.             (S32) mmi_jmms_sending_settings_deadline_for_reply(),
  2547.             (UI_string_type) g_jmms_context->sending_settings.deadline_for_reply_buffer,
  2548.             10);
  2549.         g_jmms_context->sending_settings.delivery_report =
  2550.             (S32) mmi_jmms_sending_settings_delivery_report();
  2551.         g_jmms_context->sending_settings.delivery_time =
  2552. /* MAUI_00018559 Start */
  2553.             (S32) /*mmi_jmms_sending_settings_delivery_time();*/g_jmms_context->nvram_sending_settings.delivery_time;
  2554.   /* amit commented this as we are reading values for UI so no need to have time in seconds*/
  2555. /* MAUI_00018559 End */
  2556.         g_jmms_context->sending_settings.hide_sender =
  2557.             (S32) mmi_jmms_sending_settings_hide_sender();
  2558.         g_jmms_context->sending_settings.priority = (S32) mmi_jmms_sending_settings_priority();
  2559.         g_jmms_context->sending_settings.read_report =
  2560.             (S32) mmi_jmms_sending_settings_read_report();
  2561.         g_jmms_context->sending_settings.reply_charging =
  2562.             (S32) mmi_jmms_sending_settings_reply_charging_status();
  2563.         g_jmms_context->sending_settings.request_type =
  2564.             (S32) mmi_jmms_sending_settings_reply_charging_request_type();
  2565.         g_jmms_context->sending_settings.validity_period =
  2566. /* MAUI_00018559 Start */
  2567.             (S32) /*mmi_jmms_sending_settings_validity_period();*/g_jmms_context->nvram_sending_settings.validity_period;
  2568.   /* amit commented this as we are reading values for UI so no need to have time in seconds*/
  2569. /* MAUI_00018559 End */
  2570.         gui_itoa(
  2571.             (S32) mmi_jmms_sending_settings_reply_charging_size(),
  2572.             (UI_string_type) g_jmms_context->sending_settings.reply_msg_size_buffer,
  2573.             10);
  2574.     }
  2575.       /* sanjeev added */
  2576.       else if(g_jmms_context->g_use_local_send_setings == 1)
  2577.       {
  2578.   MESSAGE_HEADERS *pMsgHeaders = NULL;
  2579.   MESSAGE_SEND *pMessageSend = NULL;
  2580.   mmi_jmms_jdi_get_msg_headers(g_jmms_context->msg_handle, &pMsgHeaders);
  2581. /* MAUI_00018548 Start */
  2582. if( pMsgHeaders != NULL )
  2583. {
  2584. pMessageSend = pMsgHeaders->pHeaders;
  2585.   
  2586. g_jmms_context->sending_settings.delivery_report =
  2587. (S32) pMessageSend->bDeliveryReport;
  2588.           
  2589. g_jmms_context->sending_settings.hide_sender =
  2590.                 (S32) pMessageSend->bHideSender;
  2591. g_jmms_context->sending_settings.priority = 
  2592. /* MAUI_00018625 Start */
  2593.         (S32) pMessageSend->eMsgPriority;  // sanjeev changes 20/12/06
  2594. /* MAUI_00018625 End */
  2595. g_jmms_context->sending_settings.read_report =
  2596. (S32) pMessageSend->bReadReport;
  2597.      
  2598. if (pMessageSend->pReplyChargingInfo != NULL)
  2599. {
  2600. g_jmms_context->sending_settings.reply_charging =
  2601.     (S32) E_ON;
  2602. gui_itoa(
  2603. (S32) pMessageSend->pReplyChargingInfo->uiRelativeTime,
  2604. (UI_string_type) g_jmms_context->sending_settings.deadline_for_reply_buffer,
  2605. 10);
  2606. g_jmms_context->sending_settings.request_type =
  2607. (S32) (pMessageSend->pReplyChargingInfo->eReplyCharging);
  2608. gui_itoa(
  2609. (S32) pMessageSend->pReplyChargingInfo->uiSize,
  2610. (UI_string_type) g_jmms_context->sending_settings.reply_msg_size_buffer,
  2611. 10);
  2612. }
  2613.         else
  2614. {
  2615.    g_jmms_context->sending_settings.reply_charging = 
  2616.       (S32) E_OFF;
  2617. }
  2618.     switch(pMessageSend->uiExpiryTime)
  2619. {
  2620.         case MAX_VALIDITY_PERIOD_VALUE:
  2621. g_jmms_context->sending_settings.validity_period =
  2622. (S32) E_VALIDITY_PERIOD_MAX;
  2623. break;
  2624. case 3600:
  2625. g_jmms_context->sending_settings.validity_period = E_VALIDITY_PERIOD_1HR;
  2626. break;
  2627. case 12 * 3600:
  2628. g_jmms_context->sending_settings.validity_period = E_VALIDITY_PERIOD_12HRS;
  2629. break;
  2630. case  1 * 24 * 3600:
  2631. g_jmms_context->sending_settings.validity_period = E_VALIDITY_PERIOD_1DAY;
  2632. break;
  2633. case  1 * 7 * 24 * 3600:
  2634. g_jmms_context->sending_settings.validity_period = E_VALIDITY_PERIOD_1WEEK;
  2635. break;
  2636. default:
  2637. g_jmms_context->sending_settings.validity_period = E_VALIDITY_PERIOD_MAX;
  2638. break;
  2639. }
  2640. switch (pMessageSend->uiDeliveryTime)
  2641. {
  2642. case 0:
  2643. g_jmms_context->sending_settings.delivery_time = E_IMMEDIATE;
  2644. break;
  2645. case 3600:
  2646. g_jmms_context->sending_settings.delivery_time = E_1_HR;
  2647. break;
  2648. case 12 * 3600: 
  2649. g_jmms_context->sending_settings.delivery_time = E_12_HRS;
  2650. break;
  2651. case 24 * 3600:
  2652. g_jmms_context->sending_settings.delivery_time = E_24_HRS;
  2653. break;
  2654. default:
  2655. g_jmms_context->sending_settings.delivery_time = E_IMMEDIATE;
  2656. break;   
  2657. }       
  2658. }
  2659. /* MAUI_00018548 End */
  2660. }
  2661. }
  2662. /* MAUI_00227929 Start */
  2663. #endif /* (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT)) */ 
  2664. #endif /* _MMI_JMMSMMSSETTINGS_C */