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

MTK

开发平台:

C/C++

  1.                 if (IsScreenPresent(SCR_ID_UC_EDITOR))
  2.                 {
  3.                     GoBackToHistory(SCR_ID_UC_EDITOR);
  4.                 }
  5.                 else
  6.                 {
  7.                     MMI_ASSERT(0);
  8.                 }
  9.                        
  10.                 if (result == 0)
  11.                 {            
  12.                     mmi_uc_display_popup(MMI_UC_NO_SPACE);
  13.                 }
  14.             }            
  15.         }
  16.         else
  17.         {
  18.             if (MMI_TRUE == mmi_msg_check_interrupt())
  19.             {                
  20.                 if (IsScreenPresent(SCR_ID_UC_EDITOR))
  21.                 {
  22.                     DeleteUptoScrID(SCR_ID_UC_EDITOR);
  23.                 }
  24.                 else
  25.                 {
  26.                     MMI_ASSERT(0);
  27.                 }
  28.             }
  29.             else
  30.             {
  31.                 if (IsScreenPresent(SCR_ID_UC_EDITOR))
  32.                 {
  33.                     GoBackToHistory(SCR_ID_UC_EDITOR);
  34.                 }
  35.                 else
  36.                 {
  37.                     MMI_ASSERT(0);
  38.                 }
  39.             }
  40.         }
  41.     }
  42. }
  43. /*****************************************************************************
  44.  * FUNCTION
  45.  *  mmi_uc_entry_insert_phb_number
  46.  * DESCRIPTION
  47.  *  Highlight Insert PHB number handler
  48.  * PARAMETERS
  49.  *  void
  50.  * RETURNS
  51.  *  void
  52.  *****************************************************************************/
  53. void mmi_uc_entry_insert_phb_number(void)
  54. {
  55.     /*----------------------------------------------------------------*/
  56.     /* Local Variables                                                */
  57.     /*----------------------------------------------------------------*/
  58.     /*----------------------------------------------------------------*/
  59.     /* Code Body                                                      */
  60.     /*----------------------------------------------------------------*/
  61.     mmi_phb_list_pre_entry_for_number_and_email(MMI_PHB_ENTRY_FIELD_ALL_NUMBER, mmi_uc_insert_number_from_phb);
  62. }
  63. /*****************************************************************************
  64.  * FUNCTION
  65.  *  mmi_uc_entry_insert_phb_name
  66.  * DESCRIPTION
  67.  *  Highlight Insert PHB name handler
  68.  * PARAMETERS
  69.  *  void
  70.  * RETURNS
  71.  *  void
  72.  *****************************************************************************/
  73. void mmi_uc_entry_insert_phb_name(void)
  74. {
  75.     /*----------------------------------------------------------------*/
  76.     /* Local Variables                                                */
  77.     /*----------------------------------------------------------------*/
  78.     /*----------------------------------------------------------------*/
  79.     /* Code Body                                                      */
  80.     /*----------------------------------------------------------------*/
  81.     mmi_phb_list_pre_entry_for_number_and_email(MMI_PHB_ENTRY_FIELD_NAME, mmi_uc_insert_name_from_phb);
  82. }
  83. /*****************************************************************************
  84.  * FUNCTION
  85.  *  mmi_uc_insert_number_from_phb
  86.  * DESCRIPTION
  87.  *  Insert phonebook number into write msg
  88.  * PARAMETERS
  89.  *  void
  90.  * RETURNS
  91.  *  void
  92.  *****************************************************************************/
  93. void mmi_uc_insert_number_from_phb(S8* name, S8* number)
  94. {
  95.     /*----------------------------------------------------------------*/
  96.     /* Local Variables                                                */
  97.     /*----------------------------------------------------------------*/
  98.     historyNode *History;
  99.     U16 char_num;
  100.     U8 result = 1;    
  101.     /*----------------------------------------------------------------*/
  102.     /* Code Body                                                      */
  103.     /*----------------------------------------------------------------*/
  104.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_insert_number_from_phb *n"));
  105.     if (NULL != number && (char_num = pfnUnicodeStrlen(number)) > 0)
  106.     {
  107.         if (GetHistoryScrID(SCR_ID_UC_EDITOR, &History) == ST_SUCCESS)
  108.         {
  109.             result = wgui_uce_insert_text_template ((U8*) number, char_num, History->guiBuffer);
  110.         }
  111.         else
  112.         {
  113.             MMI_ASSERT(0);
  114.         }
  115.     }
  116.     GoBackToHistory(SCR_ID_UC_EDITOR);
  117.     
  118.     if (result == 0)
  119.     {
  120.         mmi_uc_display_popup(MMI_UC_NO_SPACE);
  121.     }
  122.     
  123. }
  124. /*****************************************************************************
  125.  * FUNCTION
  126.  *  mmi_uc_insert_name_from_phb
  127.  * DESCRIPTION
  128.  *  Insert phonebook name into write msg
  129.  * PARAMETERS
  130.  *  void
  131.  * RETURNS
  132.  *  void
  133.  *****************************************************************************/
  134. void mmi_uc_insert_name_from_phb(S8* name, S8* number)
  135. {
  136.     /*----------------------------------------------------------------*/
  137.     /* Local Variables                                                */
  138.     /*----------------------------------------------------------------*/
  139.     historyNode *History;
  140.     U16 char_num;
  141.     U8 result = 1;    
  142.     /*----------------------------------------------------------------*/
  143.     /* Code Body                                                      */
  144.     /*----------------------------------------------------------------*/
  145.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_insert_name_from_phb *n"));
  146.     if (NULL != name && (char_num = pfnUnicodeStrlen(name)) > 0)
  147.     {
  148.         if (GetHistoryScrID(SCR_ID_UC_EDITOR, &History) == ST_SUCCESS)
  149.         {
  150.             result = wgui_uce_insert_text_template ((U8*) name, char_num, History->guiBuffer);
  151.         }
  152.         else
  153.         {
  154.             MMI_ASSERT(0);
  155.         }
  156.     }
  157.     GoBackToHistory(SCR_ID_UC_EDITOR);
  158.     
  159.     if (result == 0)
  160.     {
  161.         mmi_uc_display_popup(MMI_UC_NO_SPACE);
  162.     }    
  163. }
  164. /*****************************************************************************
  165.  * FUNCTION
  166.  *  mmi_uc_entry_remove
  167.  * DESCRIPTION
  168.  *  Entry function for remove type list
  169.  * PARAMETERS
  170.  *  void
  171.  * RETURNS
  172.  *  void
  173.  *****************************************************************************/
  174. void mmi_uc_entry_remove(void)
  175. {
  176.     /*----------------------------------------------------------------*/
  177.     /* Local Variables                                                */
  178.     /*----------------------------------------------------------------*/
  179.     U8 *guiBuffer = NULL;
  180.     U16 numItems = 0;
  181.     U16 nStrItemList[MAX_SUB_MENUS];
  182.     /*----------------------------------------------------------------*/
  183.     /* Code Body                                                      */
  184.     /*----------------------------------------------------------------*/
  185.     EntryNewScreen(SCR_ID_UC_OPT_REMOVE, mmi_uc_exit_generic, mmi_uc_entry_remove, NULL);
  186.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_remove *n"));
  187.     
  188.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_REMOVE);
  189.     if (g_uc_p->msg.current_slide->image.object)
  190.     {
  191.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_IMAGE);
  192.     }
  193.     else
  194.     {
  195.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_IMAGE);
  196.     }
  197.     
  198.     if (g_uc_p->msg.current_slide->audio.object)
  199.     {
  200.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_AUDIO);
  201.     }
  202.     else
  203.     {
  204.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_AUDIO);
  205.     }
  206.     if (g_uc_p->msg.current_slide->video.object)
  207.     {
  208.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_VIDEO);
  209.     }
  210.     else
  211.     {
  212.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_VIDEO);
  213.     }
  214.     if (g_uc_p->msg.total_attachment_num)
  215.     {
  216.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REMOVE_ATTACHMENT);
  217.     }
  218.     else
  219.     {
  220.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REMOVE_ATTACHMENT);
  221.     }
  222.     numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_REMOVE);
  223.     GetSequenceStringIds_Ext(MENU_ID_UC_OPT_REMOVE, nStrItemList);
  224.     SetParentHandler(MENU_ID_UC_OPT_REMOVE);
  225.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  226.     ShowCategory52Screen(
  227.         STR_UC_REMOVE_ID,
  228.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  229.         STR_GLOBAL_OK,
  230.         IMG_GLOBAL_OK,
  231.         STR_GLOBAL_BACK,
  232.         IMG_GLOBAL_BACK,
  233.         numItems,
  234.         nStrItemList,
  235.         (U16*) gIndexIconsImageList,
  236.         NULL,
  237.         0,
  238.         0,
  239.         guiBuffer);    
  240.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  241.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  242. }
  243. /*****************************************************************************
  244.  * FUNCTION
  245.  *  mmi_uc_highlight_remove_image
  246.  * DESCRIPTION
  247.  *  Funtion is called when remove image menu item selected
  248.  * PARAMETERS
  249.  *  void
  250.  * RETURNS
  251.  *  void
  252.  *****************************************************************************/
  253. void mmi_uc_highlight_remove_image(void)
  254. {
  255.     /*----------------------------------------------------------------*/
  256.     /* Local Variables                                                */
  257.     /*----------------------------------------------------------------*/
  258.     /*----------------------------------------------------------------*/
  259.     /* Code Body                                                      */
  260.     /*----------------------------------------------------------------*/
  261.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_IMAGE;
  262.     
  263.     SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
  264.     SetKeyHandler(mmi_uc_remove_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  265.     return;
  266. }
  267. /*****************************************************************************
  268.  * FUNCTION
  269.  *  mmi_uc_highlight_remove_audio
  270.  * DESCRIPTION
  271.  *  Funtion is called when remove audio menu item selected
  272.  * PARAMETERS
  273.  *  void
  274.  * RETURNS
  275.  *  void
  276.  *****************************************************************************/
  277. void mmi_uc_highlight_remove_audio(void)
  278. {
  279.     /*----------------------------------------------------------------*/
  280.     /* Local Variables                                                */
  281.     /*----------------------------------------------------------------*/
  282.     /*----------------------------------------------------------------*/
  283.     /* Code Body                                                      */
  284.     /*----------------------------------------------------------------*/
  285.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_AUDIO;
  286.     
  287.     SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
  288.     SetKeyHandler(mmi_uc_remove_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  289.     return;
  290. }
  291. /*****************************************************************************
  292.  * FUNCTION
  293.  *  mmi_uc_highlight_remove_video
  294.  * DESCRIPTION
  295.  *  Funtion is called when remove video menu item selected
  296.  * PARAMETERS
  297.  *  void
  298.  * RETURNS
  299.  *  void
  300.  *****************************************************************************/
  301. void mmi_uc_highlight_remove_video(void)
  302. {
  303.     /*----------------------------------------------------------------*/
  304.     /* Local Variables                                                */
  305.     /*----------------------------------------------------------------*/
  306.     /*----------------------------------------------------------------*/
  307.     /* Code Body                                                      */
  308.     /*----------------------------------------------------------------*/
  309.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_VIDEO;
  310.     
  311.     SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
  312.     SetKeyHandler(mmi_uc_remove_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  313.     return;
  314. }
  315. /*****************************************************************************
  316.  * FUNCTION
  317.  *  mmi_uc_highlight_remove_attachment
  318.  * DESCRIPTION
  319.  *  Funtion is called when remove attachment menu item selected
  320.  * PARAMETERS
  321.  *  void
  322.  * RETURNS
  323.  *  void
  324.  *****************************************************************************/
  325. void mmi_uc_highlight_remove_attachment(void)
  326. {
  327.     /*----------------------------------------------------------------*/
  328.     /* Local Variables                                                */
  329.     /*----------------------------------------------------------------*/
  330.     /*----------------------------------------------------------------*/
  331.     /* Code Body                                                      */
  332.     /*----------------------------------------------------------------*/
  333.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_ATTACHMENT;
  334.     
  335.     SetLeftSoftkeyFunction(mmi_uc_entry_attachment_list, KEY_EVENT_UP);
  336.     SetKeyHandler(mmi_uc_entry_attachment_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  337.     return;
  338. }
  339. /*****************************************************************************
  340.  * FUNCTION
  341.  *  mmi_uc_remove_object
  342.  * DESCRIPTION
  343.  *  Remove the object from current slide
  344.  * PARAMETERS
  345.  *  void
  346.  * RETURNS
  347.  *  void
  348.  *****************************************************************************/
  349. void mmi_uc_remove_object(void)
  350. {
  351.     /*----------------------------------------------------------------*/
  352.     /* Local Variables                                                */
  353.     /*----------------------------------------------------------------*/
  354.     /*----------------------------------------------------------------*/
  355.     /* Code Body                                                      */
  356.     /*----------------------------------------------------------------*/
  357.     switch(g_uc_p->main.highlighted_object_type)
  358.     {
  359.         case MMI_UC_OBJECT_TYPE_IMAGE:
  360.         {                        
  361.             if (g_uc_p->msg.current_slide->image.object->reference_count > 1)
  362.             {
  363.                 g_uc_p->msg.current_slide->image.object->reference_count--;
  364.             }
  365.             else
  366.             {
  367.                 mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->image.object);
  368.             }
  369.             memset(&(g_uc_p->msg.current_slide->image), 0, sizeof(mmi_uc_object_info_struct));
  370.             wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_IMAGE));
  371.             mmi_uc_reset_layout_if_needed();
  372.             
  373.             if (mmi_uc_change_msg_type_if_needed())
  374.             {
  375.                 mmi_uc_insert_signature_check();
  376.             }            
  377.             mmi_uc_update_msg_size();
  378.                 
  379.             GoBackToHistory(SCR_ID_UC_EDITOR);
  380.         }
  381.         break;
  382.         case MMI_UC_OBJECT_TYPE_AUDIO:
  383.         {
  384.             if (g_uc_p->msg.current_slide->audio.object->reference_count > 1)
  385.             {
  386.                 g_uc_p->msg.current_slide->audio.object->reference_count--;
  387.             }
  388.             else
  389.             {
  390.                 mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->audio.object);
  391.             }
  392.             memset(&(g_uc_p->msg.current_slide->audio), 0, sizeof(mmi_uc_object_info_struct));
  393.             wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_AUDIO));
  394.             if (mmi_uc_change_msg_type_if_needed())
  395.             {
  396.                 mmi_uc_insert_signature_check();
  397.             }
  398.             mmi_uc_update_msg_size();
  399.             
  400.             GoBackToHistory(SCR_ID_UC_EDITOR);
  401.         }
  402.         break;
  403.             
  404.         case MMI_UC_OBJECT_TYPE_VIDEO:
  405.         {
  406.             if (g_uc_p->msg.current_slide->video.object->reference_count > 1)
  407.             {
  408.                 g_uc_p->msg.current_slide->video.object->reference_count--;
  409.             }
  410.             else
  411.             {
  412.                 mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->video.object);
  413.             }
  414.             memset(&(g_uc_p->msg.current_slide->video), 0, sizeof(mmi_uc_object_info_struct));
  415.             wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_VIDEO));
  416.             mmi_uc_reset_layout_if_needed();
  417.             if (mmi_uc_change_msg_type_if_needed())
  418.             {
  419.                 mmi_uc_insert_signature_check();
  420.             }
  421.             mmi_uc_update_msg_size();
  422.             
  423.             GoBackToHistory(SCR_ID_UC_EDITOR);
  424.         }
  425.         break;
  426.         case MMI_UC_OBJECT_TYPE_ATTACHMENT:
  427.         {
  428.             mmi_uc_attachment_info_struct* att = mmi_uc_get_attachment_by_index(g_uc_p->main.object_index);
  429.             
  430.             MMI_ASSERT(att->object->reference_count == 1);
  431.             mmi_uc_delete_object_from_list(att->object);
  432.             mmi_uc_delete_attachment_from_list(att);
  433.             if (mmi_uc_change_msg_type_if_needed())
  434.             {
  435.                 mmi_uc_insert_signature_check();
  436.             }
  437.             mmi_uc_update_msg_size();
  438.             DisplayPopup((PU8) GetString(STR_UC_REMOVED_ID),
  439.                          IMG_GLOBAL_OK,
  440.                          1,
  441.                          MMI_UC_POPUP_TIME_OUT,
  442.                          (U8) SUCCESS_TONE);            
  443.             if (g_uc_p->msg.total_attachment_num == 0)
  444.             {
  445.                 wgui_uce_delete_object(mmi_uc_convert_to_editor_object_type(MMI_UC_OBJECT_TYPE_ATTACHMENT));
  446.                 DeleteBetweenScreen(SCR_ID_UC_OPT, SCR_ID_UC_OPT_ATTACHMENT_LIST);
  447.             }
  448.         }
  449.         break;
  450.         default:
  451.         {
  452.             MMI_ASSERT(0);
  453.         }
  454.         break;
  455.     }    
  456. }
  457. /*****************************************************************************
  458.  * FUNCTION
  459.  *  mmi_uc_entry_attachment_list
  460.  * DESCRIPTION
  461.  *  Entry function of attachment list
  462.  * PARAMETERS
  463.  *  void
  464.  * RETURNS
  465.  *  void
  466.  *****************************************************************************/
  467. void mmi_uc_entry_attachment_list(void)
  468. {
  469.     /*----------------------------------------------------------------*/
  470.     /* Local Variables                                                */
  471.     /*----------------------------------------------------------------*/
  472.     U8 *guiBuffer = NULL;
  473.     U32 i = 0;
  474.     mmi_uc_attachment_info_struct* attachment = g_uc_p->msg.attachment_head;
  475.     U16 lsk_id = 0;
  476.     /*----------------------------------------------------------------*/
  477.     /* Code Body                                                      */
  478.     /*----------------------------------------------------------------*/
  479.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_attachment_list *n"));
  480.     EntryNewScreen(SCR_ID_UC_OPT_ATTACHMENT_LIST, mmi_uc_exit_generic, mmi_uc_entry_attachment_list, NULL);
  481.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_ATTACHMENT_LIST);
  482.     SetParentHandler(MENU_ID_UC_OPT_REMOVE_ATTACHMENT);
  483.     
  484.     RegisterHighlightHandler(mmi_uc_set_index);
  485.     for (; i < g_uc_p->msg.total_attachment_num; i++)
  486.     {
  487.         MMI_ASSERT(attachment);
  488.         pfnUnicodeStrcpy((S8*) subMenuDataPtrs[i], (S8*) attachment->object->file_name);
  489.         attachment = attachment->next;
  490.     }
  491.     if (IsScreenPresent(SCR_ID_UC_OPT_REMOVE))
  492.     {
  493.         lsk_id = STR_UC_REMOVE_ID;
  494.     }
  495.     else if (IsScreenPresent(SCR_ID_UC_OPT_REPLACE))
  496.     {
  497.         lsk_id = STR_UC_REPLACE_ID;
  498.     }
  499.     else
  500.     {
  501.         MMI_ASSERT(0);
  502.     }
  503.     ShowCategory84Screen(
  504.         STR_UC_ATTACHMENT_ID,
  505.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  506.         lsk_id,
  507.         0,
  508.         STR_GLOBAL_BACK,
  509.         IMG_GLOBAL_BACK,
  510.         g_uc_p->msg.total_attachment_num,
  511.         (U8 **) subMenuDataPtrs,
  512.         (PU16) gIndexIconsImageList,
  513.         0,
  514.         0,
  515.         guiBuffer);
  516.     if (lsk_id == STR_UC_REMOVE_ID)
  517.     {
  518.         SetLeftSoftkeyFunction(mmi_uc_remove_object, KEY_EVENT_UP);
  519.     }
  520.     else
  521.     {
  522.         SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
  523.     }
  524.     
  525.     
  526.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  527.     
  528. }
  529. /*****************************************************************************
  530.  * FUNCTION
  531.  *  mmi_uc_entry_replace
  532.  * DESCRIPTION
  533.  *  Entry function for replace type list
  534.  * PARAMETERS
  535.  *  void
  536.  * RETURNS
  537.  *  void
  538.  *****************************************************************************/
  539. void mmi_uc_entry_replace(void)
  540. {
  541.     /*----------------------------------------------------------------*/
  542.     /* Local Variables                                                */
  543.     /*----------------------------------------------------------------*/
  544.     U8 *guiBuffer = NULL;
  545.     U16 numItems = 0;
  546.     U16 nStrItemList[MAX_SUB_MENUS];
  547.     /*----------------------------------------------------------------*/
  548.     /* Code Body                                                      */
  549.     /*----------------------------------------------------------------*/
  550.     EntryNewScreen(SCR_ID_UC_OPT_REPLACE, mmi_uc_exit_generic, mmi_uc_entry_replace, NULL);
  551.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_replace *n"));
  552.     
  553.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_REMOVE);
  554.     if (g_uc_p->msg.current_slide->image.object)
  555.     {
  556.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_IMAGE);
  557.     }
  558.     else
  559.     {
  560.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_IMAGE);
  561.     }
  562.     
  563.     if (g_uc_p->msg.current_slide->audio.object)
  564.     {
  565.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_AUDIO);
  566.     }
  567.     else
  568.     {
  569.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_AUDIO);
  570.     }
  571.     if (g_uc_p->msg.current_slide->video.object)
  572.     {
  573.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_VIDEO);
  574.     }
  575.     else
  576.     {
  577.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_VIDEO);
  578.     }
  579.     if (g_uc_p->msg.total_attachment_num)
  580.     {
  581.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_REPLACE_ATTACHMENT);
  582.     }
  583.     else
  584.     {
  585.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_REPLACE_ATTACHMENT);
  586.     }
  587.     numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_REPLACE);
  588.     GetSequenceStringIds_Ext(MENU_ID_UC_OPT_REPLACE, nStrItemList);
  589.     SetParentHandler(MENU_ID_UC_OPT_REPLACE);
  590.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  591.     ShowCategory52Screen(
  592.         STR_UC_REPLACE_ID,
  593.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  594.         STR_GLOBAL_OK,
  595.         IMG_GLOBAL_OK,
  596.         STR_GLOBAL_BACK,
  597.         IMG_GLOBAL_BACK,
  598.         numItems,
  599.         nStrItemList,
  600.         (U16*) gIndexIconsImageList,
  601.         NULL,
  602.         0,
  603.         0,
  604.         guiBuffer);    
  605.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  606.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  607. }
  608. /*****************************************************************************
  609.  * FUNCTION
  610.  *  mmi_uc_highlight_remove_image
  611.  * DESCRIPTION
  612.  *  Funtion is called when replace image menu item selected
  613.  * PARAMETERS
  614.  *  void
  615.  * RETURNS
  616.  *  void
  617.  *****************************************************************************/
  618. void mmi_uc_highlight_replace_image(void)
  619. {
  620.     /*----------------------------------------------------------------*/
  621.     /* Local Variables                                                */
  622.     /*----------------------------------------------------------------*/
  623.     /*----------------------------------------------------------------*/
  624.     /* Code Body                                                      */
  625.     /*----------------------------------------------------------------*/
  626.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_IMAGE;
  627.     
  628.     SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
  629.     SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  630.     return;
  631. }
  632. /*****************************************************************************
  633.  * FUNCTION
  634.  *  mmi_uc_highlight_replace_audio
  635.  * DESCRIPTION
  636.  *  Funtion is called when replace audio menu item selected
  637.  * PARAMETERS
  638.  *  void
  639.  * RETURNS
  640.  *  void
  641.  *****************************************************************************/
  642. void mmi_uc_highlight_replace_audio(void)
  643. {
  644.     /*----------------------------------------------------------------*/
  645.     /* Local Variables                                                */
  646.     /*----------------------------------------------------------------*/
  647.     /*----------------------------------------------------------------*/
  648.     /* Code Body                                                      */
  649.     /*----------------------------------------------------------------*/
  650.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_AUDIO;
  651.     
  652.     SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
  653.     SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  654.     return;
  655. }
  656. /*****************************************************************************
  657.  * FUNCTION
  658.  *  mmi_uc_highlight_replace_video
  659.  * DESCRIPTION
  660.  *  Funtion is called when replace video menu item selected
  661.  * PARAMETERS
  662.  *  void
  663.  * RETURNS
  664.  *  void
  665.  *****************************************************************************/
  666. void mmi_uc_highlight_replace_video(void)
  667. {
  668.     /*----------------------------------------------------------------*/
  669.     /* Local Variables                                                */
  670.     /*----------------------------------------------------------------*/
  671.     /*----------------------------------------------------------------*/
  672.     /* Code Body                                                      */
  673.     /*----------------------------------------------------------------*/
  674.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_VIDEO;
  675.     
  676.     SetLeftSoftkeyFunction(mmi_uc_select_fmgr_object, KEY_EVENT_UP);
  677.     SetKeyHandler(mmi_uc_select_fmgr_object, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  678.     return;
  679. }
  680. /*****************************************************************************
  681.  * FUNCTION
  682.  *  mmi_uc_highlight_replace_attachment
  683.  * DESCRIPTION
  684.  *  Funtion is called when replace attachment menu item selected
  685.  * PARAMETERS
  686.  *  void
  687.  * RETURNS
  688.  *  void
  689.  *****************************************************************************/
  690. void mmi_uc_highlight_replace_attachment(void)
  691. {
  692.     /*----------------------------------------------------------------*/
  693.     /* Local Variables                                                */
  694.     /*----------------------------------------------------------------*/
  695.     /*----------------------------------------------------------------*/
  696.     /* Code Body                                                      */
  697.     /*----------------------------------------------------------------*/
  698.     g_uc_p->main.highlighted_object_type = MMI_UC_OBJECT_TYPE_ATTACHMENT;
  699.     
  700.     SetLeftSoftkeyFunction(mmi_uc_entry_attachment_list, KEY_EVENT_UP);
  701.     SetKeyHandler(mmi_uc_entry_attachment_list, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  702.     return;
  703. }
  704. /*****************************************************************************
  705.  * FUNCTION
  706.  *  mmi_uc_select_object_from_fm_to_replace
  707.  * DESCRIPTION
  708.  *  Select object from file manager
  709.  * PARAMETERS
  710.  *  filePath        [IN]        
  711.  *  is_short        [IN]        
  712.  * RETURNS
  713.  *  void
  714.  *****************************************************************************/
  715. void mmi_uc_select_object_from_fm_to_replace(PU16 filePath, S32 is_short)
  716. {
  717.     /*----------------------------------------------------------------*/
  718.     /* Local Variables                                                */
  719.     /*----------------------------------------------------------------*/
  720.     U8 mmi_uc_image_path[MMI_UC_MAX_TEMP_FILE_LEN];
  721.     mmi_uc_result result;
  722.     mma_insert_check_struct check_result;
  723.     mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
  724.     mmi_uc_object_struct* new_object = NULL;
  725.     mmi_uc_object_struct* duplicated_object = NULL;
  726.     mmi_uc_object_struct* replaced_object = NULL;
  727.     mmi_uc_attachment_info_struct* att = NULL;
  728.     mma_insert_type_enum mms_type = mmi_uc_convert_to_mms_insert_type(g_uc_p->main.highlighted_object_type);
  729.     U32 new_obj_smil_size = 0;
  730.     U32 replaced_obj_smil_size = 0;
  731.     U32 replaced_obj_body_size = 0;
  732.     U32 new_msg_size = 0;
  733.     /*----------------------------------------------------------------*/
  734.     /* Code Body                                                      */
  735.     /*----------------------------------------------------------------*/
  736.     memset(&check_result, 0, sizeof(mma_insert_check_struct));
  737.     memset(mmi_uc_image_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
  738.     
  739.     if (filePath == NULL)
  740.     {
  741.         if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
  742.         {
  743.             if (g_uc_p->msg.total_attachment_num > 0)
  744.             {
  745.                 GoBackToHistory(SCR_ID_UC_OPT_ATTACHMENT_LIST);
  746.             }
  747.             else
  748.             {
  749.                 GoBackToHistory(SCR_ID_UC_OPT_REPLACE);
  750.             }
  751.         }
  752.         else
  753.         {
  754.             GoBackToHistory(SCR_ID_UC_OPT_REPLACE);
  755.         }
  756.         return;
  757.     }
  758.     mmi_uc_set_processing_screen(STR_UC_REPLACE_ID, STR_UC_PLEASE_WAIT_ID, IMG_GLOBAL_PROGRESS, 0);
  759.     mmi_uc_entry_processing_generic();
  760.     if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
  761.     {
  762.         if (g_uc_p->main.object_index != MMI_UC_INVALID_INDEX)
  763.         {
  764.             att = mmi_uc_get_attachment_by_index(g_uc_p->main.object_index);
  765.             replaced_object = att->object;
  766.         }
  767.         else
  768.         {
  769.             DisplayPopup(
  770.                     (PU8) GetString(STR_UC_CONTENT_ERROR_ID),
  771.                     IMG_GLOBAL_UNFINISHED,
  772.                     1,
  773.                     MMI_UC_POPUP_TIME_OUT,
  774.                     (U8) ERROR_TONE);
  775.             DeleteUptoScrID(SCR_ID_UC_EDITOR);
  776.             return;
  777.         }
  778.     }
  779.     else
  780.     {
  781.         replaced_object = mmi_uc_get_object_in_slide(slide, g_uc_p->main.highlighted_object_type);
  782.         if (replaced_object == NULL)        
  783.         {
  784.             DisplayPopup(
  785.                     (PU8) GetString(STR_UC_CONTENT_ERROR_ID),
  786.                     IMG_GLOBAL_UNFINISHED,
  787.                     1,
  788.                     MMI_UC_POPUP_TIME_OUT,
  789.                     (U8) ERROR_TONE);
  790.             DeleteUptoScrID(SCR_ID_UC_EDITOR);
  791.             return;
  792.         }
  793.     }
  794.     if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_IMAGE &&
  795.         g_uc_p->mms_info.image_resize.enable)
  796.     {        
  797.         S32 resize_result;
  798.         MMI_UC_MAKE_IMAGE_FILE_PATH(mmi_uc_image_path, ++g_uc_p->main.image_no);
  799.         resize_result = mmi_uc_resize_image(
  800.                                 (U8*)filePath, 
  801.                                 mmi_uc_image_path, 
  802.                                 g_uc_p->mms_info.image_resize.width,
  803.                                 g_uc_p->mms_info.image_resize.height);
  804.         /* Error ! */
  805.         if (resize_result < 0)
  806.         {
  807.             /* Check if it is DRM file */
  808.             wap_mma_uc_insert_object_check(filePath, 
  809.                                            mms_type, 
  810.                                            g_uc_p->msg.msg_size, 
  811.                                            g_uc_p->mms_info.max_mms_size,
  812.                                            &check_result);
  813.             if (check_result.result == MMI_TRUE && check_result.drm_type == MMA_DRM_SD_NO_RIGHT)
  814.             {
  815.                 /* allows inserted but display default image for thumbnail. */
  816.             }
  817.             else
  818.             {            
  819.                 mmi_uc_display_resize_result_popup(resize_result);
  820.                 DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  821.                 return;
  822.             }
  823.             memset(&check_result, 0, sizeof(mma_insert_check_struct));
  824.         }
  825.         /* resized */
  826.         else if (resize_result)
  827.         {
  828.             filePath = (U16*)mmi_uc_image_path;
  829.         }
  830.         /* resize_result == 0 means no need to resize */
  831.     }
  832.     
  833.     duplicated_object = mmi_uc_check_duplicate_object(filePath);
  834.     
  835.     new_obj_smil_size = wap_mma_uc_calc_object_smil_size(mms_type, filePath);
  836.     replaced_obj_smil_size = wap_mma_uc_calc_object_smil_size(mmi_uc_convert_to_mms_insert_type(replaced_object->type),
  837.                                                          (const kal_wchar*)replaced_object->file_path);
  838.     if (g_uc_p->main.highlighted_object_type != MMI_UC_OBJECT_TYPE_ATTACHMENT &&
  839.         duplicated_object &&
  840.         duplicated_object->type != MMI_UC_OBJECT_TYPE_ATTACHMENT)
  841.     {        
  842.         /* if the original object and the new object are the same, no need to delete the original object. */
  843.         if (replaced_object->reference_count == 1 &&
  844.             replaced_object != duplicated_object)
  845.         {
  846.             replaced_obj_body_size = wap_mma_uc_calc_object_multipart_size(replaced_object->file_path);
  847.         }
  848.         else
  849.         {
  850.             replaced_obj_body_size = 0;
  851.         }
  852.         new_msg_size = g_uc_p->msg.msg_size + new_obj_smil_size - replaced_obj_smil_size - replaced_obj_body_size;
  853.         
  854.         if (!mmi_uc_check_if_exceed_MMS_size_limitation(new_msg_size))
  855.         {           
  856.             replaced_object->reference_count--;        
  857.             mmi_uc_insert_object_to_slide(duplicated_object, slide, g_uc_p->main.highlighted_object_type);
  858.             if (replaced_object->reference_count == 0)
  859.             {
  860.                 mmi_uc_delete_object_from_list(replaced_object);
  861.             }
  862.             
  863.         }
  864.         else
  865.         {
  866.             mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
  867.             DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  868.             if (pfnUnicodeStrlen((S8*)mmi_uc_image_path))
  869.             {
  870.                 FS_Delete((WCHAR*)mmi_uc_image_path);
  871.             }
  872.             return;
  873.         }
  874.     }
  875.     else
  876.     {
  877.         if (replaced_object->reference_count == 1)
  878.         {
  879.             replaced_obj_body_size = wap_mma_uc_calc_object_multipart_size(replaced_object->file_path);
  880.         }
  881.         else
  882.         {
  883.             replaced_obj_body_size = 0;
  884.         }
  885.         new_msg_size = g_uc_p->msg.msg_size - replaced_obj_smil_size - replaced_obj_body_size;
  886.     
  887.         wap_mma_uc_insert_object_check(filePath, 
  888.                                        mms_type, 
  889.                                        new_msg_size, 
  890.                                        g_uc_p->mms_info.max_mms_size,
  891.                                        &check_result);
  892.         
  893.         if (!(check_result.result))
  894.         {
  895.             result = mmi_uc_convert_mms_check_result(&check_result);
  896.             mmi_uc_display_popup(result);
  897.             DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  898.             if (pfnUnicodeStrlen((S8*)mmi_uc_image_path))
  899.             {
  900.                 FS_Delete((WCHAR*)mmi_uc_image_path);
  901.             }
  902.             return;
  903.         }
  904.         replaced_object->reference_count--;        
  905.         
  906.         if (replaced_object->reference_count == 0)
  907.         {
  908.             mmi_uc_delete_object_from_list(replaced_object);
  909.         }
  910.         
  911.         new_object = mmi_uc_insert_object((S8*) filePath, g_uc_p->main.highlighted_object_type);
  912.         new_object->drm_type = check_result.drm_type;
  913.         if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
  914.         {            
  915.             mmi_uc_insert_object_to_attachment(new_object, att);
  916.         }
  917.         else
  918.         {
  919.             mmi_uc_insert_object_to_slide(new_object, slide, g_uc_p->main.highlighted_object_type);            
  920.             
  921.         }       
  922.     }
  923.     fmgr_reset_app_select();    
  924.             
  925.     if (mmi_uc_change_msg_type_if_needed())
  926.     {
  927.         mmi_uc_insert_signature_check();
  928.     }
  929.     mmi_uc_update_msg_size();
  930.     mmi_uc_editor_initialize();
  931.     mmi_uc_set_editor_info(g_uc_p->msg.current_slide);
  932.     
  933.     if (g_uc_p->main.highlighted_object_type == MMI_UC_OBJECT_TYPE_ATTACHMENT)
  934.     {
  935.         if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
  936.         {
  937.             GoBackToHistory(SCR_ID_UC_OPT_ATTACHMENT_LIST);
  938.         }
  939.         else
  940.         {
  941.             U16 screen_id = 0;
  942.             if (GetNextScrnIdOf(SCR_ID_UC_OPT_ATTACHMENT_LIST,&screen_id))
  943.             {
  944.                 DeleteBetweenScreen(screen_id,  SCR_ID_UC_PROCESSING);
  945.             }
  946.             else
  947.             {
  948.                 MMI_ASSERT(0);
  949.                 DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  950.             }            
  951.         }        
  952.     }
  953.     else
  954.     {        
  955.         if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
  956.         {
  957.             GoBackToHistory(SCR_ID_UC_EDITOR);
  958.         }
  959.         else
  960.         {
  961.             U16 screen_id = 0;
  962.             if (GetNextScrnIdOf(SCR_ID_UC_EDITOR,&screen_id))
  963.             {
  964.                 DeleteBetweenScreen(screen_id,  SCR_ID_UC_PROCESSING);
  965.             }
  966.             else
  967.             {
  968.                 MMI_ASSERT(0);
  969.                 DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  970.             }            
  971.             
  972.         }        
  973.     }        
  974.     return;
  975. }
  976. /*****************************************************************************
  977.  * FUNCTION
  978.  *  mmi_uc_entry_slide_opt
  979.  * DESCRIPTION
  980.  *  Entry function for slide option
  981.  * PARAMETERS
  982.  *  void
  983.  * RETURNS
  984.  *  void
  985.  *****************************************************************************/
  986. void mmi_uc_entry_slide_opt(void)
  987. {
  988.     /*----------------------------------------------------------------*/
  989.     /* Local Variables                                                */
  990.     /*----------------------------------------------------------------*/
  991.     U8 *guiBuffer = NULL;
  992.     U16 numItems = 0;
  993.     U16 nStrItemList[MAX_SUB_MENUS];
  994.     /*----------------------------------------------------------------*/
  995.     /* Code Body                                                      */
  996.     /*----------------------------------------------------------------*/
  997.     EntryNewScreen(SCR_ID_UC_OPT_SLIDE_OPT, mmi_uc_exit_generic, mmi_uc_entry_slide_opt, NULL);
  998.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_slide_opt *n"));
  999.     
  1000.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SLIDE_OPT);
  1001.     if (g_uc_p->msg.total_slide_num < MMI_UC_MAX_MMS_SLIDE_NUM)
  1002.     {
  1003.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_INSERT);
  1004.     }
  1005.     else
  1006.     {
  1007.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_INSERT);
  1008.     }
  1009.     if (g_uc_p->msg.total_slide_num > 1)
  1010.     {
  1011.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_DELETE);
  1012.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_GO_TO);
  1013.     }
  1014.     else
  1015.     {
  1016.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_DELETE);
  1017.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_GO_TO);
  1018.     }
  1019.     if (g_uc_p->msg.current_slide->previous)
  1020.     {
  1021.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_PREVIOUS);
  1022.     }
  1023.     else
  1024.     {
  1025.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_PREVIOUS);
  1026.     }
  1027.     if (g_uc_p->msg.current_slide->next)
  1028.     {
  1029.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_NEXT);
  1030.     }
  1031.     else
  1032.     {
  1033.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_NEXT);
  1034.     }    
  1035.     if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
  1036.     {
  1037.         mmi_frm_unhide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_TIMING);
  1038.     }
  1039.     else
  1040.     {
  1041.         mmi_frm_hide_menu_item(MENU_ID_UC_OPT_SLIDE_OPT_TIMING);
  1042.     }
  1043.     numItems = GetNumOfChild_Ext(MENU_ID_UC_OPT_SLIDE_OPT);
  1044.     GetSequenceStringIds_Ext(MENU_ID_UC_OPT_SLIDE_OPT, nStrItemList);
  1045.     SetParentHandler(MENU_ID_UC_OPT_SLIDE_OPT);
  1046.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1047.     ShowCategory52Screen(
  1048.         STR_UC_SLIDE_OPTION_ID,
  1049.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  1050.         STR_GLOBAL_OK,
  1051.         IMG_GLOBAL_OK,
  1052.         STR_GLOBAL_BACK,
  1053.         IMG_GLOBAL_BACK,
  1054.         numItems,
  1055.         nStrItemList,
  1056.         (U16*) gIndexIconsImageList,
  1057.         NULL,
  1058.         0,
  1059.         0,
  1060.         guiBuffer);    
  1061.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1062.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1063. }
  1064. /*****************************************************************************
  1065.  * FUNCTION
  1066.  *  mmi_uc_entry_insert_slide
  1067.  * DESCRIPTION
  1068.  *  insert new slide
  1069.  * PARAMETERS
  1070.  *  void
  1071.  * RETURNS
  1072.  *  void
  1073.  *****************************************************************************/
  1074. void mmi_uc_entry_insert_slide(void)
  1075. {
  1076.     /*----------------------------------------------------------------*/
  1077.     /* Local Variables                                                */
  1078.     /*----------------------------------------------------------------*/
  1079.     U32 new_slide_size = 0;
  1080.     mmi_uc_slide_struct* slide;
  1081.     /*----------------------------------------------------------------*/
  1082.     /* Code Body                                                      */
  1083.     /*----------------------------------------------------------------*/
  1084.     new_slide_size = wap_mma_uc_calc_object_smil_size(MMA_INSERT_EMPTY_SLIDE, NULL);
  1085.     if (!mmi_uc_check_if_exceed_MMS_size_limitation(new_slide_size + g_uc_p->msg.msg_size))
  1086.     {
  1087.         slide = mmi_uc_insert_slide(g_uc_p->msg.current_slide);
  1088.         g_uc_p->msg.current_slide = slide;
  1089.         g_uc_p->msg.current_slide_num = slide->slide_num;
  1090.         
  1091.         if (mmi_uc_change_msg_type_if_needed())
  1092.         {
  1093.             mmi_uc_insert_signature_check();
  1094.         }
  1095.         
  1096.         mmi_uc_update_msg_size();
  1097.         mmi_uc_switch_slide(g_uc_p->msg.current_slide);
  1098.         //mmi_uc_reset_text_buffer();
  1099.         //mmi_uc_editor_initialize();
  1100.         GoBackToHistory(SCR_ID_UC_EDITOR);
  1101.     }
  1102.     else
  1103.     {
  1104.         mmi_uc_display_popup(MMI_UC_SIZE_EXCEEDS);
  1105.         return;
  1106.     }    
  1107. }
  1108. /*****************************************************************************
  1109.  * FUNCTION
  1110.  *  mmi_uc_entry_delete_slide
  1111.  * DESCRIPTION
  1112.  *  insert new slide
  1113.  * PARAMETERS
  1114.  *  void
  1115.  * RETURNS
  1116.  *  void
  1117.  *****************************************************************************/
  1118. void mmi_uc_entry_delete_slide(void)
  1119. {
  1120.     /*----------------------------------------------------------------*/
  1121.     /* Local Variables                                                */
  1122.     /*----------------------------------------------------------------*/
  1123.     mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
  1124.     /*----------------------------------------------------------------*/
  1125.     /* Code Body                                                      */
  1126.     /*----------------------------------------------------------------*/
  1127.     if (slide->next)
  1128.     {
  1129.         g_uc_p->msg.current_slide = slide->next;
  1130.     }
  1131.     else if (slide->previous)
  1132.     {
  1133.         g_uc_p->msg.current_slide = slide->previous;
  1134.     }
  1135.     else
  1136.     {
  1137.        g_uc_p->msg.current_slide = NULL;
  1138.     }     
  1139.     mmi_uc_delete_slide_with_object(slide);
  1140.     g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
  1141.     mmi_uc_switch_slide(g_uc_p->msg.current_slide);
  1142.     if (mmi_uc_change_msg_type_if_needed())
  1143.     {
  1144.         mmi_uc_insert_signature_check();
  1145.     }
  1146.     mmi_uc_update_msg_size();
  1147.     GoBackToHistory(SCR_ID_UC_EDITOR);
  1148. }
  1149. /*****************************************************************************
  1150.  * FUNCTION
  1151.  *  mmi_uc_entry_previous_slide
  1152.  * DESCRIPTION
  1153.  *  Go to previous slide
  1154.  * PARAMETERS
  1155.  *  void
  1156.  * RETURNS
  1157.  *  void
  1158.  *****************************************************************************/
  1159. void mmi_uc_entry_previous_slide(void)
  1160. {
  1161.     /*----------------------------------------------------------------*/
  1162.     /* Local Variables                                                */
  1163.     /*----------------------------------------------------------------*/
  1164.     mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
  1165.     /*----------------------------------------------------------------*/
  1166.     /* Code Body                                                      */
  1167.     /*----------------------------------------------------------------*/    
  1168.     MMI_ASSERT(slide->previous);
  1169.     
  1170.     g_uc_p->msg.current_slide = slide->previous;
  1171.     g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
  1172.     mmi_uc_switch_slide(g_uc_p->msg.current_slide);
  1173.     GoBackToHistory(SCR_ID_UC_EDITOR);
  1174. }
  1175. /*****************************************************************************
  1176.  * FUNCTION
  1177.  *  mmi_uc_entry_next_slide
  1178.  * DESCRIPTION
  1179.  *  Go to next slide
  1180.  * PARAMETERS
  1181.  *  void
  1182.  * RETURNS
  1183.  *  void
  1184.  *****************************************************************************/
  1185. void mmi_uc_entry_next_slide(void)
  1186. {
  1187.     /*----------------------------------------------------------------*/
  1188.     /* Local Variables                                                */
  1189.     /*----------------------------------------------------------------*/
  1190.     mmi_uc_slide_struct* slide = g_uc_p->msg.current_slide;
  1191.     /*----------------------------------------------------------------*/
  1192.     /* Code Body                                                      */
  1193.     /*----------------------------------------------------------------*/    
  1194.     MMI_ASSERT(slide->next);
  1195.     
  1196.     g_uc_p->msg.current_slide = slide->next;
  1197.     g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
  1198.     mmi_uc_switch_slide(g_uc_p->msg.current_slide);
  1199.     GoBackToHistory(SCR_ID_UC_EDITOR);
  1200. }
  1201. /*****************************************************************************
  1202.  * FUNCTION
  1203.  *  mmi_uc_entry_goto_slide
  1204.  * DESCRIPTION
  1205.  *  Entry screen to edit slide number to enter
  1206.  * PARAMETERS
  1207.  *  void
  1208.  * RETURNS
  1209.  *  void
  1210.  *****************************************************************************/
  1211. void mmi_uc_entry_goto_slide(void)
  1212. {
  1213.     /*----------------------------------------------------------------*/
  1214.     /* Local Variables                                                */
  1215.     /*----------------------------------------------------------------*/
  1216.     U8 *guiBuffer;
  1217.     U8 slide_number_digit = 0;
  1218.     U32 max_slide_number = MMI_UC_MAX_MMS_SLIDE_NUM;
  1219.     /*----------------------------------------------------------------*/
  1220.     /* Code Body                                                      */
  1221.     /*----------------------------------------------------------------*/
  1222.     EntryNewScreen(SCR_ID_UC_OPT_SLIDE_OPT_GOTO, NULL, mmi_uc_entry_goto_slide, NULL);
  1223.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SLIDE_OPT_GOTO);
  1224.     if (max_slide_number < 10)
  1225.     {
  1226.         slide_number_digit = 2;
  1227.     }
  1228.     else if (max_slide_number < 100)
  1229.     {
  1230.         slide_number_digit = 3;
  1231.     }
  1232.     else if (max_slide_number < 1000)
  1233.     {
  1234.         slide_number_digit = 4;
  1235.     }
  1236.     else if (max_slide_number < 10000)
  1237.     {
  1238.         slide_number_digit = 5;
  1239.     }
  1240.     else if (max_slide_number < 100000)
  1241.     {
  1242.         slide_number_digit = 6;
  1243.     }
  1244.     else
  1245.     {
  1246.         MMI_ASSERT(0);
  1247.     }
  1248.     ShowCategory5Screen(
  1249.         STR_UC_GO_TO_SOME_SLIDE_ID,
  1250.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  1251.         STR_GLOBAL_OK,
  1252.         0,
  1253.         STR_GLOBAL_BACK,
  1254.         0,
  1255.         INPUT_TYPE_NUMERIC,
  1256.         (U8*) g_uc_p->main.slide_number,
  1257.         slide_number_digit,
  1258.         guiBuffer);
  1259.     
  1260.     SetLeftSoftkeyFunction(mmi_uc_entry_goto_slide_done, KEY_EVENT_UP);
  1261.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);   
  1262. }
  1263.       
  1264. /*****************************************************************************
  1265.  * FUNCTION
  1266.  *  mmi_uc_entry_goto_slide_done
  1267.  * DESCRIPTION
  1268.  *  Goto slide
  1269.  * PARAMETERS
  1270.  *  void
  1271.  * RETURNS
  1272.  *  void
  1273.  *****************************************************************************/
  1274. void mmi_uc_entry_goto_slide_done(void)
  1275. {
  1276.     /*----------------------------------------------------------------*/
  1277.     /* Local Variables                                                */
  1278.     /*----------------------------------------------------------------*/
  1279.     S8 ascii_buff[10];
  1280.     U16 slide_number;
  1281.     /*----------------------------------------------------------------*/
  1282.     /* Code Body                                                      */
  1283.     /*----------------------------------------------------------------*/
  1284.     UnicodeToAnsii((S8*)ascii_buff, (S8*)g_uc_p->main.slide_number);
  1285.     slide_number = (U16) atoi(ascii_buff);
  1286.     if (slide_number == 0 || 
  1287.         slide_number > g_uc_p->msg.total_slide_num)
  1288.     {        
  1289.         DisplayPopup((PU8) GetString(STR_GLOBAL_INVALID),
  1290.                      IMG_GLOBAL_UNFINISHED,
  1291.                      1,
  1292.                      MMI_UC_POPUP_TIME_OUT,
  1293.                      (U8) ERROR_TONE);
  1294.     }
  1295.     else
  1296.     {
  1297.         mmi_uc_slide_struct* slide = g_uc_p->msg.slide_head;
  1298.         U32 i = 1;
  1299.         MMI_ASSERT(slide);
  1300.         for (; i < slide_number; i++)
  1301.         {            
  1302.             slide = slide->next;
  1303.             MMI_ASSERT(slide);
  1304.         }
  1305.         
  1306.         g_uc_p->msg.current_slide = slide;
  1307.         g_uc_p->msg.current_slide_num = g_uc_p->msg.current_slide->slide_num;
  1308.         mmi_uc_switch_slide(g_uc_p->msg.current_slide);
  1309.         GoBackToHistory(SCR_ID_UC_EDITOR);
  1310.     }
  1311. }
  1312. /*****************************************************************************
  1313.  * FUNCTION
  1314.  *  mmi_uc_entry_slide_timing
  1315.  * DESCRIPTION
  1316.  *  Entry screen to edit slide timing
  1317.  * PARAMETERS
  1318.  *  void
  1319.  * RETURNS
  1320.  *  void
  1321.  *****************************************************************************/
  1322. void mmi_uc_entry_slide_timing(void)
  1323. {
  1324.     /*----------------------------------------------------------------*/
  1325.     /* Local Variables                                                */
  1326.     /*----------------------------------------------------------------*/
  1327.     U8 *guiBuffer;
  1328.     /*----------------------------------------------------------------*/
  1329.     /* Code Body                                                      */
  1330.     /*----------------------------------------------------------------*/
  1331.     EntryNewScreen(SCR_ID_UC_OPT_SLIDE_OPT_SLIDE_TIMING, NULL, mmi_uc_entry_slide_timing, NULL);
  1332.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SLIDE_OPT_SLIDE_TIMING);
  1333.     
  1334.     ShowCategory5Screen(
  1335.         STR_UC_SLIDE_TIMING_ID,
  1336.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  1337.         STR_GLOBAL_OK,
  1338.         0,
  1339.         STR_GLOBAL_BACK,
  1340.         0,
  1341.         INPUT_TYPE_NUMERIC,
  1342.         (U8*) g_uc_p->main.slide_timing,
  1343.         (MMI_UC_MAX_SLIDE_TIMING_DIGIT + 1),
  1344.         guiBuffer);
  1345.     
  1346.     SetLeftSoftkeyFunction(mmi_uc_entry_slide_timing_done, KEY_EVENT_UP);
  1347.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);   
  1348. }
  1349.       
  1350. /*****************************************************************************
  1351.  * FUNCTION
  1352.  *  mmi_uc_entry_slide_timing_done
  1353.  * DESCRIPTION
  1354.  *  Set slide timing and go back to editor
  1355.  * PARAMETERS
  1356.  *  void
  1357.  * RETURNS
  1358.  *  void
  1359.  *****************************************************************************/
  1360. void mmi_uc_entry_slide_timing_done(void)
  1361. {
  1362.     /*----------------------------------------------------------------*/
  1363.     /* Local Variables                                                */
  1364.     /*----------------------------------------------------------------*/
  1365.     S8 ascii_buff[6];
  1366.     U16 slide_timing;
  1367.     /*----------------------------------------------------------------*/
  1368.     /* Code Body                                                      */
  1369.     /*----------------------------------------------------------------*/
  1370.     UnicodeToAnsii((S8*)ascii_buff, (S8*)g_uc_p->main.slide_timing);
  1371.     slide_timing = (U16) atoi(ascii_buff);
  1372.     if (slide_timing < g_uc_p->mms_info.sliding_time.min || 
  1373.         slide_timing > g_uc_p->mms_info.sliding_time.max )
  1374.     {        
  1375.         DisplayPopup((PU8) GetString(STR_GLOBAL_INVALID),
  1376.                      IMG_GLOBAL_UNFINISHED,
  1377.                      1,
  1378.                      MMI_UC_POPUP_TIME_OUT,
  1379.                      (U8) ERROR_TONE);
  1380.     }
  1381.     else
  1382.     {
  1383.         g_uc_p->msg.slide_timing = slide_timing;
  1384.         GoBackToHistory(SCR_ID_UC_EDITOR);
  1385.     }
  1386. }
  1387. /*****************************************************************************
  1388.  * FUNCTION
  1389.  *  mmi_uc_highlight_slide_opt_insert
  1390.  * DESCRIPTION
  1391.  *  Funtion is called when insert slide menu item selected
  1392.  * PARAMETERS
  1393.  *  void
  1394.  * RETURNS
  1395.  *  void
  1396.  *****************************************************************************/
  1397. void mmi_uc_highlight_slide_opt_insert(void)
  1398. {
  1399.     /*----------------------------------------------------------------*/
  1400.     /* Local Variables                                                */
  1401.     /*----------------------------------------------------------------*/
  1402.     /*----------------------------------------------------------------*/
  1403.     /* Code Body                                                      */
  1404.     /*----------------------------------------------------------------*/    
  1405.     SetLeftSoftkeyFunction(mmi_uc_entry_insert_slide, KEY_EVENT_UP);
  1406.     SetKeyHandler(mmi_uc_entry_insert_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1407.     return;
  1408. }
  1409. /*****************************************************************************
  1410.  * FUNCTION
  1411.  *  mmi_uc_highlight_slide_opt_delete
  1412.  * DESCRIPTION
  1413.  *  Funtion is called when delete slide menu item selected
  1414.  * PARAMETERS
  1415.  *  void
  1416.  * RETURNS
  1417.  *  void
  1418.  *****************************************************************************/
  1419. void mmi_uc_highlight_slide_opt_delete(void)
  1420. {
  1421.     /*----------------------------------------------------------------*/
  1422.     /* Local Variables                                                */
  1423.     /*----------------------------------------------------------------*/
  1424.     /*----------------------------------------------------------------*/
  1425.     /* Code Body                                                      */
  1426.     /*----------------------------------------------------------------*/    
  1427.     SetLeftSoftkeyFunction(mmi_uc_entry_delete_slide, KEY_EVENT_UP);
  1428.     SetKeyHandler(mmi_uc_entry_delete_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1429.     return;
  1430. }
  1431. /*****************************************************************************
  1432.  * FUNCTION
  1433.  *  mmi_uc_highlight_slide_opt_previous
  1434.  * DESCRIPTION
  1435.  *  Funtion is called when previous slide menu item selected
  1436.  * PARAMETERS
  1437.  *  void
  1438.  * RETURNS
  1439.  *  void
  1440.  *****************************************************************************/
  1441. void mmi_uc_highlight_slide_opt_previous(void)
  1442. {
  1443.     /*----------------------------------------------------------------*/
  1444.     /* Local Variables                                                */
  1445.     /*----------------------------------------------------------------*/
  1446.     /*----------------------------------------------------------------*/
  1447.     /* Code Body                                                      */
  1448.     /*----------------------------------------------------------------*/    
  1449.     SetLeftSoftkeyFunction(mmi_uc_entry_previous_slide, KEY_EVENT_UP);
  1450.     SetKeyHandler(mmi_uc_entry_previous_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1451.     return;
  1452. }
  1453. /*****************************************************************************
  1454.  * FUNCTION
  1455.  *  mmi_uc_highlight_slide_opt_next
  1456.  * DESCRIPTION
  1457.  *  Funtion is called when next slide menu item selected
  1458.  * PARAMETERS
  1459.  *  void
  1460.  * RETURNS
  1461.  *  void
  1462.  *****************************************************************************/
  1463. void mmi_uc_highlight_slide_opt_next(void)
  1464. {
  1465.     /*----------------------------------------------------------------*/
  1466.     /* Local Variables                                                */
  1467.     /*----------------------------------------------------------------*/
  1468.     /*----------------------------------------------------------------*/
  1469.     /* Code Body                                                      */
  1470.     /*----------------------------------------------------------------*/    
  1471.     SetLeftSoftkeyFunction(mmi_uc_entry_next_slide, KEY_EVENT_UP);
  1472.     SetKeyHandler(mmi_uc_entry_next_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1473.     return;
  1474. }
  1475. /*****************************************************************************
  1476.  * FUNCTION
  1477.  *  mmi_uc_highlight_slide_opt_goto
  1478.  * DESCRIPTION
  1479.  *  Funtion is called when goto slide menu item selected
  1480.  * PARAMETERS
  1481.  *  void
  1482.  * RETURNS
  1483.  *  void
  1484.  *****************************************************************************/
  1485. void mmi_uc_highlight_slide_opt_goto(void)
  1486. {
  1487.     /*----------------------------------------------------------------*/
  1488.     /* Local Variables                                                */
  1489.     /*----------------------------------------------------------------*/
  1490.     /*----------------------------------------------------------------*/
  1491.     /* Code Body                                                      */
  1492.     /*----------------------------------------------------------------*/
  1493.     memset(g_uc_p->main.slide_number, 0, sizeof(g_uc_p->main.slide_number));
  1494.     SetLeftSoftkeyFunction(mmi_uc_entry_goto_slide, KEY_EVENT_UP);
  1495.     SetKeyHandler(mmi_uc_entry_goto_slide, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1496.     return;
  1497. }
  1498. /*****************************************************************************
  1499.  * FUNCTION
  1500.  *  mmi_uc_highlight_slide_opt_timing
  1501.  * DESCRIPTION
  1502.  *  Funtion is called when slide timing menu item selected
  1503.  * PARAMETERS
  1504.  *  void
  1505.  * RETURNS
  1506.  *  void
  1507.  *****************************************************************************/
  1508. void mmi_uc_highlight_slide_opt_timing(void)
  1509. {
  1510.     /*----------------------------------------------------------------*/
  1511.     /* Local Variables                                                */
  1512.     /*----------------------------------------------------------------*/
  1513.     /*----------------------------------------------------------------*/
  1514.     /* Code Body                                                      */
  1515.     /*----------------------------------------------------------------*/    
  1516.     kal_wsprintf( (kal_uint16 *)g_uc_p->main.slide_timing, "%d", g_uc_p->msg.slide_timing); 
  1517.     SetLeftSoftkeyFunction(mmi_uc_entry_slide_timing, KEY_EVENT_UP);
  1518.     SetKeyHandler(mmi_uc_entry_slide_timing, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1519.     return;
  1520. }
  1521. /*****************************************************************************
  1522.  * FUNCTION
  1523.  *  mmi_uc_save_msg_type
  1524.  * DESCRIPTION
  1525.  *  Save msg type
  1526.  * PARAMETERS
  1527.  *  void
  1528.  * RETURNS
  1529.  *  void
  1530.  *****************************************************************************/
  1531. void mmi_uc_save_msg_type(void)
  1532. {
  1533.     /*----------------------------------------------------------------*/
  1534.     /* Local Variables                                                */
  1535.     /*----------------------------------------------------------------*/
  1536.     /*----------------------------------------------------------------*/
  1537.     /* Code Body                                                      */
  1538.     /*----------------------------------------------------------------*/
  1539.     if (g_uc_p->main.object_index == 0)
  1540.     {
  1541.         g_uc_p->msg_type.curr_msg_type = MMI_UC_MSG_TYPE_SMS_PREFER;
  1542.         g_uc_p->msg_type.caller_specific_msg_type = MMI_UC_MSG_TYPE_SMS_PREFER;
  1543.     }
  1544.     else if (g_uc_p->main.object_index == 1)
  1545.     {
  1546.         g_uc_p->msg_type.curr_msg_type = MMI_UC_MSG_TYPE_MMS_PREFER;
  1547.         g_uc_p->msg_type.caller_specific_msg_type = MMI_UC_MSG_TYPE_MMS_PREFER;
  1548.     }
  1549.     else
  1550.     {
  1551.         MMI_ASSERT(0);
  1552.     }
  1553.     mmi_uc_insert_signature_check();
  1554.     
  1555.     DisplayPopup(
  1556.             (PU8) GetString(STR_GLOBAL_DONE),
  1557.             IMG_GLOBAL_OK,
  1558.             1,
  1559.             MMI_UC_POPUP_TIME_OUT,
  1560.             (U8) SUCCESS_TONE);
  1561.     
  1562.     if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
  1563.         g_uc_p->main.state == MMI_UC_STATE_SEND)
  1564.     {
  1565.         /* Prevent the msg change ind popup display */
  1566.         g_uc_p->done.pre_msg_type = g_uc_p->msg_type.curr_msg_type;
  1567.         
  1568.         if (IsScreenPresent(SCR_ID_UC_OPT_DONE_OPT))
  1569.         {
  1570.             DeleteUptoScrID(SCR_ID_UC_OPT_DONE_OPT);
  1571.         }
  1572.         else
  1573.         {
  1574.             MMI_ASSERT(0);
  1575.         }
  1576.     }
  1577.     else
  1578.     {
  1579.         if (IsScreenPresent(SCR_ID_UC_EDITOR))
  1580.         {
  1581.             DeleteUptoScrID(SCR_ID_UC_EDITOR);
  1582.         }
  1583.         else
  1584.         {
  1585.             MMI_ASSERT(0);
  1586.         }
  1587.     }
  1588. }
  1589.           
  1590. /*****************************************************************************
  1591. * FUNCTION
  1592. *  mmi_uc_entry_msg_type
  1593. * DESCRIPTION
  1594. *  Entry msg type screen
  1595. * PARAMETERS
  1596. *  void
  1597. * RETURNS
  1598. *  void
  1599. *****************************************************************************/
  1600. void mmi_uc_entry_msg_type(void)
  1601. {
  1602.    /*----------------------------------------------------------------*/
  1603.    /* Local Variables                                                */
  1604.    /*----------------------------------------------------------------*/
  1605.    U8 *guiBuffer;
  1606.    U16 nNumofItem = 2;
  1607.    S32 hiliteitem = 0;
  1608.    /*----------------------------------------------------------------*/
  1609.    /* Code Body                                                      */
  1610.    /*----------------------------------------------------------------*/
  1611.    EntryNewScreen(SCR_ID_UC_OPT_MSG_TYPE_OPT, mmi_uc_exit_generic, mmi_uc_entry_msg_type, NULL);
  1612.    subMenuDataPtrs[0] = (PU8) GetString(STR_UC_TEXT_MESSAGE_ID);
  1613.    subMenuDataPtrs[1] = (PU8) GetString(STR_UC_MULTIMEDIA_MESSAGE_ID);
  1614.    
  1615.    guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_MSG_TYPE_OPT);
  1616.    
  1617.    if ((guiBuffer != NULL))
  1618.    {
  1619.        hiliteitem = g_uc_p->main.object_index;
  1620.        MMI_ASSERT(hiliteitem < nNumofItem);
  1621.    }
  1622.    else
  1623.    {
  1624.         if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_SMS_PREFER)
  1625.         {
  1626.             hiliteitem = 0;     
  1627.         }
  1628.         else if (g_uc_p->msg_type.curr_msg_type == MMI_UC_MSG_TYPE_MMS_PREFER)
  1629.         {
  1630.             hiliteitem = 1;
  1631.         }
  1632.         else
  1633.         {
  1634.             MMI_ASSERT(0);
  1635.         }
  1636.    }
  1637.    
  1638.    RegisterHighlightHandler(mmi_uc_set_index);
  1639.    ShowCategory109Screen(
  1640.        STR_UC_MESSAGE_TYPE_ID,
  1641.        IMG_UC_ENTRY_SCRN_CAPTION_ID,
  1642.        STR_GLOBAL_OK,
  1643.        IMG_GLOBAL_OK,
  1644.        STR_GLOBAL_BACK,
  1645.        IMG_GLOBAL_BACK,
  1646.        nNumofItem,
  1647.        subMenuDataPtrs,
  1648.        NULL,
  1649.        hiliteitem,
  1650.        guiBuffer);
  1651.    
  1652.    SetLeftSoftkeyFunction(mmi_uc_save_msg_type, KEY_EVENT_UP);
  1653.    SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1654.    SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1655. }
  1656. /*****************************************************************************
  1657.  * FUNCTION
  1658.  *  mmi_uc_entry_send_opt
  1659.  * DESCRIPTION
  1660.  *  Entry function of send option
  1661.  * PARAMETERS
  1662.  *  void
  1663.  * RETURNS
  1664.  *  void
  1665.  *****************************************************************************/
  1666. void mmi_uc_entry_send_opt(void)
  1667. {
  1668.     /*----------------------------------------------------------------*/
  1669.     /* Local Variables                                                */
  1670.     /*----------------------------------------------------------------*/
  1671.     U8 *guiBuffer;
  1672.     U8 *inputBuffer = NULL;        /* added for inline edit history */
  1673.     U16 inputBufferSize;    /* added for inline edit history */
  1674.     U16 image_list[MMI_UC_SEND_OPT_TOTAL_NUM] = {0};
  1675.     /*----------------------------------------------------------------*/
  1676.     /* Code Body                                                      */
  1677.     /*----------------------------------------------------------------*/
  1678.     MMI_ASSERT(g_uc_p->msg_type.caller_specific_msg_type != MMI_UC_MSG_TYPE_SMS_ONLY);
  1679.     
  1680.     EntryNewScreen(SCR_ID_UC_OPT_SEND_OPT, mmi_uc_exit_send_opt, NULL, NULL);
  1681.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_send_opt *n"));
  1682.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_OPT_SEND_OPT);
  1683.     InitializeCategory57Screen();
  1684.     mmi_uc_send_opt_fill_inline_struct(image_list);
  1685.     if (guiBuffer)
  1686.     {
  1687.         inputBuffer = GetCurrNInputBuffer(SCR_ID_UC_OPT_SEND_OPT, &inputBufferSize); /* added for inline edit history */
  1688.     }
  1689.     if (inputBuffer)    /* added for inline edit history */
  1690.     {
  1691.         SetCategory57Data(wgui_inline_items, MMI_UC_SEND_OPT_TOTAL_NUM, inputBuffer);      /* sets the data */
  1692.     }
  1693.         
  1694.     ShowCategory57Screen(
  1695.         STR_UC_SEND_OPTION_ID,
  1696.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  1697.         0,
  1698.         0,
  1699.         STR_GLOBAL_BACK,
  1700.         IMG_GLOBAL_BACK,
  1701.         MMI_UC_SEND_OPT_TOTAL_NUM,
  1702.         image_list,
  1703.         wgui_inline_items,
  1704.         0,
  1705.         guiBuffer);
  1706.     
  1707.     /* set key hdlr */
  1708.     SetCategory57RightSoftkeyFunctions(GoBackHistory, GoBackHistory);
  1709.     SetCategory57RightSoftkeyFunctions(mmi_uc_send_opt_done_hdlr, GoBackHistory);
  1710.     
  1711. }
  1712. /*****************************************************************************
  1713.  * FUNCTION
  1714.  *  mmi_uc_exit_send_opt
  1715.  * DESCRIPTION
  1716.  *  Exit function of send option
  1717.  * PARAMETERS
  1718.  *  void
  1719.  * RETURNS
  1720.  *  void
  1721.  *****************************************************************************/
  1722. void mmi_uc_exit_send_opt(void)
  1723. {
  1724.     /*----------------------------------------------------------------*/
  1725.     /* Local Variables                                                */
  1726.     /*----------------------------------------------------------------*/
  1727.     history currHistory;
  1728.     U16 inputBufferSize = 0;
  1729.     S16 nHistory = 0;
  1730.     /*----------------------------------------------------------------*/
  1731.     /* Code Body                                                      */
  1732.     /*----------------------------------------------------------------*/
  1733.     CloseCategory57Screen();
  1734.     currHistory.scrnID = SCR_ID_UC_OPT_SEND_OPT;
  1735.     currHistory.entryFuncPtr = mmi_uc_entry_send_opt;
  1736.     pfnUnicodeStrcpy((S8*) currHistory.inputBuffer, (S8*) & nHistory);
  1737.     GetCategory57History(currHistory.guiBuffer);
  1738.     inputBufferSize = (U16) GetCategory57DataSize();
  1739.     GetCategory57Data((U8*) currHistory.inputBuffer);
  1740.     AddNHistory(currHistory, inputBufferSize);
  1741. }
  1742. /*****************************************************************************
  1743.  * FUNCTION
  1744.  *  mmi_uc_send_opt_fill_inline_struct
  1745.  * DESCRIPTION
  1746.  *  Fill inline item of send option menu
  1747.  * PARAMETERS
  1748.  *  void
  1749.  * RETURNS
  1750.  *  void
  1751.  *****************************************************************************/
  1752. void mmi_uc_send_opt_fill_inline_struct(U16* image_list)
  1753. {
  1754.     /*----------------------------------------------------------------*/
  1755.     /* Local Variables                                                */
  1756.     /*----------------------------------------------------------------*/
  1757.     /*----------------------------------------------------------------*/
  1758.     /* Code Body                                                      */
  1759.     /*----------------------------------------------------------------*/       
  1760.     image_list[MMI_UC_SEND_OPT_VALIDITY_PERIOD_CAPTION] = IMG_UC_VALIDITY_PERIOD_ID;
  1761.     image_list[MMI_UC_SEND_OPT_VALIDITY_PERIOD] = 0;
  1762.     image_list[MMI_UC_SEND_OPT_DELIVERY_REPORT_CAPTION] = IMG_UC_DELIVERY_REPORT_ID;
  1763.     image_list[MMI_UC_SEND_OPT_DELIVERY_REPORT] = 0;
  1764.     image_list[MMI_UC_SEND_OPT_READ_REPORT_CAPTION] = IMG_UC_READ_REPORT_ID;
  1765.     image_list[MMI_UC_SEND_OPT_READ_REPORT] = 0;
  1766.     image_list[MMI_UC_SEND_OPT_PRIORITY_CAPTION] = IMG_UC_PRIORITY_ID;
  1767.     image_list[MMI_UC_SEND_OPT_PRIORITY] = 0;
  1768.     image_list[MMI_UC_SEND_OPT_DELIVERY_TIME_CAPTION] = IMG_UC_DELIVERY_TIME_ID;
  1769.     image_list[MMI_UC_SEND_OPT_DELIVERY_TIME] = 0;        
  1770.     g_uc_p->send_opt.read_report_str[0] = (UI_string_type)GetString((U16) (STR_GLOBAL_OFF));
  1771.     g_uc_p->send_opt.read_report_str[1] = (UI_string_type)GetString((U16) (STR_GLOBAL_ON));
  1772.     g_uc_p->send_opt.read_report = g_uc_p->msg.read_report;
  1773.     g_uc_p->send_opt.delivery_report_str[0] = (UI_string_type)GetString((U16) (STR_GLOBAL_OFF));
  1774.     g_uc_p->send_opt.delivery_report_str[1] = (UI_string_type)GetString((U16) (STR_GLOBAL_ON));
  1775.     g_uc_p->send_opt.delivery_report = g_uc_p->msg.delivery_report;        
  1776.     g_uc_p->send_opt.priority_str[0] = (UI_string_type)GetString((U16) (STR_UC_PRIORITY_LOW_ID));
  1777.     g_uc_p->send_opt.priority_str[1] = (UI_string_type)GetString((U16) (STR_UC_PRIORITY_MEDIUM_ID));
  1778.     g_uc_p->send_opt.priority_str[2] = (UI_string_type)GetString((U16) (STR_UC_PRIORITY_HIGH_ID));
  1779.     g_uc_p->send_opt.priority = g_uc_p->msg.priority - 1;        
  1780.     g_uc_p->send_opt.validity_period_str[0] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_1_HOUR_ID));
  1781.     g_uc_p->send_opt.validity_period_str[1] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_12_HOUR_ID));
  1782.     g_uc_p->send_opt.validity_period_str[2] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_1_DAY_ID));
  1783.     g_uc_p->send_opt.validity_period_str[3] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_1_WEEK_ID));
  1784.     g_uc_p->send_opt.validity_period_str[4] = (UI_string_type)GetString((U16) (STR_UC_VALIDITY_PERIOD_MAX_ID));
  1785.     g_uc_p->send_opt.validity_period = g_uc_p->msg.expiry_time - 1;
  1786.     
  1787.     g_uc_p->send_opt.delivery_time_str[0] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_IMMEDIATE_ID));
  1788.     g_uc_p->send_opt.delivery_time_str[1] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_1_HOUR_ID));
  1789.     g_uc_p->send_opt.delivery_time_str[2] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_12_HOUR_ID));
  1790.     g_uc_p->send_opt.delivery_time_str[3] = (UI_string_type)GetString((U16) (STR_UC_DELIVERY_TIME_24_HOUR_ID));
  1791.     g_uc_p->send_opt.delivery_time = g_uc_p->msg.delivery_time - 1;                     
  1792.     
  1793.     /* Validity period */
  1794.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD_CAPTION], 
  1795.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1796.                             0);
  1797.     SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD_CAPTION],
  1798.                          (U8*) GetString(STR_UC_VALIDITY_PERIOD_ID));
  1799.     SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD],
  1800.                         5,
  1801.                         (U8 **) g_uc_p->send_opt.validity_period_str,
  1802.                         &g_uc_p->send_opt.validity_period);
  1803.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_VALIDITY_PERIOD], 
  1804.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 
  1805.                             0);
  1806.     /* Delivery Report */
  1807.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT_CAPTION], 
  1808.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1809.                             0);
  1810.     SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT_CAPTION],
  1811.                          (U8*) GetString(STR_UC_DELIVERY_REPORT_ID));
  1812.     SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT],
  1813.                         2,
  1814.                         (U8 **) g_uc_p->send_opt.delivery_report_str,
  1815.                         &g_uc_p->send_opt.delivery_report);
  1816.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_REPORT], 
  1817.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 
  1818.                             0);
  1819.     /* Read Report */
  1820.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT_CAPTION], 
  1821.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1822.                             0);
  1823.     SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT_CAPTION],
  1824.                          (U8*) GetString(STR_UC_READ_REPORT_ID));
  1825.     SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT],
  1826.                         2,
  1827.                         (U8 **) g_uc_p->send_opt.read_report_str,
  1828.                         &g_uc_p->send_opt.read_report);
  1829.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_READ_REPORT], 
  1830.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 
  1831.                             0);
  1832.     /* Priotiry */
  1833.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY_CAPTION], 
  1834.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1835.                             0);
  1836.     SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY_CAPTION],
  1837.                          (U8*) GetString(STR_UC_PRIORITY_ID));
  1838.     SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY],
  1839.                         3,
  1840.                         (U8 **) g_uc_p->send_opt.priority_str,
  1841.                         &g_uc_p->send_opt.priority);
  1842.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_PRIORITY], 
  1843.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 
  1844.                             0);
  1845.     /* Delivery Time */
  1846.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME_CAPTION], 
  1847.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT,
  1848.                             0);
  1849.     SetInlineItemCaption(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME_CAPTION],
  1850.                          (U8*) GetString(STR_UC_DELIVERY_TIME_ID));
  1851.     SetInlineItemSelect(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME],
  1852.                         4,
  1853.                         (U8 **) g_uc_p->send_opt.delivery_time_str,
  1854.                         &g_uc_p->send_opt.delivery_time);
  1855.     SetInlineItemActivation(&wgui_inline_items[MMI_UC_SEND_OPT_DELIVERY_TIME], 
  1856.                             INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 
  1857.                             0);
  1858. }
  1859. /*****************************************************************************
  1860.  * FUNCTION
  1861.  *  mmi_uc_send_opt_done_no_hdlr
  1862.  * DESCRIPTION
  1863.  *  Save the setting to context
  1864.  * PARAMETERS
  1865.  *  void
  1866.  * RETURNS
  1867.  *  void
  1868.  *****************************************************************************/
  1869. void mmi_uc_send_opt_done_no_hdlr(void)
  1870. {
  1871.     /*----------------------------------------------------------------*/
  1872.     /* Local Variables                                                */
  1873.     /*----------------------------------------------------------------*/
  1874.     /*----------------------------------------------------------------*/
  1875.     /* Code Body                                                      */
  1876.     /*----------------------------------------------------------------*/    
  1877.     if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
  1878.         g_uc_p->main.state == MMI_UC_STATE_SEND)
  1879.     {
  1880.         if (IsScreenPresent(SCR_ID_UC_OPT_DONE_OPT))
  1881.         {
  1882.             GoBackToHistory(SCR_ID_UC_OPT_DONE_OPT);
  1883.         }
  1884.         else
  1885.         {
  1886.             MMI_ASSERT(0);
  1887.         }
  1888.     }
  1889.     else
  1890.     {
  1891.         if (IsScreenPresent(SCR_ID_UC_EDITOR))
  1892.         {
  1893.             GoBackToHistory(SCR_ID_UC_EDITOR);
  1894.         }
  1895.         else
  1896.         {
  1897.             MMI_ASSERT(0);
  1898.         }
  1899.     }
  1900. }
  1901. /*****************************************************************************
  1902.  * FUNCTION
  1903.  *  mmi_uc_send_opt_done_yes_hdlr
  1904.  * DESCRIPTION
  1905.  *  Save the setting to context
  1906.  * PARAMETERS
  1907.  *  void
  1908.  * RETURNS
  1909.  *  void
  1910.  *****************************************************************************/
  1911. void mmi_uc_send_opt_done_yes_hdlr(void)
  1912. {
  1913.     /*----------------------------------------------------------------*/
  1914.     /* Local Variables                                                */
  1915.     /*----------------------------------------------------------------*/
  1916.     /*----------------------------------------------------------------*/
  1917.     /* Code Body                                                      */
  1918.     /*----------------------------------------------------------------*/
  1919.     DisplayPopup((PU8) GetString(STR_GLOBAL_DONE),
  1920.                  IMG_GLOBAL_OK,
  1921.                  1,
  1922.                  MMI_UC_POPUP_TIME_OUT,
  1923.                  (U8) SUCCESS_TONE);
  1924.     g_uc_p->msg.read_report = g_uc_p->send_opt.read_report;
  1925.     g_uc_p->msg.delivery_report = g_uc_p->send_opt.delivery_report;
  1926.     g_uc_p->msg.priority = g_uc_p->send_opt.priority + 1;
  1927.     g_uc_p->msg.expiry_time = g_uc_p->send_opt.validity_period + 1;
  1928.     g_uc_p->msg.delivery_time = g_uc_p->send_opt.delivery_time + 1;
  1929.     
  1930.     if (g_uc_p->main.state == MMI_UC_STATE_FORWARD ||
  1931.         g_uc_p->main.state == MMI_UC_STATE_SEND)
  1932.     {
  1933.         if (IsScreenPresent(SCR_ID_UC_OPT_DONE_OPT))
  1934.         {
  1935.             DeleteUptoScrID(SCR_ID_UC_OPT_DONE_OPT);
  1936.         }
  1937.         else
  1938.         {
  1939.             MMI_ASSERT(0);
  1940.         }
  1941.     }
  1942.     else
  1943.     {
  1944.         if (IsScreenPresent(SCR_ID_UC_EDITOR))
  1945.         {
  1946.             DeleteUptoScrID(SCR_ID_UC_EDITOR);
  1947.         }
  1948.         else
  1949.         {
  1950.             MMI_ASSERT(0);
  1951.         }
  1952.     }
  1953. }
  1954. /*****************************************************************************
  1955.  * FUNCTION
  1956.  *  mmi_uc_send_opt_done_hdlr
  1957.  * DESCRIPTION
  1958.  *  Save the setting to context
  1959.  * PARAMETERS
  1960.  *  void
  1961.  * RETURNS
  1962.  *  void
  1963.  *****************************************************************************/
  1964. void mmi_uc_send_opt_done_hdlr(void)
  1965. {
  1966.     /*----------------------------------------------------------------*/
  1967.     /* Local Variables                                                */
  1968.     /*----------------------------------------------------------------*/
  1969.     /*----------------------------------------------------------------*/
  1970.     /* Code Body                                                      */
  1971.     /*----------------------------------------------------------------*/
  1972.     DisplayConfirm(
  1973.             STR_GLOBAL_YES,
  1974.             IMG_GLOBAL_YES,
  1975.             STR_GLOBAL_NO,
  1976.             IMG_GLOBAL_NO,
  1977.             get_string(STR_GLOBAL_SAVE),
  1978.             IMG_GLOBAL_QUESTION,
  1979.             WARNING_TONE);
  1980.     
  1981.     SetLeftSoftkeyFunction(mmi_uc_send_opt_done_yes_hdlr, KEY_EVENT_UP);
  1982.     SetRightSoftkeyFunction(mmi_uc_send_opt_done_no_hdlr, KEY_EVENT_UP);
  1983. }
  1984. /*****************************************************************************
  1985.  * FUNCTION
  1986.  *  mmi_uc_entry_input_method_done
  1987.  * DESCRIPTION
  1988.  *  Funtion is called when type of input method is selected
  1989.  * PARAMETERS
  1990.  *  void
  1991.  * RETURNS
  1992.  *  void
  1993.  *****************************************************************************/
  1994. void mmi_uc_entry_input_method_done(void)
  1995. {
  1996.     /*----------------------------------------------------------------*/
  1997.     /* Local Variables                                                */
  1998.     /*----------------------------------------------------------------*/
  1999.     /*----------------------------------------------------------------*/
  2000.     /* Code Body                                                      */
  2001.     /*----------------------------------------------------------------*/   
  2002.     GoBackToHistory(SCR_ID_UC_EDITOR);
  2003. }
  2004. /*****************************************************************************
  2005.  * FUNCTION
  2006.  *  mmi_uc_highlight_opt_done
  2007.  * DESCRIPTION
  2008.  *  Funtion is called when done menu item selected
  2009.  * PARAMETERS
  2010.  *  void
  2011.  * RETURNS
  2012.  *  void
  2013.  *****************************************************************************/
  2014. void mmi_uc_highlight_opt_done(void)
  2015. {
  2016.     /*----------------------------------------------------------------*/
  2017.     /* Local Variables                                                */
  2018.     /*----------------------------------------------------------------*/
  2019.     /*----------------------------------------------------------------*/
  2020.     /* Code Body                                                      */
  2021.     /*----------------------------------------------------------------*/
  2022.     g_uc_p->done.pre_msg_type = g_uc_p->msg_type.curr_msg_type;
  2023.     
  2024.     SetLeftSoftkeyFunction(mmi_uc_entry_done, KEY_EVENT_UP);
  2025.     SetKeyHandler(mmi_uc_entry_done, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2026.     return;
  2027. }
  2028. /*****************************************************************************
  2029.  * FUNCTION
  2030.  *  mmi_uc_highlight_opt_insert
  2031.  * DESCRIPTION
  2032.  *  Funtion is called when insert menu item selected
  2033.  * PARAMETERS
  2034.  *  void
  2035.  * RETURNS
  2036.  *  void
  2037.  *****************************************************************************/
  2038. void mmi_uc_highlight_opt_insert(void)
  2039. {
  2040.     /*----------------------------------------------------------------*/
  2041.     /* Local Variables                                                */
  2042.     /*----------------------------------------------------------------*/
  2043.     /*----------------------------------------------------------------*/
  2044.     /* Code Body                                                      */
  2045.     /*----------------------------------------------------------------*/    
  2046.     SetLeftSoftkeyFunction(mmi_uc_entry_insert, KEY_EVENT_UP);
  2047.     SetKeyHandler(mmi_uc_entry_insert, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2048.     return;
  2049. }
  2050. /*****************************************************************************
  2051.  * FUNCTION
  2052.  *  mmi_uc_highlight_opt_remove
  2053.  * DESCRIPTION
  2054.  *  Funtion is called when remove menu item selected
  2055.  * PARAMETERS
  2056.  *  void
  2057.  * RETURNS
  2058.  *  void
  2059.  *****************************************************************************/
  2060. void mmi_uc_highlight_opt_remove(void)
  2061. {
  2062.     /*----------------------------------------------------------------*/
  2063.     /* Local Variables                                                */
  2064.     /*----------------------------------------------------------------*/
  2065.     /*----------------------------------------------------------------*/
  2066.     /* Code Body                                                      */
  2067.     /*----------------------------------------------------------------*/    
  2068.     SetLeftSoftkeyFunction(mmi_uc_entry_remove, KEY_EVENT_UP);
  2069.     SetKeyHandler(mmi_uc_entry_remove, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2070.     return;
  2071. }
  2072. /*****************************************************************************
  2073.  * FUNCTION
  2074.  *  mmi_uc_highlight_opt_replace
  2075.  * DESCRIPTION
  2076.  *  Funtion is called when replace menu item selected
  2077.  * PARAMETERS
  2078.  *  void
  2079.  * RETURNS
  2080.  *  void
  2081.  *****************************************************************************/
  2082. void mmi_uc_highlight_opt_replace(void)
  2083. {
  2084.     /*----------------------------------------------------------------*/
  2085.     /* Local Variables                                                */
  2086.     /*----------------------------------------------------------------*/
  2087.     /*----------------------------------------------------------------*/
  2088.     /* Code Body                                                      */
  2089.     /*----------------------------------------------------------------*/    
  2090.     SetLeftSoftkeyFunction(mmi_uc_entry_replace, KEY_EVENT_UP);
  2091.     SetKeyHandler(mmi_uc_entry_replace, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2092.     return;
  2093. }
  2094. /*****************************************************************************
  2095.  * FUNCTION
  2096.  *  mmi_uc_highlight_opt_slide_opt
  2097.  * DESCRIPTION
  2098.  *  Funtion is called when slide option menu item selected
  2099.  * PARAMETERS
  2100.  *  void
  2101.  * RETURNS
  2102.  *  void
  2103.  *****************************************************************************/
  2104. void mmi_uc_highlight_opt_slide_opt(void)
  2105. {
  2106.     /*----------------------------------------------------------------*/
  2107.     /* Local Variables                                                */
  2108.     /*----------------------------------------------------------------*/
  2109.     /*----------------------------------------------------------------*/
  2110.     /* Code Body                                                      */
  2111.     /*----------------------------------------------------------------*/    
  2112.     SetLeftSoftkeyFunction(mmi_uc_entry_slide_opt, KEY_EVENT_UP);
  2113.     SetKeyHandler(mmi_uc_entry_slide_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2114.     return;
  2115. }
  2116. /*****************************************************************************
  2117.  * FUNCTION
  2118.  *  mmi_uc_highlight_opt_msg_type
  2119.  * DESCRIPTION
  2120.  *  Funtion is called when msg type menu item selected
  2121.  * PARAMETERS
  2122.  *  void
  2123.  * RETURNS
  2124.  *  void
  2125.  *****************************************************************************/
  2126. void mmi_uc_highlight_opt_msg_type(void)
  2127. {
  2128.     /*----------------------------------------------------------------*/
  2129.     /* Local Variables                                                */
  2130.     /*----------------------------------------------------------------*/
  2131.     /*----------------------------------------------------------------*/
  2132.     /* Code Body                                                      */
  2133.     /*----------------------------------------------------------------*/    
  2134.     SetLeftSoftkeyFunction(mmi_uc_entry_msg_type, KEY_EVENT_UP);
  2135.     SetKeyHandler(mmi_uc_entry_msg_type, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2136.     return;
  2137. }
  2138. /*****************************************************************************
  2139.  * FUNCTION
  2140.  *  mmi_uc_highlight_opt_send_opt
  2141.  * DESCRIPTION
  2142.  *  Funtion is called when send option menu item selected
  2143.  * PARAMETERS
  2144.  *  void
  2145.  * RETURNS
  2146.  *  void
  2147.  *****************************************************************************/
  2148. void mmi_uc_highlight_opt_send_opt(void)
  2149. {
  2150.     /*----------------------------------------------------------------*/
  2151.     /* Local Variables                                                */
  2152.     /*----------------------------------------------------------------*/
  2153.     /*----------------------------------------------------------------*/
  2154.     /* Code Body                                                      */
  2155.     /*----------------------------------------------------------------*/    
  2156.     SetLeftSoftkeyFunction(mmi_uc_entry_send_opt, KEY_EVENT_UP);
  2157.     SetKeyHandler(mmi_uc_entry_send_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2158.     return;
  2159. }
  2160. /*****************************************************************************
  2161.  * FUNCTION
  2162.  *  mmi_uc_highlight_opt_msg_detail
  2163.  * DESCRIPTION
  2164.  *  Funtion is called when msg detail menu item selected
  2165.  * PARAMETERS
  2166.  *  void
  2167.  * RETURNS
  2168.  *  void
  2169.  *****************************************************************************/
  2170. void mmi_uc_highlight_opt_msg_detail(void)
  2171. {
  2172.     /*----------------------------------------------------------------*/
  2173.     /* Local Variables                                                */
  2174.     /*----------------------------------------------------------------*/
  2175.     /*----------------------------------------------------------------*/
  2176.     /* Code Body                                                      */
  2177.     /*----------------------------------------------------------------*/    
  2178.     SetLeftSoftkeyFunction(mmi_uc_entry_msg_detail, KEY_EVENT_UP);
  2179.     SetKeyHandler(mmi_uc_entry_msg_detail, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2180.     return;
  2181. }
  2182. /*****************************************************************************
  2183.  * FUNCTION
  2184.  *  mmi_uc_highlight_opt_input_method
  2185.  * DESCRIPTION
  2186.  *  Funtion is called when input method menu item selected
  2187.  * PARAMETERS
  2188.  *  void
  2189.  * RETURNS
  2190.  *  void
  2191.  *****************************************************************************/
  2192. void mmi_uc_highlight_opt_input_method(void)
  2193. {
  2194.     /*----------------------------------------------------------------*/
  2195.     /* Local Variables                                                */
  2196.     /*----------------------------------------------------------------*/
  2197.     /*----------------------------------------------------------------*/
  2198.     /* Code Body                                                      */
  2199.     /*----------------------------------------------------------------*/    
  2200.     SetInputMethodAndDoneCaptionIcon(IMG_UC_ENTRY_SCRN_CAPTION_ID);
  2201.     SetLeftSoftkeyFunction(EntryInputMethodScreen, KEY_EVENT_UP);
  2202.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2203.     RegisterInputMethodScreenCloseFunction(mmi_uc_entry_input_method_done);
  2204.     return;
  2205. }
  2206. /*****************************************************************************
  2207.  * FUNCTION
  2208.  *  mmi_uc_highlight_opt_preview
  2209.  * DESCRIPTION
  2210.  *  Funtion is called when preview menu item selected
  2211.  * PARAMETERS
  2212.  *  void
  2213.  * RETURNS
  2214.  *  void
  2215.  *****************************************************************************/
  2216. void mmi_uc_highlight_opt_preview(void)
  2217. {
  2218.     /*----------------------------------------------------------------*/
  2219.     /* Local Variables                                                */
  2220.     /*----------------------------------------------------------------*/
  2221.     /*----------------------------------------------------------------*/
  2222.     /* Code Body                                                      */
  2223.     /*----------------------------------------------------------------*/    
  2224.     SetLeftSoftkeyFunction(mmi_uc_entry_preview, KEY_EVENT_UP);
  2225.     SetKeyHandler(mmi_uc_entry_preview, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2226.     return;
  2227. }
  2228. /*****************************************************************************
  2229.  * FUNCTION
  2230.  *  mmi_uc_entry_preview
  2231.  * DESCRIPTION
  2232.  *  Entry preview dummy screen
  2233.  * PARAMETERS
  2234.  *  void
  2235.  * RETURNS
  2236.  *  void
  2237.  *****************************************************************************/
  2238. void mmi_uc_entry_preview(void)
  2239. {
  2240.     /*----------------------------------------------------------------*/
  2241.     /* Local Variables                                                */
  2242.     /*----------------------------------------------------------------*/
  2243.     MMI_BOOL is_back = CheckIsBackHistory();
  2244.     /*----------------------------------------------------------------*/
  2245.     /* Code Body                                                      */
  2246.     /*----------------------------------------------------------------*/            
  2247.     EntryNewScreen(SCR_ID_UC_MSG_PREVIEW, mmi_uc_exit_generic,  mmi_uc_entry_preview, NULL);
  2248.     PRINT_INFORMATION_2((MMI_TRACE_G6_SMS, "*[UnifiedComposerMain.c] mmi_uc_entry_preview *n"));
  2249.     if (is_back)
  2250.     {
  2251.         g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
  2252.         
  2253.         if (g_uc_p->send_info.new_msg_id)
  2254.         {
  2255.             mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_MMS_PREFER);
  2256.         }
  2257.         GoBackToHistory(SCR_ID_UC_EDITOR);        
  2258.     }
  2259.     else
  2260.     {
  2261.         g_uc_p->send_info.action = MMI_UC_ACTION_PREVIEW;
  2262.         MMI_ASSERT(g_uc_p->send_info.new_msg_id == 0);
  2263.         mmi_uc_create_mms();
  2264.     }    
  2265.     SetDelScrnIDCallbackHandler(SCR_ID_UC_MSG_PREVIEW, (HistoryDelCBPtr) mmi_uc_preview_delete_history_hdlr);
  2266.  
  2267.     return;
  2268. }
  2269. /*****************************************************************************
  2270.  * FUNCTION
  2271.  *  mmi_uc_preview_delete_history_hdlr
  2272.  * DESCRIPTION
  2273.  *  
  2274.  * PARAMETERS
  2275.  *  in_param        [?]     
  2276.  * RETURNS
  2277.  *  U8
  2278.  *****************************************************************************/
  2279. U8 mmi_uc_preview_delete_history_hdlr(void *in_param)
  2280. {
  2281.     /*----------------------------------------------------------------*/
  2282.     /* Local Variables                                                */
  2283.     /*----------------------------------------------------------------*/
  2284.     /*----------------------------------------------------------------*/
  2285.     /* Code Body                                                      */
  2286.     /*----------------------------------------------------------------*/
  2287.     g_uc_p->send_info.action = MMI_UC_ACTION_IDLE;
  2288.     if (g_uc_p->send_info.new_msg_id)
  2289.     {
  2290.         mmi_uc_clear_msg_bearer(MMI_UC_MSG_TYPE_MMS_PREFER);
  2291.     }
  2292.     return FALSE;
  2293. }
  2294. /*****************************************************************************
  2295.  * FUNCTION
  2296.  *  mmi_uc_preview_mms
  2297.  * DESCRIPTION
  2298.  *  Preview mms
  2299.  * PARAMETERS
  2300.  *  void
  2301.  * RETURNS
  2302.  *  void
  2303.  *****************************************************************************/
  2304. void mmi_uc_preview_mms(void)
  2305. {
  2306.     /*----------------------------------------------------------------*/
  2307.     /* Local Variables                                                */
  2308.     /*----------------------------------------------------------------*/
  2309.     /*----------------------------------------------------------------*/
  2310.     /* Code Body                                                      */
  2311.     /*----------------------------------------------------------------*/
  2312.     mmi_uc_set_processing_screen(STR_UC_PREVIEW_ID, STR_UC_PLEASE_WAIT_ID, IMG_GLOBAL_PROGRESS, 0);
  2313.     mmi_uc_entry_processing_generic();
  2314.     DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  2315.     mmi_uc_preview_mms_req();
  2316. }
  2317. /*****************************************************************************
  2318.  * FUNCTION
  2319.  *  mmi_uc_exit_generic
  2320.  * DESCRIPTION
  2321.  *  Generic exit function for unified composer
  2322.  * PARAMETERS
  2323.  *  void
  2324.  * RETURNS
  2325.  *  void
  2326.  *****************************************************************************/
  2327. void mmi_uc_exit_generic(void)
  2328. {
  2329.     /*----------------------------------------------------------------*/
  2330.     /* Local Variables                                                */
  2331.     /*----------------------------------------------------------------*/
  2332.     /*----------------------------------------------------------------*/
  2333.     /* Code Body                                                      */
  2334.     /*----------------------------------------------------------------*/
  2335.     return;
  2336. }
  2337. /*****************************************************************************
  2338.  * FUNCTION
  2339.  *  mmi_uc_set_processing_screen
  2340.  * DESCRIPTION
  2341.  *  Set string and image for UC processing screen
  2342.  * PARAMETERS
  2343.  *  captionStrId            [IN]        
  2344.  *  bodyStrId               [IN]        
  2345.  *  animationImageId        [IN]        
  2346.  *  rskStrId                [IN]        
  2347.  * RETURNS
  2348.  *  void
  2349.  *****************************************************************************/
  2350. void mmi_uc_set_processing_screen(U16 captionStrId, U16 bodyStrId, U16 animationImageId, U16 rskStrId)
  2351. {
  2352.     /*----------------------------------------------------------------*/
  2353.     /* Local Variables                                                */
  2354.     /*----------------------------------------------------------------*/
  2355.     /*----------------------------------------------------------------*/
  2356.     /* Code Body                                                      */
  2357.     /*----------------------------------------------------------------*/
  2358.     g_uc_p->processing.caption_str_id = captionStrId;
  2359.     g_uc_p->processing.body_str_id = bodyStrId;
  2360.     g_uc_p->processing.animation_image_id = animationImageId;
  2361.     g_uc_p->processing.RSK_str_id = rskStrId;
  2362. }
  2363. /*****************************************************************************
  2364.  * FUNCTION
  2365.  *  mmi_uc_exit_processing_generic
  2366.  * DESCRIPTION
  2367.  *  Exit generic processing screen
  2368.  * PARAMETERS
  2369.  *  void
  2370.  * RETURNS
  2371.  *  void
  2372.  *****************************************************************************/
  2373. void mmi_uc_exit_processing_generic(void)
  2374. {
  2375.     /*----------------------------------------------------------------*/
  2376.     /* Local Variables                                                */
  2377.     /*----------------------------------------------------------------*/
  2378.     /*----------------------------------------------------------------*/
  2379.     /* Code Body                                                      */
  2380.     /*----------------------------------------------------------------*/
  2381.     StopTimer(UC_INPROGRESS_TIMER_ID);
  2382. }
  2383. /*****************************************************************************
  2384.  * FUNCTION
  2385.  *  mmi_uc_time_out_processing_generic
  2386.  * DESCRIPTION
  2387.  *  Time out call back of processing screen
  2388.  * PARAMETERS
  2389.  *  void
  2390.  * RETURNS
  2391.  *  void
  2392.  *****************************************************************************/
  2393. void mmi_uc_time_out_processing_generic(void)
  2394. {
  2395.     /*----------------------------------------------------------------*/
  2396.     /* Local Variables                                                */
  2397.     /*----------------------------------------------------------------*/
  2398.     /*----------------------------------------------------------------*/
  2399.     /* Code Body                                                      */
  2400.     /*----------------------------------------------------------------*/
  2401.     StopTimer(UC_INPROGRESS_TIMER_ID);
  2402.     if (GetExitScrnID() == SCR_ID_UC_PROCESSING)
  2403.     {
  2404.         DisplayPopup(
  2405.             (PU8) GetString(STR_GLOBAL_UNFINISHED),
  2406.             IMG_GLOBAL_UNFINISHED,
  2407.             1,
  2408.             MMI_UC_POPUP_TIME_OUT,
  2409.             (U8) ERROR_TONE);
  2410.     }
  2411.     DeleteScreenIfPresent(SCR_ID_UC_PROCESSING);
  2412. }
  2413. /*****************************************************************************
  2414.  * FUNCTION
  2415.  *  mmi_uc_entry_processing_generic
  2416.  * DESCRIPTION
  2417.  *  Entry MSG generic processing screen
  2418.  * PARAMETERS
  2419.  *  void
  2420.  * RETURNS
  2421.  *  void
  2422.  *****************************************************************************/
  2423. void mmi_uc_entry_processing_generic(void)
  2424. {
  2425.     /*----------------------------------------------------------------*/
  2426.     /* Local Variables                                                */
  2427.     /*----------------------------------------------------------------*/
  2428.     /*----------------------------------------------------------------*/
  2429.     /* Code Body                                                      */
  2430.     /*----------------------------------------------------------------*/
  2431.     EntryNewScreen(SCR_ID_UC_PROCESSING, mmi_uc_exit_processing_generic, mmi_uc_entry_processing_generic, NULL);
  2432. #ifdef __MMI_MAINLCD_240X320__
  2433.     /* passing 0xffff for Title string and Title icon for the disbling the status bar and title display. */
  2434.     ShowCategory8Screen(
  2435.         0xffff,
  2436.         0xffff,
  2437.         0,
  2438.         0,
  2439.         g_uc_p->processing.RSK_str_id,
  2440.         0,
  2441.         g_uc_p->processing.body_str_id,
  2442.         g_uc_p->processing.animation_image_id,
  2443.         NULL);
  2444. #else /* __MMI_MAINLCD_240X320__ */ 
  2445.     ShowCategory8Screen(
  2446.         g_uc_p->processing.caption_str_id,
  2447.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  2448.         0,
  2449.         0,
  2450.         g_uc_p->processing.RSK_str_id,
  2451.         0,
  2452.         g_uc_p->processing.body_str_id,
  2453.         g_uc_p->processing.animation_image_id,
  2454.         NULL);
  2455. #endif /* __MMI_MAINLCD_240X320__ */ 
  2456.     if (g_uc_p->processing.RSK_str_id == 0)
  2457.     {
  2458.         ClearInputEventHandler(MMI_DEVICE_ALL);
  2459.         ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  2460.         ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  2461.         ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
  2462.         ClearKeyHandler(KEY_END, KEY_REPEAT);
  2463.         if (isInCall())
  2464.         {
  2465.             SetKeyHandler(HangupAllCalls, KEY_END, KEY_EVENT_DOWN);
  2466.         }
  2467.         StartTimer(UC_INPROGRESS_TIMER_ID, MMI_UC_INPROGRESS_TIME_OUT, mmi_uc_time_out_processing_generic);
  2468.     }
  2469.     else
  2470.     {
  2471.         SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2472.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2473.     }
  2474. }
  2475. /*****************************************************************************
  2476.  * FUNCTION
  2477.  *  mmi_uc_highlight_preferred_type
  2478.  * DESCRIPTION
  2479.  *  Funtion is called when preferred msg type menu item selected
  2480.  * PARAMETERS
  2481.  *  void
  2482.  * RETURNS
  2483.  *  void
  2484.  *****************************************************************************/
  2485. void mmi_uc_highlight_preferred_type(void)
  2486. {
  2487.     /*----------------------------------------------------------------*/
  2488.     /* Local Variables                                                */
  2489.     /*----------------------------------------------------------------*/
  2490.     /*----------------------------------------------------------------*/
  2491.     /* Code Body                                                      */
  2492.     /*----------------------------------------------------------------*/
  2493.     SetLeftSoftkeyFunction(mmi_uc_entry_preferred_type, KEY_EVENT_UP);
  2494.     SetKeyHandler(mmi_uc_entry_preferred_type, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2495.     return;
  2496. }
  2497. /*****************************************************************************
  2498.  * FUNCTION
  2499.  *  mmi_uc_entry_preferred_type
  2500.  * DESCRIPTION
  2501.  *  Entry preferred msg type screen
  2502.  * PARAMETERS
  2503.  *  void
  2504.  * RETURNS
  2505.  *  void
  2506.  *****************************************************************************/
  2507. void mmi_uc_entry_preferred_type(void)
  2508. {
  2509.     /*----------------------------------------------------------------*/
  2510.     /* Local Variables                                                */
  2511.     /*----------------------------------------------------------------*/
  2512.     U8 *guiBuffer;
  2513.     U16 nNumofItem = 2;
  2514.     S32 hiliteitem;
  2515.     S8 index;
  2516.     S16 errorCode;
  2517.     /*----------------------------------------------------------------*/
  2518.     /* Code Body                                                      */
  2519.     /*----------------------------------------------------------------*/
  2520.     EntryNewScreen(SCR_ID_UC_PREFERRED_MSG_TYPE, mmi_uc_exit_generic, mmi_uc_entry_preferred_type, NULL);
  2521.     subMenuDataPtrs[0] = (PU8) GetString(STR_UC_TEXT_MESSAGE_ID);
  2522.     subMenuDataPtrs[1] = (PU8) GetString(STR_UC_MULTIMEDIA_MESSAGE_ID);
  2523.     
  2524.     guiBuffer = GetCurrGuiBuffer(SCR_ID_UC_PREFERRED_MSG_TYPE);
  2525.     
  2526.     if ((guiBuffer != NULL))
  2527.     {
  2528.         hiliteitem = g_uc_p->main.object_index;
  2529.         MMI_ASSERT(hiliteitem < nNumofItem);
  2530.     }
  2531.     else
  2532.     {
  2533.         ReadValue(NVRAM_UC_PREFERRED_MSG_TYPE, &index, DS_BYTE, &errorCode);
  2534.         hiliteitem = index;
  2535.     }
  2536.     
  2537.     RegisterHighlightHandler(mmi_uc_set_index);
  2538.     ShowCategory109Screen(
  2539.         STR_UC_MESSAGE_TYPE_ID,
  2540.         IMG_UC_ENTRY_SCRN_CAPTION_ID,
  2541.         STR_GLOBAL_OK,
  2542.         IMG_GLOBAL_OK,
  2543.         STR_GLOBAL_BACK,
  2544.         IMG_GLOBAL_BACK,
  2545.         nNumofItem,
  2546.         subMenuDataPtrs,
  2547.         NULL,
  2548.         hiliteitem,
  2549.         guiBuffer);
  2550.     
  2551.     SetLeftSoftkeyFunction(mmi_uc_save_preferred_type, KEY_EVENT_UP);
  2552.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2553.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2554. }
  2555. /*****************************************************************************
  2556.  * FUNCTION
  2557.  *  mmi_uc_entry_preferred_type
  2558.  * DESCRIPTION
  2559.  *  Entry preferred msg type screen
  2560.  * PARAMETERS
  2561.  *  void
  2562.  * RETURNS
  2563.  *  void
  2564.  *****************************************************************************/
  2565. void mmi_uc_save_preferred_type(void)
  2566. {
  2567.     /*----------------------------------------------------------------*/
  2568.     /* Local Variables                                                */
  2569.     /*----------------------------------------------------------------*/
  2570.     S16 errorCode;
  2571.     /*----------------------------------------------------------------*/
  2572.     /* Code Body                                                      */
  2573.     /*----------------------------------------------------------------*/
  2574.     DisplayPopup(
  2575.             (PU8) GetString(STR_GLOBAL_OK),
  2576.             IMG_GLOBAL_OK,
  2577.             1,
  2578.             MMI_UC_POPUP_TIME_OUT,
  2579.             (U8) SUCCESS_TONE);
  2580.     
  2581.     WriteValue(NVRAM_UC_PREFERRED_MSG_TYPE, &(g_uc_p->main.object_index), DS_BYTE, &errorCode);
  2582.     DeleteScreenIfPresent(SCR_ID_UC_PREFERRED_MSG_TYPE);
  2583. }
  2584. /*****************************************************************************
  2585.  * FUNCTION
  2586.  *  mmi_uc_handle_text_in_current_slide
  2587.  * DESCRIPTION
  2588.  *  Save content of text buffer to file OR delete text object
  2589.  * PARAMETERS
  2590.  *  void
  2591.  * RETURNS
  2592.  *  void
  2593.  *****************************************************************************/
  2594. S32 mmi_uc_handle_text_in_current_slide(void)
  2595. {
  2596.     /*----------------------------------------------------------------*/
  2597.     /* Local Variables                                                */
  2598.     /*----------------------------------------------------------------*/
  2599.     U8 mmi_uc_text_path[MMI_UC_MAX_TEMP_FILE_LEN];
  2600.     mmi_uc_object_struct * object = NULL;
  2601.     S32 result = FS_NO_ERROR;
  2602.     /*----------------------------------------------------------------*/
  2603.     /* Code Body                                                      */
  2604.     /*----------------------------------------------------------------*/
  2605.     memset(mmi_uc_text_path, 0, MMI_UC_MAX_TEMP_FILE_LEN);
  2606.     MMI_UC_MAKE_TEXT_FILE_PATH(mmi_uc_text_path, g_uc_p->msg.current_slide_num);
  2607.     /* Add text object with empty content to the slide */
  2608.     if (g_uc_p->msg.current_slide->text.char_count > 0)
  2609.     {           
  2610.         result = mmi_uc_save_buffer_to_file(mmi_uc_text_path, g_uc_p->main.text_buffer,g_uc_p->msg.current_slide->text.char_count);
  2611.         if (result == FS_NO_ERROR)
  2612.         {
  2613.             if (g_uc_p->msg.current_slide->text.object == NULL)
  2614.             {
  2615.                 object = mmi_uc_insert_object((S8*)mmi_uc_text_path, MMI_UC_OBJECT_TYPE_TEXT);
  2616.                 mmi_uc_insert_object_to_slide(object, g_uc_p->msg.current_slide, MMI_UC_OBJECT_TYPE_TEXT);
  2617.             }
  2618.             else
  2619.             {
  2620.                 g_uc_p->msg.current_slide->text.object->size = applib_get_file_size((kal_wchar*)mmi_uc_text_path);    
  2621.             }
  2622.         }
  2623.     }            
  2624.     /* Delete the text object */ 
  2625.     else if (g_uc_p->msg.current_slide->text.char_count == 0)
  2626.     {
  2627.         if (g_uc_p->msg.current_slide->text.object)
  2628.         {
  2629.             MMI_ASSERT(FS_Delete((U16*)mmi_uc_text_path) == FS_NO_ERROR);
  2630.             mmi_uc_delete_object_from_list(g_uc_p->msg.current_slide->text.object);
  2631.             memset(&(g_uc_p->msg.current_slide->text), 0, sizeof(mmi_uc_text_object_info_struct));            
  2632.         }
  2633.     }
  2634.     else
  2635.     {
  2636.         MMI_ASSERT(0);
  2637.     }
  2638.     return result;
  2639. }
  2640. #endif /* __MMI_UNIFIED_COMPOSER__ */ 
  2641. #endif /* _MMI_UNIFIED_COMPOSER_MAIN_C */