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

MTK

开发平台:

C/C++

  1.  * RETURNS
  2.  *  void
  3.  *****************************************************************************/
  4. void mmi_email_entry_read_attch_opt(void)
  5. {
  6.     /*----------------------------------------------------------------*/
  7.     /* Local Variables                                                */
  8.     /*----------------------------------------------------------------*/
  9.     U16 numItems;
  10.     U16 nStrItemList[2];    /* only view and save */
  11.     U8 *guiBuffer;
  12.     /*----------------------------------------------------------------*/
  13.     /* Code Body                                                      */
  14.     /*----------------------------------------------------------------*/
  15.     EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH_OPT, NULL, mmi_email_entry_read_attch_opt, NULL);
  16.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH_OPT);
  17.     SetParentHandler(MENU_ID_EMAIL_INBOX_ATTCH_OPT);
  18.     numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_ATTCH_OPT);
  19.     GetSequenceStringIds(MENU_ID_EMAIL_INBOX_ATTCH_OPT, nStrItemList);
  20.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  21.     ShowCategory52Screen(
  22.         STR_GLOBAL_OPTIONS,
  23.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  24.         STR_GLOBAL_OK,
  25.         IMG_GLOBAL_OK,
  26.         STR_GLOBAL_BACK,
  27.         IMG_GLOBAL_BACK,
  28.         numItems,
  29.         nStrItemList,
  30.         (U16*) gIndexIconsImageList,
  31.         NULL,
  32.         0,
  33.         0,
  34.         guiBuffer);
  35.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  36.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  37. }
  38. /*****************************************************************************
  39.  * FUNCTION
  40.  *  mmi_email_entry_read_attch_view
  41.  * DESCRIPTION
  42.  *  View/Play attachment file according to its type.
  43.  * PARAMETERS
  44.  *  void
  45.  * RETURNS
  46.  *  void
  47.  *****************************************************************************/
  48. void mmi_email_entry_read_attch_view(void)
  49. {
  50.     /*----------------------------------------------------------------*/
  51.     /* Local Variables                                                */
  52.     /*----------------------------------------------------------------*/
  53.     S8 *fileExtPtr = mmi_email_get_file_ext((S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].
  54.                                file_name);
  55.     S8 *fileExt = OslMalloc((FMGR_MAX_EXT_LEN + 1) * ENCODING_LENGTH);
  56.     U8 fileType;
  57.     /*----------------------------------------------------------------*/
  58.     /* Code Body                                                      */
  59.     /*----------------------------------------------------------------*/
  60.     if (fileExtPtr)
  61.     {
  62.         /* neglect "." */
  63.         fileExtPtr = fileExtPtr + 2;
  64.         UnicodeToAnsii(fileExt, fileExtPtr);
  65.     }
  66.     fileType = mmi_fmgr_get_file_group((S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].
  67.                                 file_path);
  68.     if (fileType == FMGR_GROUP_IMAGE)
  69.     {
  70.         EntryNewScreen(SCR_ID_EMAIL_READ_VIEW_IMG, NULL, mmi_email_entry_read_attch_view, NULL);
  71.         if (mmi_email_uti_strnicmp("ems", fileExt, strlen(fileExt)) == 0)
  72.         {
  73.             ShowCategory144Screen(
  74.                 (U8*) GetString(STR_GLOBAL_VIEW),
  75.                 GetRootTitleIcon(MAIN_MENU_FILE_MNGR_MENUID),
  76.                 0,
  77.                 0,
  78.                 STR_GLOBAL_BACK,
  79.                 IMG_GLOBAL_BACK,
  80.                 EMS_OBJECT_MY_PICTURE_STATE | CATEGORY144_FMGR_PREVIEW | CATEGORY144_EMAIL_PREVIEW,
  81.                 1,
  82.                 NULL,
  83.                 (U16*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
  84.                 FALSE,
  85.                 NULL,
  86.                 0,
  87.                 NULL);
  88.         }
  89.         else if (mmi_email_uti_strnicmp("anm", fileExt, strlen(fileExt)) == 0)
  90.         {
  91.             ShowCategory144Screen(
  92.                 (U8*) GetString(STR_GLOBAL_VIEW),
  93.                 GetRootTitleIcon(MAIN_MENU_FILE_MNGR_MENUID),
  94.                 0,
  95.                 0,
  96.                 STR_GLOBAL_BACK,
  97.                 IMG_GLOBAL_BACK,
  98.                 EMS_OBJECT_MY_ANIMATION_STATE | CATEGORY144_FMGR_PREVIEW | CATEGORY144_EMAIL_PREVIEW,
  99.                 1,
  100.                 NULL,
  101.                 (U16*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
  102.                 FALSE,
  103.                 NULL,
  104.                 0,
  105.                 NULL);
  106.         }
  107.         else
  108.         {
  109.             ShowCategory222Screen(
  110.                 STR_GLOBAL_VIEW,
  111.                 GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  112.                 0,
  113.                 0,
  114.                 STR_GLOBAL_BACK,
  115.                 IMG_GLOBAL_BACK,
  116.                 GDI_COLOR_WHITE,
  117.                 NULL,
  118.                 (S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
  119.                 FALSE,
  120.                 NULL);
  121.         }
  122.         SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  123.         SetLeftSoftkeyFunction(mmi_email_read_attach_save, KEY_EVENT_UP);
  124.     }
  125.     else if (fileType == FMGR_GROUP_AUDIO)
  126.     {
  127.         mmi_audply_single_play(
  128.             (UI_string_type) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
  129.             NULL);
  130.     }
  131. #ifdef __MMI_VIDEO_PLAYER__
  132.     else if (fileType == FMGR_GROUP_VIDEO)
  133.     {
  134.         mmi_vdoply_entry_player_screen_from_file(
  135.             (S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
  136.             FALSE);
  137.     }
  138. #endif /* __MMI_VIDEO_PLAYER__ */ 
  139.     else if (email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].attch_type == MIME_TYPE_APPLICATION)        /* only for imelody */
  140.     {
  141.         mmi_audply_single_play(
  142.             (UI_string_type) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_path,
  143.             NULL);
  144.     }
  145.     OslMfree(fileExt);
  146. }
  147. /*****************************************************************************
  148.  * FUNCTION
  149.  *  mmi_email_read_pre_entry_save_attch
  150.  * DESCRIPTION
  151.  *  Retrieve file extention and go to file name screen
  152.  * PARAMETERS
  153.  *  void
  154.  * RETURNS
  155.  *  void
  156.  *****************************************************************************/
  157. void mmi_email_read_pre_entry_save_attch(void)
  158. {
  159.     /*----------------------------------------------------------------*/
  160.     /* Local Variables                                                */
  161.     /*----------------------------------------------------------------*/
  162.     S8 *fileExt;
  163.     /*----------------------------------------------------------------*/
  164.     /* Code Body                                                      */
  165.     /*----------------------------------------------------------------*/
  166.     pfnUnicodeStrcpy(
  167.         (S8*) email_p->filename_buff,
  168.         (S8*) email_p->inbox_info.read_info.attch_list[email_p->misc_info.curr_hilite_attch].file_name);
  169.     fileExt = mmi_email_get_file_ext((S8*) email_p->filename_buff);
  170.     if (fileExt)
  171.     {
  172.         pfnUnicodeStrcpy((S8*) email_p->fileext_buff, fileExt);
  173.         /* clear file extention */
  174.         fileExt[0] = 0;
  175.         fileExt[1] = 0;
  176.     }
  177.     else
  178.     {
  179.         email_p->fileext_buff[0] = 0x0000;
  180.     }
  181.     mmi_email_entry_read_attch_save();
  182. }
  183. /*****************************************************************************
  184.  * FUNCTION
  185.  *  mmi_email_entry_read_attch_save
  186.  * DESCRIPTION
  187.  *  Entry input filename screen for attachment.
  188.  * PARAMETERS
  189.  *  void
  190.  * RETURNS
  191.  *  void
  192.  *****************************************************************************/
  193. void mmi_email_entry_read_attch_save(void)
  194. {
  195.     /*----------------------------------------------------------------*/
  196.     /* Local Variables                                                */
  197.     /*----------------------------------------------------------------*/
  198.     U8 *guiBuffer;
  199.     /*----------------------------------------------------------------*/
  200.     /* Code Body                                                      */
  201.     /*----------------------------------------------------------------*/
  202.     EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH_SAVE, NULL, mmi_email_entry_read_attch_save, NULL);
  203.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH_SAVE);
  204.     ShowCategory5Screen(
  205.         STR_EMAIL_FILENAME_ID,
  206.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  207.         STR_GLOBAL_OPTIONS,
  208.         IMG_GLOBAL_OPTIONS,
  209.         STR_GLOBAL_BACK,
  210.         IMG_GLOBAL_BACK,
  211.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE,
  212.         (U8*) email_p->filename_buff,
  213.         FMGR_MAX_INPUT_FILE_LEN,
  214.         guiBuffer);
  215.     SetLeftSoftkeyFunction(mmi_email_entry_read_save_attch_opt, KEY_EVENT_UP);
  216.     SetCategory5RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  217. }
  218. /*****************************************************************************
  219.  * FUNCTION
  220.  *  mmi_email_entry_read_save_attch_opt
  221.  * DESCRIPTION
  222.  *  Entry option screen for save attachment
  223.  * PARAMETERS
  224.  *  void
  225.  * RETURNS
  226.  *  void
  227.  *****************************************************************************/
  228. void mmi_email_entry_read_save_attch_opt(void)
  229. {
  230.     /*----------------------------------------------------------------*/
  231.     /* Local Variables                                                */
  232.     /*----------------------------------------------------------------*/
  233.     U16 numItems;
  234.     U16 nStrItemList[2];    /* only done and input method */
  235.     U8 *guiBuffer;
  236.     /*----------------------------------------------------------------*/
  237.     /* Code Body                                                      */
  238.     /*----------------------------------------------------------------*/
  239.     EntryNewScreen(SCR_ID_EMAIL_READ_ATTCH_SAVE_OPT, NULL, mmi_email_entry_read_save_attch_opt, NULL);
  240.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_ATTCH_SAVE_OPT);
  241.     SetParentHandler(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_OPT);
  242.     numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_OPT);
  243.     GetSequenceStringIds(MENU_ID_EMAIL_INBOX_READ_ATTCH_SAVE_OPT, nStrItemList);
  244.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  245.     ShowCategory52Screen(
  246.         STR_GLOBAL_OPTIONS,
  247.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  248.         STR_GLOBAL_OK,
  249.         IMG_GLOBAL_OK,
  250.         STR_GLOBAL_BACK,
  251.         IMG_GLOBAL_BACK,
  252.         numItems,
  253.         nStrItemList,
  254.         (U16*) gIndexIconsImageList,
  255.         NULL,
  256.         0,
  257.         0,
  258.         guiBuffer);
  259.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  260.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  261. }
  262. /*****************************************************************************
  263.  * FUNCTION
  264.  *  mmi_email_read_save_attch
  265.  * DESCRIPTION
  266.  *  Save attachment from Read Email screen.
  267.  * PARAMETERS
  268.  *  void
  269.  * RETURNS
  270.  *  void
  271.  *****************************************************************************/
  272. void mmi_email_read_save_attch(void)
  273. {
  274.     /*----------------------------------------------------------------*/
  275.     /* Local Variables                                                */
  276.     /*----------------------------------------------------------------*/
  277.     S8 result;
  278.     /*----------------------------------------------------------------*/
  279.     /* Code Body                                                      */
  280.     /*----------------------------------------------------------------*/
  281.     result = mmi_email_read_copy_attch((U8) (email_p->misc_info.curr_hilite_attch + 1), (S8*) email_p->filename_buff);
  282.     switch (result)
  283.     {
  284.         case EMAIL_SAVE_ATTACH_NO_ERR:
  285.             mmi_email_pre_entry_progressing(
  286.                 STR_EMAIL_MAIN_ID,
  287.                 GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  288.                 0,
  289.                 0,
  290.                 0,
  291.                 0,
  292.                 (U8*) GetString(STR_GLOBAL_SAVING),
  293.                 (U8*) NULL,
  294.                 IMG_EMAIL_CONNECTING_ID,
  295.                 NULL,
  296.                 NULL,
  297.                 NULL,
  298.                 0);
  299.             break;
  300.         case EMAIL_SAVE_ATTACH_DUP_NAME:
  301.             DisplayPopup(
  302.                 (U8*) GetString(STR_EMAIL_DUPLICATE_FILENAME),
  303.                 IMG_GLOBAL_ERROR,
  304.                 1,
  305.                 UI_POPUP_NOTIFYDURATION_TIME,
  306.                 (U8) ERROR_TONE);
  307.             break;
  308.         case EMAIL_SAVE_ATTACH_EMPTY_NAME:
  309.             DisplayPopup(
  310.                 (U8*) GetString(STR_EMAIL_EMPTY_FILENAME),
  311.                 IMG_GLOBAL_ERROR,
  312.                 1,
  313.                 UI_POPUP_NOTIFYDURATION_TIME,
  314.                 (U8) ERROR_TONE);
  315.             break;
  316.         case EMAIL_SAVE_ATTACH_NAME_TOO_LONG:
  317.             DisplayPopup(
  318.                 (U8*) GetString(STR_EMAIL_FILENAME_TOO_LONG),
  319.                 IMG_GLOBAL_ERROR,
  320.                 1,
  321.                 UI_POPUP_NOTIFYDURATION_TIME,
  322.                 (U8) ERROR_TONE);
  323.             break;
  324.         default:
  325.             DisplayPopup(
  326.                 (U8*) GetString(STR_GLOBAL_UNFINISHED),
  327.                 IMG_GLOBAL_UNFINISHED,
  328.                 1,
  329.                 UI_POPUP_NOTIFYDURATION_TIME,
  330.                 (U8) ERROR_TONE);
  331.             break;
  332.     }
  333.     DeleteUptoScrID(SCR_ID_EMAIL_READ_ATTCH);
  334. }
  335. /*****************************************************************************
  336.  * FUNCTION
  337.  *  mmi_email_entry_read_opt
  338.  * DESCRIPTION
  339.  *  Entry Option screen of Inbox->Read
  340.  * PARAMETERS
  341.  *  void
  342.  * RETURNS
  343.  *  void
  344.  *****************************************************************************/
  345. void mmi_email_entry_read_opt(void)
  346. {
  347.     /*----------------------------------------------------------------*/
  348.     /* Local Variables                                                */
  349.     /*----------------------------------------------------------------*/
  350.     U16 numItems;
  351.     U16 nStrItemList[MAX_SUB_MENUS];
  352.     U8 *guiBuffer;
  353.     /*----------------------------------------------------------------*/
  354.     /* Code Body                                                      */
  355.     /*----------------------------------------------------------------*/
  356.     EntryNewScreen(SCR_ID_EMAIL_READ_OPT, NULL, mmi_email_entry_read_opt, NULL);
  357.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_READ_OPT);
  358.     SetParentHandler(MENU_ID_EMAIL_INBOX_READ_OPT);
  359.     numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_READ_OPT);
  360.     GetSequenceStringIds(MENU_ID_EMAIL_INBOX_READ_OPT, nStrItemList);
  361.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  362.     ShowCategory52Screen(
  363.         STR_GLOBAL_OPTIONS,
  364.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  365.         STR_GLOBAL_OK,
  366.         IMG_GLOBAL_OK,
  367.         STR_GLOBAL_BACK,
  368.         IMG_GLOBAL_BACK,
  369.         numItems,
  370.         nStrItemList,
  371.         (U16*) gIndexIconsImageList,
  372.         NULL,
  373.         0,
  374.         0,
  375.         guiBuffer);
  376.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  377.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  378. }
  379. /*****************************************************************************
  380.  * FUNCTION
  381.  *  mmi_email_read_fill_reply_data
  382.  * DESCRIPTION
  383.  *  Fill common data for Reply
  384.  * PARAMETERS
  385.  *  void
  386.  * RETURNS
  387.  *  void
  388.  *****************************************************************************/
  389. void mmi_email_read_fill_reply_data(void)
  390. {
  391.     /*----------------------------------------------------------------*/
  392.     /* Local Variables                                                */
  393.     /*----------------------------------------------------------------*/
  394.     U32 subLenToBeReplied;
  395.     U32 prefixReWithColonStrLen;
  396.     /*----------------------------------------------------------------*/
  397.     /* Code Body                                                      */
  398.     /*----------------------------------------------------------------*/
  399.     mmi_email_comp_reset_member();
  400.     /* copy From to To */
  401.     email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr = 1;
  402.     pfnUnicodeStrcpy(
  403.         (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
  404.         (S8*) email_p->inbox_info.from_info.from_addr);
  405.     pfnUnicodeStrcpy(
  406.         (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
  407.         (S8*) email_p->inbox_info.from_info.from_name);
  408.     /* Display buffer of From */
  409.     if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]))
  410.     {
  411.         pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_left_op);
  412.         pfnUnicodeStrcat(
  413.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  414.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]);
  415.         pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_right_op);
  416.         pfnUnicodeStrcat(
  417.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  418.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
  419.     }
  420.     else
  421.     {
  422.         pfnUnicodeStrcpy(
  423.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  424.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
  425.     }
  426.     /* fill subject with "RE: <previous >" */
  427.     subLenToBeReplied = pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.subj_buff);
  428.     prefixReWithColonStrLen = pfnUnicodeStrlen((S8*) g_email_re_str);
  429.     if ((subLenToBeReplied + prefixReWithColonStrLen) > EMAIL_COMP_SUBJ_LEN)
  430.     {
  431.         subLenToBeReplied = EMAIL_COMP_SUBJ_LEN - prefixReWithColonStrLen;
  432.     }
  433.     pfnUnicodeStrcpy((S8*) email_p->comp_info.subj_buff, (S8*) g_email_re_str);
  434.     pfnUnicodeStrncat(
  435.         (S8*) email_p->comp_info.subj_buff,
  436.         (S8*) email_p->inbox_info.read_info.subj_buff,
  437.         subLenToBeReplied);
  438. }
  439. /*****************************************************************************
  440.  * FUNCTION
  441.  *  mmi_email_read_reply
  442.  * DESCRIPTION
  443.  *  Execute Read->Reply option
  444.  * PARAMETERS
  445.  *  void
  446.  * RETURNS
  447.  *  void
  448.  *****************************************************************************/
  449. void mmi_email_read_reply(void)
  450. {
  451.     /*----------------------------------------------------------------*/
  452.     /* Local Variables                                                */
  453.     /*----------------------------------------------------------------*/
  454.     /*----------------------------------------------------------------*/
  455.     /* Code Body                                                      */
  456.     /*----------------------------------------------------------------*/
  457.     mmi_email_read_fill_reply_data();
  458.     /* content */
  459.     pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) email_p->inbox_info.read_info.cont_buff);
  460.     /* attachment */
  461.     mmi_email_util_rename_read_to_comp();
  462.     /* entry Write Email screen */
  463.     mmi_email_entry_comp();
  464. }
  465. /*****************************************************************************
  466.  * FUNCTION
  467.  *  mmi_email_read_reply_without
  468.  * DESCRIPTION
  469.  *  Execute Read->Reply Without Content option
  470.  * PARAMETERS
  471.  *  void
  472.  * RETURNS
  473.  *  void
  474.  *****************************************************************************/
  475. void mmi_email_read_reply_without(void)
  476. {
  477.     /*----------------------------------------------------------------*/
  478.     /* Local Variables                                                */
  479.     /*----------------------------------------------------------------*/
  480.     /*----------------------------------------------------------------*/
  481.     /* Code Body                                                      */
  482.     /*----------------------------------------------------------------*/
  483.     mmi_email_read_fill_reply_data();
  484.     /* display compose screen */
  485.     if (mmi_email_comp_add_sig() == FALSE)
  486.     {
  487.         return;
  488.     }
  489.     mmi_email_entry_comp();
  490. }
  491. /*****************************************************************************
  492.  * FUNCTION
  493.  *  mmi_email_read_fill_reply_all_data
  494.  * DESCRIPTION
  495.  *  Fill common data for Reply All
  496.  * PARAMETERS
  497.  *  void
  498.  * RETURNS
  499.  *  void
  500.  *****************************************************************************/
  501. void mmi_email_read_fill_reply_all_data(void)
  502. {
  503.     /*----------------------------------------------------------------*/
  504.     /* Local Variables                                                */
  505.     /*----------------------------------------------------------------*/
  506.     S32 i;
  507.     S32 j;
  508.     U32 subLenToBeReplied;
  509.     U32 prefixReWithColonStrLen;
  510.     /*----------------------------------------------------------------*/
  511.     /* Code Body                                                      */
  512.     /*----------------------------------------------------------------*/
  513.     mmi_email_comp_reset_member();
  514.     /* copy FROM to TO */
  515.     pfnUnicodeStrcpy(
  516.         (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
  517.         (S8*) email_p->inbox_info.from_info.from_addr);
  518.     pfnUnicodeStrcpy(
  519.         (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
  520.         (S8*) email_p->inbox_info.from_info.from_name);
  521.     email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr = 1;
  522.     /* From TO to TO */
  523.     i = 1;
  524.     for (j = 0; j < email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].num_addr; j++)
  525.     {
  526.         if (pfnUnicodeStrcmp
  527.             ((S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[j],
  528.              (S8*) email_p->prof_info.act_prof.email_addr))
  529.         {
  530.             pfnUnicodeStrcpy(
  531.                 (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[i],
  532.                 (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[j]);
  533.             pfnUnicodeStrcpy(
  534.                 (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[i],
  535.                 (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_TO].to_cc_name[j]);
  536.             email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr++;
  537.             i++;
  538.         }
  539.         if (email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr == MMI_EMAIL_MAX_LEN_ADDR_LIST)
  540.         {
  541.             break;
  542.         }
  543.     }
  544.     /* display buffer of TO */
  545.     if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]))
  546.     {
  547.         pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_left_op);
  548.         pfnUnicodeStrcat(
  549.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  550.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]);
  551.         pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_right_op);
  552.         pfnUnicodeStrcat(
  553.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  554.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
  555.     }
  556.     else
  557.     {
  558.         pfnUnicodeStrcpy(
  559.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  560.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
  561.     }
  562.     if (email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr > 1)
  563.     {
  564.         pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_3dots);
  565.     }
  566.     /* copy CC to CC */
  567.     for (i = 0; i < email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].num_addr; i++)
  568.     {
  569.         pfnUnicodeStrcpy(
  570.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[i],
  571.             (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[i]);
  572.         pfnUnicodeStrcpy(
  573.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_name[i],
  574.             (S8*) email_p->inbox_info.read_info.addr_list[EMAIL_ADDR_CC].to_cc_name[i]);
  575.         email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr++;
  576.     }
  577.     /* display buffer of CC */
  578.     if (email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr != 0)
  579.     {
  580.         if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_name[0]))
  581.         {
  582.             pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC], (S8*) g_email_subj_left_op);
  583.             pfnUnicodeStrcat(
  584.                 (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
  585.                 (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_name[0]);
  586.             pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC], (S8*) g_email_subj_right_op);
  587.             pfnUnicodeStrcat(
  588.                 (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
  589.                 (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[0]);
  590.         }
  591.         else
  592.         {
  593.             pfnUnicodeStrcpy(
  594.                 (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC],
  595.                 (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_CC].to_cc_mail[0]);
  596.         }
  597.         if (email_p->comp_info.addr_list[EMAIL_ADDR_CC].num_addr > 1)
  598.         {
  599.             pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_CC], (S8*) g_email_3dots);
  600.         }
  601.     }
  602.     /* subject with "RE: <previous >" */
  603.     subLenToBeReplied = pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.subj_buff);
  604.     prefixReWithColonStrLen = pfnUnicodeStrlen((S8*) g_email_re_str);
  605.     if ((subLenToBeReplied + prefixReWithColonStrLen) > EMAIL_COMP_SUBJ_LEN)
  606.     {
  607.         subLenToBeReplied = EMAIL_COMP_SUBJ_LEN - prefixReWithColonStrLen;
  608.     }
  609.     pfnUnicodeStrcpy((S8*) email_p->comp_info.subj_buff, (S8*) g_email_re_str);
  610.     pfnUnicodeStrncat(
  611.         (S8*) email_p->comp_info.subj_buff,
  612.         (S8*) email_p->inbox_info.read_info.subj_buff,
  613.         subLenToBeReplied);
  614. }
  615. /*****************************************************************************
  616.  * FUNCTION
  617.  *  mmi_email_read_reply_all
  618.  * DESCRIPTION
  619.  *  Execute Read->Reply All option
  620.  * PARAMETERS
  621.  *  void
  622.  * RETURNS
  623.  *  void
  624.  *****************************************************************************/
  625. void mmi_email_read_reply_all(void)
  626. {
  627.     /*----------------------------------------------------------------*/
  628.     /* Local Variables                                                */
  629.     /*----------------------------------------------------------------*/
  630.     /*----------------------------------------------------------------*/
  631.     /* Code Body                                                      */
  632.     /*----------------------------------------------------------------*/
  633.     mmi_email_read_fill_reply_all_data();
  634.     /* content */
  635.     pfnUnicodeStrcpy((S8*) email_p->comp_info.cont_buff, (S8*) email_p->inbox_info.read_info.cont_buff);
  636.     /* attachment */
  637.     mmi_email_util_rename_read_to_comp();
  638.     mmi_email_entry_comp();
  639. }
  640. /*****************************************************************************
  641.  * FUNCTION
  642.  *  mmi_email_read_reply_all_without
  643.  * DESCRIPTION
  644.  *  Execute Read->Reply All Without Content option
  645.  * PARAMETERS
  646.  *  void
  647.  * RETURNS
  648.  *  void
  649.  *****************************************************************************/
  650. void mmi_email_read_reply_all_without(void)
  651. {
  652.     /*----------------------------------------------------------------*/
  653.     /* Local Variables                                                */
  654.     /*----------------------------------------------------------------*/
  655.     /*----------------------------------------------------------------*/
  656.     /* Code Body                                                      */
  657.     /*----------------------------------------------------------------*/
  658.     mmi_email_read_fill_reply_all_data();
  659.     /* display compose screen */
  660.     if (mmi_email_comp_add_sig() == FALSE)
  661.     {
  662.         return;
  663.     }
  664.     mmi_email_entry_comp();
  665. }
  666. /*****************************************************************************
  667.  * FUNCTION
  668.  *  mmi_email_read_forward
  669.  * DESCRIPTION
  670.  *  Execute Read->Forward option
  671.  * PARAMETERS
  672.  *  void
  673.  * RETURNS
  674.  *  void
  675.  *****************************************************************************/
  676. void mmi_email_read_forward(void)
  677. {
  678.     /*----------------------------------------------------------------*/
  679.     /* Local Variables                                                */
  680.     /*----------------------------------------------------------------*/
  681.     /*----------------------------------------------------------------*/
  682.     /* Code Body                                                      */
  683.     /*----------------------------------------------------------------*/
  684.     mmi_email_fldr_prepare_forward();
  685.     mmi_email_util_rename_read_to_comp();
  686.     /* display compose screen */
  687.     mmi_email_entry_comp();
  688. }
  689. /*****************************************************************************
  690.  * FUNCTION
  691.  *  mmi_email_read_addr_send
  692.  * DESCRIPTION
  693.  *  Execute Read->Address List -> Send option
  694.  * PARAMETERS
  695.  *  void
  696.  * RETURNS
  697.  *  void
  698.  *****************************************************************************/
  699. void mmi_email_read_addr_send(void)
  700. {
  701.     /*----------------------------------------------------------------*/
  702.     /* Local Variables                                                */
  703.     /*----------------------------------------------------------------*/
  704.     S32 i = email_p->misc_info.curr_hilite_attch;
  705.     S32 activeInputAddrMode = email_p->comp_info.curr_addr_type;
  706.     /*----------------------------------------------------------------*/
  707.     /* Code Body                                                      */
  708.     /*----------------------------------------------------------------*/
  709.     mmi_email_comp_reset_member();
  710.     /* copy user SELECETD entry to TO */
  711.     email_p->comp_info.addr_list[EMAIL_ADDR_TO].num_addr = 1;
  712.     if (activeInputAddrMode == EMAIL_ADDR_FROM)
  713.     {
  714.         pfnUnicodeStrcpy(
  715.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
  716.             (S8*) email_p->inbox_info.from_info.from_addr);
  717.         pfnUnicodeStrcpy(
  718.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
  719.             (S8*) email_p->inbox_info.from_info.from_name);
  720.     }
  721.     else
  722.     {
  723.         pfnUnicodeStrcpy(
  724.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0],
  725.             (S8*) email_p->inbox_info.read_info.addr_list[activeInputAddrMode].to_cc_mail[i]);
  726.         pfnUnicodeStrcpy(
  727.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0],
  728.             (S8*) email_p->inbox_info.read_info.addr_list[activeInputAddrMode].to_cc_name[i]);
  729.     }
  730.     /* display buffer */
  731.     if (pfnUnicodeStrlen((S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]))
  732.     {
  733.         pfnUnicodeStrcpy((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_left_op);
  734.         pfnUnicodeStrcat(
  735.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  736.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_name[0]);
  737.         pfnUnicodeStrcat((S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO], (S8*) g_email_subj_right_op);
  738.         pfnUnicodeStrcat(
  739.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  740.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
  741.     }
  742.     else
  743.     {
  744.         pfnUnicodeStrcpy(
  745.             (S8*) email_p->comp_info.addr_disp_buff[EMAIL_ADDR_TO],
  746.             (S8*) email_p->comp_info.addr_list[EMAIL_ADDR_TO].to_cc_mail[0]);
  747.     }
  748.     /* display compose screen */
  749.     if (mmi_email_comp_add_sig() == FALSE)
  750.     {
  751.         return;
  752.     }
  753.     mmi_email_entry_comp();
  754. }
  755. /*****************************************************************************
  756.  * FUNCTION
  757.  *  mmi_email_read_addr_save
  758.  * DESCRIPTION
  759.  *  Execute Read->Address List -> Save to Phonebook option
  760.  * PARAMETERS
  761.  *  void
  762.  * RETURNS
  763.  *  void
  764.  *****************************************************************************/
  765. void mmi_email_read_addr_save(void)
  766. {
  767.     /*----------------------------------------------------------------*/
  768.     /* Local Variables                                                */
  769.     /*----------------------------------------------------------------*/
  770.     S8 *pMailAddr = NULL;
  771.     S8 *pMailName = NULL;
  772.     S32 curr_addr = email_p->comp_info.curr_addr_type;
  773.     S32 i = email_p->misc_info.curr_hilite_attch;
  774.     /*----------------------------------------------------------------*/
  775.     /* Code Body                                                      */
  776.     /*----------------------------------------------------------------*/
  777.     if (email_p->comp_info.curr_addr_type == EMAIL_ADDR_FROM)
  778.     {
  779.         if (pfnUnicodeStrlen((S8*) email_p->inbox_info.from_info.from_addr))
  780.         {
  781.             pMailAddr = (S8*) email_p->inbox_info.from_info.from_addr;
  782.         }
  783.         if (pfnUnicodeStrlen((S8*) email_p->inbox_info.from_info.from_name))
  784.         {
  785.             pMailName = (S8*) email_p->inbox_info.from_info.from_name;
  786.         }
  787.     }
  788.     else    /* take use of the order of TO and CC */
  789.     {
  790.         if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_mail[i]))
  791.         {
  792.             pMailAddr = (S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_mail[i];
  793.         }
  794.         if (pfnUnicodeStrlen((S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_name[i]))
  795.         {
  796.             pMailName = (S8*) email_p->inbox_info.read_info.addr_list[curr_addr].to_cc_name[i];
  797.         }
  798.     }
  799.     mmi_phb_email_save_entry_to_phb(pMailName, pMailAddr);
  800. }
  801. /*****************************************************************************
  802.  * FUNCTION
  803.  *  mmi_email_read_attach_save
  804.  * DESCRIPTION
  805.  *  Enter file manager to select a folder to save attachment
  806.  * PARAMETERS
  807.  *  void
  808.  * RETURNS
  809.  *  void
  810.  *****************************************************************************/
  811. void mmi_email_read_attach_save(void)
  812. {
  813.     /*----------------------------------------------------------------*/
  814.     /* Local Variables                                                */
  815.     /*----------------------------------------------------------------*/
  816.     FMGR_FILTER filter;
  817.     /*----------------------------------------------------------------*/
  818.     /* Code Body                                                      */
  819.     /*----------------------------------------------------------------*/
  820.     FMGR_FILTER_INIT(&filter);
  821.     FMGR_FILTER_SET(&filter, FMGR_TYPE_FOLDER);
  822.     mmi_fmgr_select_path_and_enter(
  823.         APP_EMAIL,
  824.         FMGR_SELECT_FOLDER,
  825.         filter,
  826.         (S8*) L"root",
  827.         mmi_email_read_attch_sel_path_callback);
  828. }
  829. /*****************************************************************************
  830.  * FUNCTION
  831.  *  mmi_email_read_attch_sel_path_callback
  832.  * DESCRIPTION
  833.  *  Enter file manager to select a folder to save attachment
  834.  * PARAMETERS
  835.  *  filePath        [?]         
  836.  *  is_short        [IN]        
  837.  * RETURNS
  838.  *  void
  839.  *****************************************************************************/
  840. void mmi_email_read_attch_sel_path_callback(void *filePath, int is_short)
  841. {
  842.     /*----------------------------------------------------------------*/
  843.     /* Local Variables                                                */
  844.     /*----------------------------------------------------------------*/
  845.     /*----------------------------------------------------------------*/
  846.     /* Code Body                                                      */
  847.     /*----------------------------------------------------------------*/
  848.     if (filePath == NULL)
  849.     {
  850.         GoBackToHistory(SCR_ID_EMAIL_READ_ATTCH);
  851.         return;
  852.     }
  853.     pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) filePath);
  854.     /* use pass file folder to save attachment */
  855.     mmi_email_read_pre_entry_save_attch();
  856.     /* go to attachment screen because not all attachments have attachment option screen */
  857.     DeleteUptoScrID(SCR_ID_EMAIL_READ_ATTCH);
  858. }
  859. #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  860. /*****************************************************************************
  861.  * FUNCTION
  862.  *  mmi_email_entry_inbox_opt
  863.  * DESCRIPTION
  864.  *  Entry function of Inbox -> Option
  865.  *  This screen exists only when IMAP4 is supported.
  866.  * PARAMETERS
  867.  *  void
  868.  * RETURNS
  869.  *  void
  870.  *****************************************************************************/
  871. void mmi_email_entry_inbox_opt(void)
  872. {
  873.     /*----------------------------------------------------------------*/
  874.     /* Local Variables                                                */
  875.     /*----------------------------------------------------------------*/
  876.     U16 numItems;
  877.     U16 nStrItemList[MAX_SUB_MENUS];
  878.     U8 *guiBuffer;
  879.     /*----------------------------------------------------------------*/
  880.     /* Code Body                                                      */
  881.     /*----------------------------------------------------------------*/
  882.     EntryNewScreen(SCR_ID_EMAIL_INBOX_OPT, NULL, mmi_email_entry_inbox_opt, NULL);
  883.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_INBOX_OPT);
  884.     SetParentHandler(MENU_ID_EMAIL_INBOX_OPT);
  885.     numItems = GetNumOfChild(MENU_ID_EMAIL_INBOX_OPT);
  886.     GetSequenceStringIds(MENU_ID_EMAIL_INBOX_OPT, nStrItemList);
  887.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  888.     ShowCategory52Screen(
  889.         STR_GLOBAL_OPTIONS,
  890.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  891.         STR_GLOBAL_OK,
  892.         IMG_GLOBAL_OK,
  893.         STR_GLOBAL_BACK,
  894.         IMG_GLOBAL_BACK,
  895.         numItems,
  896.         nStrItemList,
  897.         (U16*) gIndexIconsImageList,
  898.         NULL,
  899.         0,
  900.         0,
  901.         guiBuffer);
  902.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  903.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  904. }
  905. #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */ 
  906. #define SENT_EMAIL
  907. /*****************************************************************************
  908.  * FUNCTION
  909.  *  mmi_email_entry_sent
  910.  * DESCRIPTION
  911.  *  Entry function of Sent folder
  912.  * PARAMETERS
  913.  *  void
  914.  * RETURNS
  915.  *  void
  916.  *****************************************************************************/
  917. void mmi_email_entry_sent(void)
  918. {
  919.     /*----------------------------------------------------------------*/
  920.     /* Local Variables                                                */
  921.     /*----------------------------------------------------------------*/
  922.     S32 numItems;
  923.     /*----------------------------------------------------------------*/
  924.     /* Code Body                                                      */
  925.     /*----------------------------------------------------------------*/
  926.     numItems = mmi_email_fldr_get_num_mails();
  927.     if (numItems)
  928.     {
  929.         U8 *guiBuffer;
  930.         S32 list_not_ready;
  931.         EntryNewScreen(SCR_ID_EMAIL_SENT, mmi_email_exit_sent, NULL, NULL);
  932.         email_p->fldr_info.need_fldr_sel = FALSE;
  933.         guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_SENT);
  934.         RegisterHighlightHandler(mmi_email_hilite_sent_item);
  935.         /* to prevent the selected mail being deleted */
  936.         if (email_p->fldr_info.curr_mail_indx >= numItems)
  937.         {
  938.             email_p->fldr_info.curr_mail_indx = numItems - 1;
  939.         }
  940.         ShowCategory263Screen(
  941.             mmi_email_util_folder_select_cap_str(STR_EMAIL_COMMON_SENT_ID),
  942.             GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  943.             STR_GLOBAL_OPTIONS,
  944.             IMG_GLOBAL_OPTIONS,
  945.             STR_GLOBAL_BACK,
  946.             IMG_GLOBAL_BACK,
  947.             numItems,
  948.             mmi_email_fldr_get_async_items,
  949.             NULL,
  950.             email_p->fldr_info.curr_mail_indx,
  951.             IMG_EMAIL_SENT_NORMAL_ID,
  952.             guiBuffer,
  953.             &list_not_ready);
  954.         if (list_not_ready)
  955.         {
  956.             mmi_email_fldr_pre_folder_select_req();
  957.         }
  958.         else
  959.         {
  960.             email_p->fldr_info.is_list_displayed = TRUE;
  961.             SetLeftSoftkeyFunction(mmi_email_entry_sent_opt, KEY_EVENT_UP);
  962.             SetKeyHandler(mmi_email_entry_sent_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  963.             SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  964.             SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  965.         }
  966.     }
  967.     else
  968.     {
  969.         DisplayPopup(
  970.             (U8*) GetString(STR_GLOBAL_EMPTY),
  971.             IMG_GLOBAL_EMPTY,
  972.             1,
  973.             UI_POPUP_NOTIFYDURATION_TIME,
  974.             (U8) EMPTY_LIST_TONE);
  975.     }
  976. }
  977. /*****************************************************************************
  978.  * FUNCTION
  979.  *  mmi_email_exit_sent
  980.  * DESCRIPTION
  981.  *  Exit function of Sent folder
  982.  * PARAMETERS
  983.  *  void
  984.  * RETURNS
  985.  *  void
  986.  *****************************************************************************/
  987. void mmi_email_exit_sent(void)
  988. {
  989.     /*----------------------------------------------------------------*/
  990.     /* Local Variables                                                */
  991.     /*----------------------------------------------------------------*/
  992.     /*----------------------------------------------------------------*/
  993.     /* Code Body                                                      */
  994.     /*----------------------------------------------------------------*/
  995.     mmi_email_util_add_history(SCR_ID_EMAIL_SENT, mmi_email_fldr_back_from_history);
  996. }
  997. /*****************************************************************************
  998.  * FUNCTION
  999.  *  mmi_email_hilite_sent_item
  1000.  * DESCRIPTION
  1001.  *  Highlight handler of Sent list
  1002.  * PARAMETERS
  1003.  *  index       [IN]        Index of highlighted item
  1004.  * RETURNS
  1005.  *  void
  1006.  *****************************************************************************/
  1007. void mmi_email_hilite_sent_item(S32 index)
  1008. {
  1009.     /*----------------------------------------------------------------*/
  1010.     /* Local Variables                                                */
  1011.     /*----------------------------------------------------------------*/
  1012.     mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
  1013.     mmi_email_mail_info_struct *temp;
  1014.     /*----------------------------------------------------------------*/
  1015.     /* Code Body                                                      */
  1016.     /*----------------------------------------------------------------*/
  1017.     mmi_mem_get_values(
  1018.         &email_p->mem_pool_info.mem_container,
  1019.         (S16) index,
  1020.         (S16) index,
  1021.         (void **)listMsgsStruct,
  1022.         &email_p->mem_pool_info.not_avail_pool);
  1023.     temp = listMsgsStruct[0];
  1024.     email_p->fldr_info.curr_mail_indx = index;
  1025.     email_p->fldr_info.curr_mail_uid = temp->mail_uid;
  1026.     RedrawCategory251InfoBox((U8*) temp->addr_buff, (U8*) temp->dt_buff);
  1027. }
  1028. /*****************************************************************************
  1029.  * FUNCTION
  1030.  *  mmi_email_entry_sent_opt
  1031.  * DESCRIPTION
  1032.  *  Entry function of Sent->Option screen
  1033.  * PARAMETERS
  1034.  *  void
  1035.  * RETURNS
  1036.  *  void
  1037.  *****************************************************************************/
  1038. void mmi_email_entry_sent_opt(void)
  1039. {
  1040.     /*----------------------------------------------------------------*/
  1041.     /* Local Variables                                                */
  1042.     /*----------------------------------------------------------------*/
  1043.     U16 numItems;
  1044.     U16 parentMenuId;
  1045.     U16 nStrItemList[MAX_SUB_MENUS];
  1046.     U8 *guiBuffer;
  1047.     /*----------------------------------------------------------------*/
  1048.     /* Code Body                                                      */
  1049.     /*----------------------------------------------------------------*/
  1050.     EntryNewScreen(SCR_ID_EMAIL_SENT_OPT, NULL, mmi_email_entry_sent_opt, NULL);
  1051.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_SENT_OPT);
  1052. #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  1053.     if ((email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4) && (email_p->fldr_info.total_page > 1))
  1054.     {
  1055.         parentMenuId = MENU_ID_EMAIL_SENT_OPT2; /* sent option for IMAP4 forwrd/delete/next page/previous page/jump to pages */
  1056.     }
  1057.     else
  1058. #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */ 
  1059.         parentMenuId = MENU_ID_EMAIL_SENT_OPT1;
  1060.     SetParentHandler(parentMenuId);
  1061.     numItems = GetNumOfChild(parentMenuId);
  1062.     GetSequenceStringIds(parentMenuId, nStrItemList);
  1063.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1064.     ShowCategory52Screen(
  1065.         STR_GLOBAL_OPTIONS,
  1066.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  1067.         STR_GLOBAL_OK,
  1068.         IMG_GLOBAL_OK,
  1069.         STR_GLOBAL_BACK,
  1070.         IMG_GLOBAL_BACK,
  1071.         numItems,
  1072.         nStrItemList,
  1073.         (U16*) gIndexIconsImageList,
  1074.         NULL,
  1075.         0,
  1076.         0,
  1077.         guiBuffer);
  1078.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1079.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1080. }
  1081. /*****************************************************************************
  1082.  * FUNCTION
  1083.  *  mmi_email_hilite_sent_forward
  1084.  * DESCRIPTION
  1085.  *  Highlight handler of Sent -> Option -> Forward option
  1086.  * PARAMETERS
  1087.  *  void
  1088.  * RETURNS
  1089.  *  void
  1090.  *****************************************************************************/
  1091. void mmi_email_hilite_sent_forward(void)
  1092. {
  1093.     /*----------------------------------------------------------------*/
  1094.     /* Local Variables                                                */
  1095.     /*----------------------------------------------------------------*/
  1096.     /*----------------------------------------------------------------*/
  1097.     /* Code Body                                                      */
  1098.     /*----------------------------------------------------------------*/
  1099.     SetLeftSoftkeyFunction(mmi_email_ps_folder_msg_select_req, KEY_EVENT_UP);
  1100.     SetKeyHandler(mmi_email_ps_folder_msg_select_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1101. }
  1102. #define UNSENT_EMAIL
  1103. /*****************************************************************************
  1104.  * FUNCTION
  1105.  *  mmi_email_entry_unsent
  1106.  * DESCRIPTION
  1107.  *  Entry function of Unsent folder
  1108.  * PARAMETERS
  1109.  *  void
  1110.  * RETURNS
  1111.  *  void
  1112.  *****************************************************************************/
  1113. void mmi_email_entry_unsent(void)
  1114. {
  1115.     /*----------------------------------------------------------------*/
  1116.     /* Local Variables                                                */
  1117.     /*----------------------------------------------------------------*/
  1118.     S32 numItems;
  1119.     /*----------------------------------------------------------------*/
  1120.     /* Code Body                                                      */
  1121.     /*----------------------------------------------------------------*/
  1122.     numItems = mmi_email_fldr_get_num_mails();
  1123.     if (numItems)
  1124.     {
  1125.         U8 *guiBuffer;
  1126.         S32 list_not_ready;
  1127.         EntryNewScreen(SCR_ID_EMAIL_UNSENT, mmi_email_exit_unsent, NULL, NULL);
  1128.         email_p->fldr_info.need_fldr_sel = FALSE;
  1129.         guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_UNSENT);
  1130.         RegisterHighlightHandler(mmi_email_hilite_unsent_item);
  1131.         /* to prevent the selected mail being deleted */
  1132.         if (email_p->fldr_info.curr_mail_indx >= numItems)
  1133.         {
  1134.             email_p->fldr_info.curr_mail_indx = numItems - 1;
  1135.         }
  1136.         ShowCategory263Screen(
  1137.             mmi_email_util_folder_select_cap_str(STR_EMAIL_COMMON_UNSENT_ID),
  1138.             GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  1139.             STR_GLOBAL_OPTIONS,
  1140.             IMG_GLOBAL_OPTIONS,
  1141.             STR_GLOBAL_BACK,
  1142.             IMG_GLOBAL_BACK,
  1143.             numItems,
  1144.             mmi_email_fldr_get_async_items,
  1145.             NULL,
  1146.             email_p->fldr_info.curr_mail_indx,
  1147.             IMG_EMAIL_SENT_NORMAL_ID,
  1148.             guiBuffer,
  1149.             &list_not_ready);
  1150.         if (list_not_ready)
  1151.         {
  1152.             mmi_email_fldr_pre_folder_select_req();
  1153.         }
  1154.         else
  1155.         {
  1156.             email_p->fldr_info.is_list_displayed = TRUE;
  1157.             SetLeftSoftkeyFunction(mmi_email_entry_unsent_opt, KEY_EVENT_UP);
  1158.             SetKeyHandler(mmi_email_entry_unsent_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1159.             SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1160.             SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1161.         }
  1162.     }
  1163.     else
  1164.     {
  1165.         DisplayPopup(
  1166.             (U8*) GetString(STR_GLOBAL_EMPTY),
  1167.             IMG_GLOBAL_EMPTY,
  1168.             1,
  1169.             UI_POPUP_NOTIFYDURATION_TIME,
  1170.             (U8) EMPTY_LIST_TONE);
  1171.     }
  1172. }
  1173. /*****************************************************************************
  1174.  * FUNCTION
  1175.  *  mmi_email_exit_unsent
  1176.  * DESCRIPTION
  1177.  *  Exit function of Unsent folder
  1178.  * PARAMETERS
  1179.  *  void
  1180.  * RETURNS
  1181.  *  void
  1182.  *****************************************************************************/
  1183. void mmi_email_exit_unsent(void)
  1184. {
  1185.     /*----------------------------------------------------------------*/
  1186.     /* Local Variables                                                */
  1187.     /*----------------------------------------------------------------*/
  1188.     /*----------------------------------------------------------------*/
  1189.     /* Code Body                                                      */
  1190.     /*----------------------------------------------------------------*/
  1191.     mmi_email_util_add_history(SCR_ID_EMAIL_UNSENT, mmi_email_fldr_back_from_history);
  1192. }
  1193. /*****************************************************************************
  1194.  * FUNCTION
  1195.  *  mmi_email_hilite_unsent_item
  1196.  * DESCRIPTION
  1197.  *  Highlight handler of Unsent list
  1198.  * PARAMETERS
  1199.  *  index       [IN]        Index of highlighted item
  1200.  * RETURNS
  1201.  *  void
  1202.  *****************************************************************************/
  1203. void mmi_email_hilite_unsent_item(S32 index)
  1204. {
  1205.     /*----------------------------------------------------------------*/
  1206.     /* Local Variables                                                */
  1207.     /*----------------------------------------------------------------*/
  1208.     mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
  1209.     mmi_email_mail_info_struct *temp;
  1210.     /*----------------------------------------------------------------*/
  1211.     /* Code Body                                                      */
  1212.     /*----------------------------------------------------------------*/
  1213.     mmi_mem_get_values(
  1214.         &email_p->mem_pool_info.mem_container,
  1215.         (S16) index,
  1216.         (S16) index,
  1217.         (void **)listMsgsStruct,
  1218.         &email_p->mem_pool_info.not_avail_pool);
  1219.     temp = listMsgsStruct[0];
  1220.     email_p->fldr_info.curr_mail_indx = index;
  1221.     email_p->fldr_info.curr_mail_uid = temp->mail_uid;
  1222.     RedrawCategory251InfoBox((U8*) temp->addr_buff, (U8*) temp->dt_buff);
  1223. }
  1224. /*****************************************************************************
  1225.  * FUNCTION
  1226.  *  mmi_email_entry_unsent_opt
  1227.  * DESCRIPTION
  1228.  *  Entry function of Unsent-> Option screen
  1229.  * PARAMETERS
  1230.  *  void
  1231.  * RETURNS
  1232.  *  void
  1233.  *****************************************************************************/
  1234. void mmi_email_entry_unsent_opt(void)
  1235. {
  1236.     /*----------------------------------------------------------------*/
  1237.     /* Local Variables                                                */
  1238.     /*----------------------------------------------------------------*/
  1239.     U16 numItems;
  1240.     U16 nStrItemList[5];    /* only 5 items */
  1241.     U8 *guiBuffer;
  1242.     /*----------------------------------------------------------------*/
  1243.     /* Code Body                                                      */
  1244.     /*----------------------------------------------------------------*/
  1245.     EntryNewScreen(SCR_ID_EMAIL_UNSENT_OPT, NULL, mmi_email_entry_unsent_opt, NULL);
  1246.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_UNSENT_OPT);
  1247.     SetParentHandler(MENU_ID_EMAIL_UNSENT_OPT);
  1248.     numItems = GetNumOfChild(MENU_ID_EMAIL_UNSENT_OPT);
  1249.     GetSequenceStringIds(MENU_ID_EMAIL_UNSENT_OPT, nStrItemList);
  1250.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1251.     ShowCategory52Screen(
  1252.         STR_GLOBAL_OPTIONS,
  1253.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  1254.         STR_GLOBAL_OK,
  1255.         IMG_GLOBAL_OK,
  1256.         STR_GLOBAL_BACK,
  1257.         IMG_GLOBAL_BACK,
  1258.         numItems,
  1259.         nStrItemList,
  1260.         (U16*) gIndexIconsImageList,
  1261.         NULL,
  1262.         0,
  1263.         0,
  1264.         guiBuffer);
  1265.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1266.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1267. }
  1268. /*****************************************************************************
  1269.  * FUNCTION
  1270.  *  mmi_email_hilite_unsent_send
  1271.  * DESCRIPTION
  1272.  *  Highlight handler of of Unsent-> Send option
  1273.  * PARAMETERS
  1274.  *  void
  1275.  * RETURNS
  1276.  *  void
  1277.  *****************************************************************************/
  1278. void mmi_email_hilite_unsent_send(void)
  1279. {
  1280.     /*----------------------------------------------------------------*/
  1281.     /* Local Variables                                                */
  1282.     /*----------------------------------------------------------------*/
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Code Body                                                      */
  1285.     /*----------------------------------------------------------------*/
  1286.     SetLeftSoftkeyFunction(mmi_email_unsent_send, KEY_EVENT_UP);
  1287. }
  1288. /*****************************************************************************
  1289.  * FUNCTION
  1290.  *  mmi_email_hilite_unsent_save_n_send
  1291.  * DESCRIPTION
  1292.  *  Highlight handler of of Unsent-> Save and Send option
  1293.  * PARAMETERS
  1294.  *  void
  1295.  * RETURNS
  1296.  *  void
  1297.  *****************************************************************************/
  1298. void mmi_email_hilite_unsent_save_n_send(void)
  1299. {
  1300.     /*----------------------------------------------------------------*/
  1301.     /* Local Variables                                                */
  1302.     /*----------------------------------------------------------------*/
  1303.     /*----------------------------------------------------------------*/
  1304.     /* Code Body                                                      */
  1305.     /*----------------------------------------------------------------*/
  1306.     SetLeftSoftkeyFunction(mmi_email_unsent_save_n_send, KEY_EVENT_UP);
  1307. }
  1308. /*****************************************************************************
  1309.  * FUNCTION
  1310.  *  mmi_email_hilite_unsent_edit
  1311.  * DESCRIPTION
  1312.  *  Highlight handler of of Unsent-> Edit
  1313.  * PARAMETERS
  1314.  *  void
  1315.  * RETURNS
  1316.  *  void
  1317.  *****************************************************************************/
  1318. void mmi_email_hilite_unsent_edit(void)
  1319. {
  1320.     /*----------------------------------------------------------------*/
  1321.     /* Local Variables                                                */
  1322.     /*----------------------------------------------------------------*/
  1323.     /*----------------------------------------------------------------*/
  1324.     /* Code Body                                                      */
  1325.     /*----------------------------------------------------------------*/
  1326.     SetLeftSoftkeyFunction(mmi_email_ps_folder_msg_select_req, KEY_EVENT_UP);
  1327.     SetKeyHandler(mmi_email_ps_folder_msg_select_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1328. }
  1329. /*****************************************************************************
  1330.  * FUNCTION
  1331.  *  mmi_email_hilite_unsent_move
  1332.  * DESCRIPTION
  1333.  *  Highlight handler of of Unsent-> Move to Deaft
  1334.  * PARAMETERS
  1335.  *  void
  1336.  * RETURNS
  1337.  *  void
  1338.  *****************************************************************************/
  1339. void mmi_email_hilite_unsent_move(void)
  1340. {
  1341.     /*----------------------------------------------------------------*/
  1342.     /* Local Variables                                                */
  1343.     /*----------------------------------------------------------------*/
  1344.     /*----------------------------------------------------------------*/
  1345.     /* Code Body                                                      */
  1346.     /*----------------------------------------------------------------*/
  1347.     SetLeftSoftkeyFunction(mmi_email_ps_move_to_draft_req, KEY_EVENT_UP);
  1348. }
  1349. /*****************************************************************************
  1350.  * FUNCTION
  1351.  *  mmi_email_unsent_send
  1352.  * DESCRIPTION
  1353.  *  Handler of Unsent->Option->Send
  1354.  * PARAMETERS
  1355.  *  void
  1356.  * RETURNS
  1357.  *  void
  1358.  *****************************************************************************/
  1359. void mmi_email_unsent_send(void)
  1360. {
  1361.     /*----------------------------------------------------------------*/
  1362.     /* Local Variables                                                */
  1363.     /*----------------------------------------------------------------*/
  1364.     /*----------------------------------------------------------------*/
  1365.     /* Code Body                                                      */
  1366.     /*----------------------------------------------------------------*/
  1367.     mmi_email_ps_send_from_mailbox_req(FALSE);
  1368. }
  1369. /*****************************************************************************
  1370.  * FUNCTION
  1371.  *  mmi_email_unsent_save_n_send
  1372.  * DESCRIPTION
  1373.  *  Handler of Unsent->Option->Save and Send
  1374.  * PARAMETERS
  1375.  *  void
  1376.  * RETURNS
  1377.  *  void
  1378.  *****************************************************************************/
  1379. void mmi_email_unsent_save_n_send(void)
  1380. {
  1381.     /*----------------------------------------------------------------*/
  1382.     /* Local Variables                                                */
  1383.     /*----------------------------------------------------------------*/
  1384.     /*----------------------------------------------------------------*/
  1385.     /* Code Body                                                      */
  1386.     /*----------------------------------------------------------------*/
  1387.     mmi_email_ps_send_from_mailbox_req(TRUE);
  1388. }
  1389. #define DRAFT_EMAIL
  1390. /*****************************************************************************
  1391.  * FUNCTION
  1392.  *  mmi_email_entry_draft
  1393.  * DESCRIPTION
  1394.  *  Entry function of Draft folder
  1395.  * PARAMETERS
  1396.  *  void
  1397.  * RETURNS
  1398.  *  void
  1399.  *****************************************************************************/
  1400. void mmi_email_entry_draft(void)
  1401. {
  1402.     /*----------------------------------------------------------------*/
  1403.     /* Local Variables                                                */
  1404.     /*----------------------------------------------------------------*/
  1405.     S32 numItems;
  1406.     /*----------------------------------------------------------------*/
  1407.     /* Code Body                                                      */
  1408.     /*----------------------------------------------------------------*/
  1409.     numItems = mmi_email_fldr_get_num_mails();
  1410.     if (numItems)
  1411.     {
  1412.         U8 *guiBuffer;
  1413.         S32 list_not_ready;
  1414.         EntryNewScreen(SCR_ID_EMAIL_DRAFT, mmi_email_exit_draft, NULL, NULL);
  1415.         email_p->fldr_info.need_fldr_sel = FALSE;
  1416.         guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_DRAFT);
  1417.         RegisterHighlightHandler(mmi_email_hilite_draft_item);
  1418.         /* to prevent the selected mail being deleted */
  1419.         if (email_p->fldr_info.curr_mail_indx >= numItems)
  1420.         {
  1421.             email_p->fldr_info.curr_mail_indx = numItems - 1;
  1422.         }
  1423.         ShowCategory262Screen(
  1424.             mmi_email_util_folder_select_cap_str(STR_EMAIL_DRAFT_ID),
  1425.             GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  1426.             STR_GLOBAL_OPTIONS,
  1427.             IMG_GLOBAL_OPTIONS,
  1428.             STR_GLOBAL_BACK,
  1429.             IMG_GLOBAL_BACK,
  1430.             numItems,
  1431.             mmi_email_fldr_get_async_items,
  1432.             mmi_email_draft_get_async_hints,
  1433.             email_p->fldr_info.curr_mail_indx,
  1434.             IMG_EMAIL_SENT_NORMAL_ID,
  1435.             guiBuffer,
  1436.             &list_not_ready);
  1437.         if (list_not_ready)
  1438.         {
  1439.             mmi_email_fldr_pre_folder_select_req();
  1440.         }
  1441.         else
  1442.         {
  1443.             email_p->fldr_info.is_list_displayed = TRUE;
  1444.             SetLeftSoftkeyFunction(mmi_email_entry_draft_opt, KEY_EVENT_UP);
  1445.             SetKeyHandler(mmi_email_entry_draft_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1446.             SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1447.             SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1448.         }
  1449.     }
  1450.     else
  1451.     {
  1452.         DisplayPopup(
  1453.             (U8*) GetString(STR_GLOBAL_EMPTY),
  1454.             IMG_GLOBAL_EMPTY,
  1455.             1,
  1456.             UI_POPUP_NOTIFYDURATION_TIME,
  1457.             (U8) EMPTY_LIST_TONE);
  1458.     }
  1459. }
  1460. /*****************************************************************************
  1461.  * FUNCTION
  1462.  *  mmi_email_exit_draft
  1463.  * DESCRIPTION
  1464.  *  Exit function of Draft folder
  1465.  * PARAMETERS
  1466.  *  void
  1467.  * RETURNS
  1468.  *  void
  1469.  *****************************************************************************/
  1470. void mmi_email_exit_draft(void)
  1471. {
  1472.     /*----------------------------------------------------------------*/
  1473.     /* Local Variables                                                */
  1474.     /*----------------------------------------------------------------*/
  1475.     /*----------------------------------------------------------------*/
  1476.     /* Code Body                                                      */
  1477.     /*----------------------------------------------------------------*/
  1478.     mmi_email_util_add_history(SCR_ID_EMAIL_DRAFT, mmi_email_fldr_back_from_history);
  1479. }
  1480. /*****************************************************************************
  1481.  * FUNCTION
  1482.  *  mmi_email_hilite_draft_item
  1483.  * DESCRIPTION
  1484.  *  Highlight handler of Draft list
  1485.  * PARAMETERS
  1486.  *  index       [IN]        
  1487.  * RETURNS
  1488.  *  void
  1489.  *****************************************************************************/
  1490. void mmi_email_hilite_draft_item(S32 index)
  1491. {
  1492.     /*----------------------------------------------------------------*/
  1493.     /* Local Variables                                                */
  1494.     /*----------------------------------------------------------------*/
  1495.     /*----------------------------------------------------------------*/
  1496.     /* Code Body                                                      */
  1497.     /*----------------------------------------------------------------*/
  1498.     email_p->fldr_info.curr_mail_indx = index;
  1499. }
  1500. /*****************************************************************************
  1501.  * FUNCTION
  1502.  *  mmi_email_draft_get_async_hints
  1503.  * DESCRIPTION
  1504.  *  Get hint data of Draft folder
  1505.  * PARAMETERS
  1506.  *  start_indx      [IN]        Start index of item to be retrieved.
  1507.  *  hintArray       [IN]        Array to store hint data
  1508.  * RETURNS
  1509.  *  void
  1510.  *****************************************************************************/
  1511. S32 mmi_email_draft_get_async_hints(S32 start_indx, UI_string_type *hintArray)
  1512. {
  1513.     /*----------------------------------------------------------------*/
  1514.     /* Local Variables                                                */
  1515.     /*----------------------------------------------------------------*/
  1516.     S16 pNotAvailPool;
  1517.     mmi_email_mail_info_struct *temp;
  1518.     mmi_email_mail_info_struct *listMsgsStruct[EMAIL_TOTAL_MSG_BUFF];
  1519.     /*----------------------------------------------------------------*/
  1520.     /* Code Body                                                      */
  1521.     /*----------------------------------------------------------------*/
  1522.     mmi_mem_get_values(
  1523.         &email_p->mem_pool_info.mem_container,
  1524.         (S16) start_indx,
  1525.         (S16) start_indx,
  1526.         (void **)listMsgsStruct,
  1527.         &pNotAvailPool);
  1528.     temp = listMsgsStruct[0];
  1529.     email_p->fldr_info.curr_mail_uid = temp->mail_uid;
  1530.     pfnUnicodeStrcpy((S8*) hintArray[0], (S8*) temp->dt_buff);
  1531.     return TRUE;
  1532. }
  1533. /*****************************************************************************
  1534.  * FUNCTION
  1535.  *  mmi_email_entry_draft_opt
  1536.  * DESCRIPTION
  1537.  *  Entry function of Draft->Option screen
  1538.  * PARAMETERS
  1539.  *  void
  1540.  * RETURNS
  1541.  *  void
  1542.  *****************************************************************************/
  1543. void mmi_email_entry_draft_opt(void)
  1544. {
  1545.     /*----------------------------------------------------------------*/
  1546.     /* Local Variables                                                */
  1547.     /*----------------------------------------------------------------*/
  1548.     U16 numItems;
  1549.     U16 parentMenuId;
  1550.     U16 nStrItemList[MAX_SUB_MENUS];
  1551.     U8 *guiBuffer;
  1552.     /*----------------------------------------------------------------*/
  1553.     /* Code Body                                                      */
  1554.     /*----------------------------------------------------------------*/
  1555.     EntryNewScreen(SCR_ID_EMAIL_DRAFT_OPT, NULL, mmi_email_entry_draft_opt, NULL);
  1556.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_DRAFT_OPT);
  1557. #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  1558.     if ((email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4) && (email_p->fldr_info.total_page > 1))
  1559.     {
  1560.         parentMenuId = MENU_ID_EMAIL_DRAFT_OPT2;    /* (edit, delete, next page, previous page, jump to page) */
  1561.     }
  1562.     else
  1563. #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */ 
  1564.         parentMenuId = MENU_ID_EMAIL_DRAFT_OPT1;
  1565.     SetParentHandler(parentMenuId);
  1566.     numItems = GetNumOfChild(parentMenuId);
  1567.     GetSequenceStringIds(parentMenuId, nStrItemList);
  1568.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1569.     ShowCategory52Screen(
  1570.         STR_GLOBAL_OPTIONS,
  1571.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  1572.         STR_GLOBAL_OK,
  1573.         IMG_GLOBAL_OK,
  1574.         STR_GLOBAL_BACK,
  1575.         IMG_GLOBAL_BACK,
  1576.         numItems,
  1577.         nStrItemList,
  1578.         (U16*) gIndexIconsImageList,
  1579.         NULL,
  1580.         0,
  1581.         0,
  1582.         guiBuffer);
  1583.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1584.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1585. }
  1586. /*****************************************************************************
  1587.  * FUNCTION
  1588.  *  mmi_email_hilite_draft_edit
  1589.  * DESCRIPTION
  1590.  *  Highlight handler of Draft->Option->Edit
  1591.  * PARAMETERS
  1592.  *  void
  1593.  * RETURNS
  1594.  *  void
  1595.  *****************************************************************************/
  1596. void mmi_email_hilite_draft_edit(void)
  1597. {
  1598.     /*----------------------------------------------------------------*/
  1599.     /* Local Variables                                                */
  1600.     /*----------------------------------------------------------------*/
  1601.     /*----------------------------------------------------------------*/
  1602.     /* Code Body                                                      */
  1603.     /*----------------------------------------------------------------*/
  1604.     SetLeftSoftkeyFunction(mmi_email_ps_folder_msg_select_req, KEY_EVENT_UP);
  1605.     SetKeyHandler(mmi_email_ps_folder_msg_select_req, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1606. }
  1607. #define DELETE_EMAIL
  1608. /*****************************************************************************
  1609.  * FUNCTION
  1610.  *  mmi_email_entry_del_all
  1611.  * DESCRIPTION
  1612.  *  Entry function of Delete All option
  1613.  * PARAMETERS
  1614.  *  void
  1615.  * RETURNS
  1616.  *  void
  1617.  *****************************************************************************/
  1618. void mmi_email_entry_del_all(void)
  1619. {
  1620.     /*----------------------------------------------------------------*/
  1621.     /* Local Variables                                                */
  1622.     /*----------------------------------------------------------------*/
  1623.     U16 itemIcons[EMAIL_DELETE_ALL_OPTION_TOTAL];
  1624.     U8 *nStrItemList[EMAIL_DELETE_ALL_OPTION_TOTAL];
  1625.     U8 *popUpList[EMAIL_DELETE_ALL_OPTION_TOTAL];
  1626.     U8 *guiBuffer;
  1627.     /*----------------------------------------------------------------*/
  1628.     /* Code Body                                                      */
  1629.     /*----------------------------------------------------------------*/
  1630.     EntryNewScreen(SCR_ID_EMAIL_DELETE_ALL, mmi_email_exit_del_all, NULL, NULL);
  1631.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_DELETE_ALL);
  1632.     mmi_email_del_all_get_menu_detail(nStrItemList, itemIcons, popUpList);
  1633.     RegisterHighlightHandler(mmi_email_hilite_del_all_fldr);
  1634.     ShowCategory53Screen(
  1635.         STR_GLOBAL_DELETE_ALL,
  1636.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  1637.         STR_GLOBAL_OK,
  1638.         IMG_GLOBAL_OK,
  1639.         STR_GLOBAL_BACK,
  1640.         IMG_GLOBAL_BACK,
  1641.         EMAIL_DELETE_ALL_OPTION_TOTAL,
  1642.         (U8 **) nStrItemList,
  1643.         (U16*) /* itemIcons */ gIndexIconsImageList,
  1644.         (U8 **) popUpList,
  1645.         0,
  1646.         email_p->fldr_info.curr_mail_indx,
  1647.         guiBuffer);
  1648.     SetLeftSoftkeyFunction(mmi_email_del_all_confirm, KEY_EVENT_UP);
  1649.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1650.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1651. }
  1652. /*****************************************************************************
  1653.  * FUNCTION
  1654.  *  mmi_email_exit_del_all
  1655.  * DESCRIPTION
  1656.  *  Exit function of Delete All option
  1657.  * PARAMETERS
  1658.  *  void
  1659.  * RETURNS
  1660.  *  void
  1661.  *****************************************************************************/
  1662. void mmi_email_exit_del_all(void)
  1663. {
  1664.     /*----------------------------------------------------------------*/
  1665.     /* Local Variables                                                */
  1666.     /*----------------------------------------------------------------*/
  1667.     /*----------------------------------------------------------------*/
  1668.     /* Code Body                                                      */
  1669.     /*----------------------------------------------------------------*/
  1670.     mmi_email_util_add_history(SCR_ID_EMAIL_DELETE_ALL, mmi_email_entry_del_all);
  1671. }
  1672. /*****************************************************************************
  1673.  * FUNCTION
  1674.  *  mmi_email_del_all_get_menu_detail
  1675.  * DESCRIPTION
  1676.  *  Get data of menu items in Delete All screen
  1677.  * PARAMETERS
  1678.  *  nStrItemList        [IN]        
  1679.  *  itemIcons           [?]         
  1680.  *  popUpList           [IN]        
  1681.  * RETURNS
  1682.  *  void
  1683.  *****************************************************************************/
  1684. void mmi_email_del_all_get_menu_detail(U8 **nStrItemList, U16 *itemIcons, U8 **popUpList)
  1685. {
  1686.     /*----------------------------------------------------------------*/
  1687.     /* Local Variables                                                */
  1688.     /*----------------------------------------------------------------*/
  1689.     S32 i;
  1690.     /*----------------------------------------------------------------*/
  1691.     /* Code Body                                                      */
  1692.     /*----------------------------------------------------------------*/
  1693.     for (i = 0; i < EMAIL_DELETE_ALL_OPTION_TOTAL; i++)
  1694.     {
  1695.         itemIcons[i] = IMG_EMAIL_INBOX_ID + i;
  1696.         nStrItemList[i] = (U8*) GetString((U16) (STR_EMAIL_INBOX_ID + i));
  1697.     }
  1698. #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  1699.     if (email_p->prof_info.act_prof.in_prot == EMAIL_PROT_IMAP4)
  1700.     {
  1701.         /* sent folder */
  1702.         if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.sent_name))
  1703.         {
  1704.             nStrItemList[EMAIL_DEL_ALL_SENT_ENUM] = (U8*) email_p->prof_info.act_prof.sent_name;
  1705.         }
  1706.         /* draft folder */
  1707.         if (pfnUnicodeStrlen((S8*) email_p->prof_info.act_prof.draft_name))
  1708.         {
  1709.             nStrItemList[EMAIL_DEL_ALL_DRAFT_ENUM] = (U8*) email_p->prof_info.act_prof.draft_name;
  1710.         }
  1711.     }
  1712. #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */ 
  1713.     popUpList[EMAIL_DEL_ALL_INBOX_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_INBOX_ENUM, MMI_EMAIL_INBOX);
  1714.     popUpList[EMAIL_DEL_ALL_SENT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_SENT_ENUM, MMI_EMAIL_SENT);
  1715.     popUpList[EMAIL_DEL_ALL_UNSENT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_UNSENT_ENUM, MMI_EMAIL_UNSENT);
  1716.     popUpList[EMAIL_DEL_ALL_DRAFT_ENUM] = mmi_email_util_get_fldr_hint_value(EMAIL_DEL_ALL_DRAFT_ENUM, MMI_EMAIL_DRAFT);
  1717.     popUpList[EMAIL_DEL_ALL_FOLDER_ENUM] = mmi_email_util_get_hint_value_all_fldr(EMAIL_DEL_ALL_FOLDER_ENUM);
  1718. }
  1719. /*****************************************************************************
  1720.  * FUNCTION
  1721.  *  mmi_email_hilite_fldr_msg_del
  1722.  * DESCRIPTION
  1723.  *  Hililte function Folder List -> Option -> Delete option
  1724.  * PARAMETERS
  1725.  *  void
  1726.  * RETURNS
  1727.  *  void
  1728.  *****************************************************************************/
  1729. void mmi_email_hilite_fldr_msg_del(void)
  1730. {
  1731.     /*----------------------------------------------------------------*/
  1732.     /* Local Variables                                                */
  1733.     /*----------------------------------------------------------------*/
  1734.     /*----------------------------------------------------------------*/
  1735.     /* Code Body                                                      */
  1736.     /*----------------------------------------------------------------*/
  1737.     SetLeftSoftkeyFunction(mmi_email_del_single_msg, KEY_EVENT_UP);
  1738. }
  1739. /*****************************************************************************
  1740.  * FUNCTION
  1741.  *  mmi_email_del_single_msg
  1742.  * DESCRIPTION
  1743.  *  Display confirmation screen for Delete otpion in each folder
  1744.  * PARAMETERS
  1745.  *  void
  1746.  * RETURNS
  1747.  *  void
  1748.  *****************************************************************************/
  1749. void mmi_email_del_single_msg(void)
  1750. {
  1751.     /*----------------------------------------------------------------*/
  1752.     /* Local Variables                                                */
  1753.     /*----------------------------------------------------------------*/
  1754.     /*----------------------------------------------------------------*/
  1755.     /* Code Body                                                      */
  1756.     /*----------------------------------------------------------------*/
  1757.     mmi_email_display_confirm(STR_GLOBAL_DELETE, mmi_email_del_single_msg_done, GoBackHistory);
  1758. }
  1759. /*****************************************************************************
  1760.  * FUNCTION
  1761.  *  mmi_email_del_single_msg_done
  1762.  * DESCRIPTION
  1763.  *  Proceed deleting of current selected folder
  1764.  * PARAMETERS
  1765.  *  void
  1766.  * RETURNS
  1767.  *  void
  1768.  *****************************************************************************/
  1769. void mmi_email_del_single_msg_done(void)
  1770. {
  1771.     /*----------------------------------------------------------------*/
  1772.     /* Local Variables                                                */
  1773.     /*----------------------------------------------------------------*/
  1774.     /*----------------------------------------------------------------*/
  1775.     /* Code Body                                                      */
  1776.     /*----------------------------------------------------------------*/
  1777.     email_p->del_info.curr_del_fldr = (email_fldr_enum) email_p->main_info.curr_menu;
  1778.     mmi_email_ps_folder_msg_del_req();
  1779. }
  1780. /*****************************************************************************
  1781.  * FUNCTION
  1782.  *  mmi_email_del_all_confirm
  1783.  * DESCRIPTION
  1784.  *  Display confirmation screen for each items in Delete All menu
  1785.  * PARAMETERS
  1786.  *  void
  1787.  * RETURNS
  1788.  *  void
  1789.  *****************************************************************************/
  1790. void mmi_email_del_all_confirm(void)
  1791. {
  1792.     /*----------------------------------------------------------------*/
  1793.     /* Local Variables                                                */
  1794.     /*----------------------------------------------------------------*/
  1795.     /*----------------------------------------------------------------*/
  1796.     /* Code Body                                                      */
  1797.     /*----------------------------------------------------------------*/
  1798.     if (email_p->del_info.curr_del_fldr == EMAIL_DEL_ALL_FOLDER_ENUM)
  1799.     {
  1800.         U32 num_mails;
  1801.         num_mails = email_p->fldr_info.fldr_data[MMI_EMAIL_INBOX].total_mails +
  1802.             email_p->fldr_info.fldr_data[MMI_EMAIL_UNSENT].total_mails +
  1803.             email_p->fldr_info.fldr_data[MMI_EMAIL_SENT].total_mails +
  1804.             email_p->fldr_info.fldr_data[MMI_EMAIL_DRAFT].total_mails;
  1805.         email_p->del_info.curr_del_fldr = EMAIL_FLDR_INBOX;
  1806.         email_p->del_info.del_all_fldr = TRUE;
  1807.         if (num_mails != 0)
  1808.         {
  1809.             mmi_email_display_confirm(STR_GLOBAL_DELETE_ALL, mmi_email_del_all_folders, GoBackHistory);
  1810.         }
  1811.         else
  1812.         {
  1813.             DisplayPopup(
  1814.                 (U8*) GetString(STR_GLOBAL_EMPTY),
  1815.                 IMG_GLOBAL_EMPTY,
  1816.                 1,
  1817.                 UI_POPUP_NOTIFYDURATION_TIME,
  1818.                 (U8) EMPTY_LIST_TONE);
  1819.         }
  1820.     }
  1821.     else
  1822.     {
  1823.         /* the order of folder will not be changed */
  1824.         email_p->del_info.del_all_fldr = FALSE;
  1825.         if (email_p->fldr_info.fldr_data[email_p->del_info.curr_del_fldr].total_mails != 0)
  1826.         {
  1827.             mmi_email_display_confirm(STR_GLOBAL_DELETE_ALL, mmi_email_ps_folder_msg_del_req, GoBackHistory);
  1828.         }
  1829.         else
  1830.         {
  1831.             DisplayPopup(
  1832.                 (U8*) GetString(STR_GLOBAL_EMPTY),
  1833.                 IMG_GLOBAL_EMPTY,
  1834.                 1,
  1835.                 UI_POPUP_NOTIFYDURATION_TIME,
  1836.                 (U8) EMPTY_LIST_TONE);
  1837.         }
  1838.     }
  1839. }
  1840. /*****************************************************************************
  1841.  * FUNCTION
  1842.  *  mmi_email_hilite_del_all_fldr
  1843.  * DESCRIPTION
  1844.  *  Highlight handler of items in Delete All menu.
  1845.  * PARAMETERS
  1846.  *  index       [IN]        
  1847.  * RETURNS
  1848.  *  void
  1849.  *****************************************************************************/
  1850. void mmi_email_hilite_del_all_fldr(S32 index)
  1851. {
  1852.     /*----------------------------------------------------------------*/
  1853.     /* Local Variables                                                */
  1854.     /*----------------------------------------------------------------*/
  1855.     /*----------------------------------------------------------------*/
  1856.     /* Code Body                                                      */
  1857.     /*----------------------------------------------------------------*/
  1858.     email_p->del_info.curr_del_fldr = (email_fldr_enum) index;
  1859. }
  1860. /*****************************************************************************
  1861.  * FUNCTION
  1862.  *  mmi_email_del_all_folders
  1863.  * DESCRIPTION
  1864.  *  Proceed delete all folders
  1865.  * PARAMETERS
  1866.  *  void
  1867.  * RETURNS
  1868.  *  void
  1869.  *****************************************************************************/
  1870. void mmi_email_del_all_folders(void)
  1871. {
  1872.     /*----------------------------------------------------------------*/
  1873.     /* Local Variables                                                */
  1874.     /*----------------------------------------------------------------*/
  1875.     /*----------------------------------------------------------------*/
  1876.     /* Code Body                                                      */
  1877.     /*----------------------------------------------------------------*/
  1878.     if (email_p->del_info.curr_del_fldr != EMAIL_DEL_ALL_FOLDER_ENUM)
  1879.     {
  1880.         mmi_email_ps_folder_msg_del_req();
  1881.     }
  1882.     else
  1883.     {
  1884.         U16 startSrcnId;
  1885.         /* update idle screen icon status */
  1886.         email_p->del_info.del_all_fldr = FALSE;
  1887.         email_p->main_info.unread_mails = 0;
  1888.         email_p->main_info.is_mem_full = FALSE;
  1889.         mmi_email_util_update_status_icon();
  1890.         DisplayPopup(
  1891.             (U8*) GetString(STR_GLOBAL_DONE),
  1892.             IMG_GLOBAL_ACTIVATED,
  1893.             1,
  1894.             UI_POPUP_NOTIFYDURATION_TIME,
  1895.             (U8) SUCCESS_TONE);
  1896.         GetNextScrnIdOf(SCR_ID_EMAIL_DELETE_ALL, &startSrcnId);
  1897.         DeleteBetweenScreen(startSrcnId, SCR_ID_EMAIL_PROGRESS);
  1898.     }
  1899. }
  1900. #define PROFILE_EMAIL
  1901. /*****************************************************************************
  1902.  * FUNCTION
  1903.  *  mmi_email_hilite_prof_setting
  1904.  * DESCRIPTION
  1905.  *  highlight handler for Profile Setting option
  1906.  * PARAMETERS
  1907.  *  void
  1908.  * RETURNS
  1909.  *  void
  1910.  *****************************************************************************/
  1911. void mmi_email_hilite_prof_setting(void)
  1912. {
  1913.     /*----------------------------------------------------------------*/
  1914.     /* Local Variables                                                */
  1915.     /*----------------------------------------------------------------*/
  1916.     /*----------------------------------------------------------------*/
  1917.     /* Code Body                                                      */
  1918.     /*----------------------------------------------------------------*/
  1919.     SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1920.     email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_SETTING;
  1921. }
  1922. /*****************************************************************************
  1923.  * FUNCTION
  1924.  *  mmi_email_hilite_prof_smtp
  1925.  * DESCRIPTION
  1926.  *  highlight handler for SMTP option
  1927.  * PARAMETERS
  1928.  *  void
  1929.  * RETURNS
  1930.  *  void
  1931.  *****************************************************************************/
  1932. void mmi_email_hilite_prof_smtp(void)
  1933. {
  1934.     /*----------------------------------------------------------------*/
  1935.     /* Local Variables                                                */
  1936.     /*----------------------------------------------------------------*/
  1937.     /*----------------------------------------------------------------*/
  1938.     /* Code Body                                                      */
  1939.     /*----------------------------------------------------------------*/
  1940.     SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1941.     email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_SMTP;
  1942. }
  1943. /*****************************************************************************
  1944.  * FUNCTION
  1945.  *  mmi_email_hilite_prof_pop3_impa4
  1946.  * DESCRIPTION
  1947.  *  highlight handler for POP3/IMAP4 option
  1948.  * PARAMETERS
  1949.  *  void
  1950.  * RETURNS
  1951.  *  void
  1952.  *****************************************************************************/
  1953. void mmi_email_hilite_prof_pop3_impa4(void)
  1954. {
  1955.     /*----------------------------------------------------------------*/
  1956.     /* Local Variables                                                */
  1957.     /*----------------------------------------------------------------*/
  1958.     /*----------------------------------------------------------------*/
  1959.     /* Code Body                                                      */
  1960.     /*----------------------------------------------------------------*/
  1961.     SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1962.     email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_POP3_IMAP4;
  1963. }
  1964. /*****************************************************************************
  1965.  * FUNCTION
  1966.  *  mmi_email_hilite_prof_sig
  1967.  * DESCRIPTION
  1968.  *  highlight handler for Signature option
  1969.  * PARAMETERS
  1970.  *  void
  1971.  * RETURNS
  1972.  *  void
  1973.  *****************************************************************************/
  1974. void mmi_email_hilite_prof_sig(void)
  1975. {
  1976.     /*----------------------------------------------------------------*/
  1977.     /* Local Variables                                                */
  1978.     /*----------------------------------------------------------------*/
  1979.     /*----------------------------------------------------------------*/
  1980.     /* Code Body                                                      */
  1981.     /*----------------------------------------------------------------*/
  1982.     SetKeyHandler(mmi_email_prof_get_data, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1983.     email_p->prof_info.prof_misc.curr_scr = SCR_ID_EMAIL_PROF_SIG;
  1984. }
  1985. /*****************************************************************************
  1986.  * FUNCTION
  1987.  *  mmi_email_entry_comm_full_edit_opt
  1988.  * DESCRIPTION
  1989.  *  Entry common full screen editor in Profile.
  1990.  * PARAMETERS
  1991.  *  void
  1992.  * RETURNS
  1993.  *  void
  1994.  *****************************************************************************/
  1995. void mmi_email_entry_comm_full_edit_opt(void)
  1996. {
  1997.     /*----------------------------------------------------------------*/
  1998.     /* Local Variables                                                */
  1999.     /*----------------------------------------------------------------*/
  2000.     U8 *guiBuffer;
  2001.     U16 itemList[2];
  2002.     U16 nItems;
  2003.     /*----------------------------------------------------------------*/
  2004.     /* Code Body                                                      */
  2005.     /*----------------------------------------------------------------*/
  2006.     EntryNewScreen(SCR_ID_EMAIL_PROF_FULL_EDIT_OPT, NULL, mmi_email_entry_comm_full_edit_opt, NULL);
  2007.     SetParentHandler(MENU_ID_EMAIL_PROF_EDITOR_OPT);
  2008.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_FULL_EDIT_OPT);
  2009.     nItems = GetNumOfChild(MENU_ID_EMAIL_PROF_EDITOR_OPT);
  2010.     GetSequenceStringIds(MENU_ID_EMAIL_PROF_EDITOR_OPT, itemList);
  2011.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2012.     ShowCategory52Screen(
  2013.         STR_GLOBAL_OPTIONS,
  2014.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2015.         STR_GLOBAL_OK,
  2016.         IMG_GLOBAL_OK,
  2017.         STR_GLOBAL_BACK,
  2018.         IMG_GLOBAL_BACK,
  2019.         nItems,
  2020.         itemList,
  2021.         (PU16) gIndexIconsImageList,
  2022.         0,
  2023.         0,
  2024.         0,
  2025.         guiBuffer);
  2026.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2027. }
  2028. /*****************************************************************************
  2029.  * FUNCTION
  2030.  *  mmi_email_entry_prof
  2031.  * DESCRIPTION
  2032.  *  Entry profile list screen
  2033.  * PARAMETERS
  2034.  *  void
  2035.  * RETURNS
  2036.  *  void
  2037.  *****************************************************************************/
  2038. extern const U16 gIndexIconsImageList[];
  2039. void mmi_email_entry_prof(void)
  2040. {
  2041.     /*----------------------------------------------------------------*/
  2042.     /* Local Variables                                                */
  2043.     /*----------------------------------------------------------------*/
  2044.     S32 i;
  2045.     U8 *nStrItemList[MMI_EMAIL_MAX_ACCTS];
  2046.     U16 nIconItemList[MMI_EMAIL_MAX_ACCTS];
  2047.     U8 *guiBuffer;
  2048.     /*----------------------------------------------------------------*/
  2049.     /* Code Body                                                      */
  2050.     /*----------------------------------------------------------------*/
  2051.     EntryNewScreen(SCR_ID_EMAIL_PROF, NULL, mmi_email_entry_prof, NULL);
  2052.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF);
  2053.     for (i = 0; i < MMI_EMAIL_MAX_ACCTS; i++)
  2054.     {
  2055.         nStrItemList[i] = (U8*) email_p->prof_info.prof_misc.acct_names[i];
  2056.         nIconItemList[i] = 0;
  2057.     }
  2058.     if (mmi_email_prof_is_activated())
  2059.     {
  2060.         nIconItemList[email_p->prof_info.act_prof.act_indx] = IMG_VICON;
  2061.         email_p->prof_info.prof_misc.curr_sel_prof = email_p->prof_info.act_prof.act_indx;
  2062.     }
  2063.     else
  2064.     {
  2065.         email_p->prof_info.prof_misc.curr_sel_prof = 0;
  2066.     }
  2067.     RegisterHighlightHandler(mmi_email_hilite_prof_list);
  2068.     /*
  2069.      * ShowCategory53Screen (STR_EMAIL_PROFILES_ID, GetRootTitleIcon(MENU_ID_EMAIL_MAIN), 
  2070.      * STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS,
  2071.      * STR_GLOBAL_BACK, IMG_GLOBAL_BACK,
  2072.      * MMI_EMAIL_MAX_ACCTS,  nStrItemList,
  2073.      * (U16*)nIconItemList,
  2074.      * NULL, 0,  (S32)email_p->prof_info.prof_misc.curr_sel_prof, guiBuffer);
  2075.      */
  2076.     ShowCategory73Screen(
  2077.         STR_EMAIL_PROFILES_ID,
  2078.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2079.         STR_GLOBAL_OPTIONS,
  2080.         IMG_GLOBAL_OPTIONS,
  2081.         STR_GLOBAL_BACK,
  2082.         IMG_GLOBAL_BACK,
  2083.         MMI_EMAIL_MAX_ACCTS,
  2084.         nStrItemList,
  2085.         (U16*) nIconItemList,
  2086.         (U16*) gIndexIconsImageList,
  2087.         (S32) email_p->prof_info.prof_misc.curr_sel_prof,
  2088.         guiBuffer,
  2089.         ICON_ICON_TEXT);
  2090.     SetLeftSoftkeyFunction(mmi_email_entry_prof_opt, KEY_EVENT_UP);
  2091.     SetKeyHandler(mmi_email_entry_prof_opt, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2092.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2093.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2094. }
  2095. /*****************************************************************************
  2096.  * FUNCTION
  2097.  *  mmi_email_hilite_prof_list
  2098.  * DESCRIPTION
  2099.  *  Highlight handler of Profile list.
  2100.  * PARAMETERS
  2101.  *  index       [IN]        Index of highlighted profile.
  2102.  * RETURNS
  2103.  *  void
  2104.  *****************************************************************************/
  2105. void mmi_email_hilite_prof_list(S32 index)
  2106. {
  2107.     /*----------------------------------------------------------------*/
  2108.     /* Local Variables                                                */
  2109.     /*----------------------------------------------------------------*/
  2110.     /*----------------------------------------------------------------*/
  2111.     /* Code Body                                                      */
  2112.     /*----------------------------------------------------------------*/
  2113.     email_p->prof_info.prof_misc.curr_sel_prof = (U8) index;
  2114. }
  2115. /*****************************************************************************
  2116.  * FUNCTION
  2117.  *  mmi_email_entry_prof_opt
  2118.  * DESCRIPTION
  2119.  *  Entry function of Profile->Option
  2120.  * PARAMETERS
  2121.  *  void
  2122.  * RETURNS
  2123.  *  void
  2124.  *****************************************************************************/
  2125. void mmi_email_entry_prof_opt(void)
  2126. {
  2127.     /*----------------------------------------------------------------*/
  2128.     /* Local Variables                                                */
  2129.     /*----------------------------------------------------------------*/
  2130.     U16 numItems;
  2131.     U16 nStrItemList[2];    /* only Done and Input Method */
  2132.     U8 *guiBuffer;
  2133.     /*----------------------------------------------------------------*/
  2134.     /* Code Body                                                      */
  2135.     /*----------------------------------------------------------------*/
  2136.     EntryNewScreen(SCR_ID_EMAIL_PROF_OPT, NULL, mmi_email_entry_prof_opt, NULL);
  2137.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_OPT);
  2138.     SetParentHandler(MENU_ID_EMAIL_PROF_OPT);
  2139.     numItems = GetNumOfChild(MENU_ID_EMAIL_PROF_OPT);
  2140.     GetSequenceStringIds(MENU_ID_EMAIL_PROF_OPT, nStrItemList);
  2141.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2142.     ShowCategory52Screen(
  2143.         STR_EMAIL_PROFILE_OPTIONS_ID,
  2144.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2145.         STR_GLOBAL_OK,
  2146.         IMG_GLOBAL_OK,
  2147.         STR_GLOBAL_BACK,
  2148.         IMG_GLOBAL_BACK,
  2149.         numItems,
  2150.         nStrItemList,
  2151.         (U16*) gIndexIconsImageList,
  2152.         NULL,
  2153.         0,
  2154.         0,
  2155.         guiBuffer);
  2156.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2157.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2158. }
  2159. /*****************************************************************************
  2160.  * FUNCTION
  2161.  *  mmi_email_hilite_prof_activate
  2162.  * DESCRIPTION
  2163.  *  Highlight handler of Profile->Acticate option
  2164.  * PARAMETERS
  2165.  *  void
  2166.  * RETURNS
  2167.  *  void
  2168.  *****************************************************************************/
  2169. void mmi_email_hilite_prof_activate(void)
  2170. {
  2171.     /*----------------------------------------------------------------*/
  2172.     /* Local Variables                                                */
  2173.     /*----------------------------------------------------------------*/
  2174.     /*----------------------------------------------------------------*/
  2175.     /* Code Body                                                      */
  2176.     /*----------------------------------------------------------------*/
  2177.     SetLeftSoftkeyFunction(mmi_email_prof_activate, KEY_EVENT_UP);
  2178. }
  2179. /*****************************************************************************
  2180.  * FUNCTION
  2181.  *  mmi_email_prof_activate
  2182.  * DESCRIPTION
  2183.  *  Handler of Profile->Option->Activate
  2184.  * PARAMETERS
  2185.  *  void
  2186.  * RETURNS
  2187.  *  void
  2188.  *****************************************************************************/
  2189. void mmi_email_prof_activate(void)
  2190. {
  2191.     /*----------------------------------------------------------------*/
  2192.     /* Local Variables                                                */
  2193.     /*----------------------------------------------------------------*/
  2194.     /*----------------------------------------------------------------*/
  2195.     /* Code Body                                                      */
  2196.     /*----------------------------------------------------------------*/
  2197.     mmi_email_ps_activate_acct_req((U8) (email_p->prof_info.prof_misc.curr_sel_prof + 1));
  2198. }
  2199. /*****************************************************************************
  2200.  * FUNCTION
  2201.  *  mmi_email_prof_get_data
  2202.  * DESCRIPTION
  2203.  *  Send request to get current selected profile data.
  2204.  * PARAMETERS
  2205.  *  void
  2206.  * RETURNS
  2207.  *  void
  2208.  *****************************************************************************/
  2209. void mmi_email_prof_get_data(void)
  2210. {
  2211.     /*----------------------------------------------------------------*/
  2212.     /* Local Variables                                                */
  2213.     /*----------------------------------------------------------------*/
  2214.     /*----------------------------------------------------------------*/
  2215.     /* Code Body                                                      */
  2216.     /*----------------------------------------------------------------*/
  2217.     mmi_email_ps_get_acct_profile_req((U8) (email_p->prof_info.prof_misc.curr_sel_prof + 1));
  2218. }
  2219. /*****************************************************************************
  2220.  * FUNCTION
  2221.  *  mmi_email_hilite_prof_edit
  2222.  * DESCRIPTION
  2223.  *  Highlight handler of Profile->Edit option
  2224.  * PARAMETERS
  2225.  *  void
  2226.  * RETURNS
  2227.  *  void
  2228.  *****************************************************************************/
  2229. void mmi_email_hilite_prof_edit(void)
  2230. {
  2231.     /*----------------------------------------------------------------*/
  2232.     /* Local Variables                                                */
  2233.     /*----------------------------------------------------------------*/
  2234.     /*----------------------------------------------------------------*/
  2235.     /* Code Body                                                      */
  2236.     /*----------------------------------------------------------------*/
  2237.     SetLeftSoftkeyFunction(mmi_email_entry_prof_edit, KEY_EVENT_UP);
  2238.     SetKeyHandler(mmi_email_entry_prof_edit, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2239. }
  2240. /*****************************************************************************
  2241.  * FUNCTION
  2242.  *  mmi_email_entry_prof_edit
  2243.  * DESCRIPTION
  2244.  *  Entry function of Profile->Option->Edit
  2245.  * PARAMETERS
  2246.  *  void
  2247.  * RETURNS
  2248.  *  void
  2249.  *****************************************************************************/
  2250. void mmi_email_entry_prof_edit(void)
  2251. {
  2252.     /*----------------------------------------------------------------*/
  2253.     /* Local Variables                                                */
  2254.     /*----------------------------------------------------------------*/
  2255.     U16 numItems;
  2256.     U16 nStrItemList[EMAIL_PROF_TOTAL];
  2257.     U8 *guiBuffer;
  2258.     U16 emailEmailProfileSettingIcons[EMAIL_PROF_TOTAL] = 
  2259.     {
  2260.         IMG_EMAIL_PROFILE_SETTING_ID,
  2261.         IMG_EMAIL_SMTP_SETTING_ID,
  2262.         IMG_EMAIL_IMAP_POP3_SETTING_ID,
  2263.         IMG_EMAIL_SIGNATURE_SETTING_ID
  2264.     };
  2265.     /*----------------------------------------------------------------*/
  2266.     /* Code Body                                                      */
  2267.     /*----------------------------------------------------------------*/
  2268.     EntryNewScreen(SCR_ID_EMAIL_PROF_OPT_EDIT, NULL, mmi_email_entry_prof_edit, NULL);
  2269.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_OPT_EDIT);
  2270.     SetParentHandler(MENU_ID_EMAIL_PROF_EDIT_OPT);
  2271.     numItems = GetNumOfChild(MENU_ID_EMAIL_PROF_EDIT_OPT);
  2272.     GetSequenceStringIds(MENU_ID_EMAIL_PROF_EDIT_OPT, nStrItemList);
  2273.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2274.     ShowCategory52Screen(
  2275.         STR_EMAIL_PROFILE_ID,
  2276.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2277.         STR_GLOBAL_OK,
  2278.         IMG_GLOBAL_OK,
  2279.         STR_GLOBAL_BACK,
  2280.         IMG_GLOBAL_BACK,
  2281.         numItems,
  2282.         nStrItemList,
  2283.         (U16*) emailEmailProfileSettingIcons,
  2284.         NULL,
  2285.         0,
  2286.         0,
  2287.         guiBuffer);
  2288.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2289.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  2290.     SetLeftSoftkeyFunction(mmi_email_prof_get_data, KEY_EVENT_UP);
  2291. }
  2292. /*****************************************************************************
  2293.  * FUNCTION
  2294.  *  mmi_email_entry_prof_setting
  2295.  * DESCRIPTION
  2296.  *  Entry function of Profile Setting screen.
  2297.  * PARAMETERS
  2298.  *  void
  2299.  * RETURNS
  2300.  *  void
  2301.  *****************************************************************************/
  2302. void mmi_email_entry_prof_setting(void)
  2303. {
  2304.     /*----------------------------------------------------------------*/
  2305.     /* Local Variables                                                */
  2306.     /*----------------------------------------------------------------*/
  2307.     U8 *guiBuffer;
  2308.     U8 *inputBuffer;
  2309.     U16 inputBufferSize;
  2310.     U16 setting_icon[EMAIL_SETTING_TOTAL_ITEM] = 
  2311.     {
  2312.         IMG_EMAIL_PROFILE_NAME_ID, 0,
  2313.         IMG_EMAIL_DATA_ACCOUNT_ID, 0,
  2314.     #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  2315.         IMG_EMAIL_PROTOCOL_ID, 0,
  2316.     #endif 
  2317.     #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
  2318.         IMG_EMAIL_CHECK_INTERVAL_ID, 0,
  2319.     #endif 
  2320.         IMG_EMAIL_DOWNLOAD_TYPE_ID, 0
  2321.     };
  2322.     /*----------------------------------------------------------------*/
  2323.     /* Code Body                                                      */
  2324.     /*----------------------------------------------------------------*/
  2325.     EntryNewScreen(SCR_ID_EMAIL_PROF_SETTING, mmi_email_exit_prof_setting, NULL, NULL);
  2326.     InitializeCategory57Screen();
  2327.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_SETTING);
  2328.     inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_PROF_SETTING, &inputBufferSize);
  2329.     mmi_email_prof_fill_setting_inline_struct();
  2330.     if (inputBuffer != NULL)
  2331.     {
  2332.         SetCategory57Data(wgui_inline_items, EMAIL_SETTING_TOTAL_ITEM, inputBuffer);
  2333.     }
  2334.     ShowCategory57Screen(
  2335.         STR_EMAIL_PROFILE_SETTING_ID,
  2336.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2337.         STR_GLOBAL_EDIT,
  2338.         IMG_GLOBAL_BACK,
  2339.         STR_GLOBAL_BACK,
  2340.         IMG_GLOBAL_BACK,
  2341.         EMAIL_SETTING_TOTAL_ITEM,
  2342.         (U16*) setting_icon,
  2343.         wgui_inline_items,
  2344.         0,
  2345.         guiBuffer);
  2346.     SetCategory57RightSoftkeyFunctions(mmi_email_prof_save_confirm, GoBackHistory);
  2347. }
  2348. /*****************************************************************************
  2349.  * FUNCTION
  2350.  *  mmi_email_exit_prof_setting
  2351.  * DESCRIPTION
  2352.  *  Exit function of Profile Setting screen.
  2353.  * PARAMETERS
  2354.  *  void
  2355.  * RETURNS
  2356.  *  void
  2357.  *****************************************************************************/
  2358. void mmi_email_exit_prof_setting(void)
  2359. {
  2360.     /*----------------------------------------------------------------*/
  2361.     /* Local Variables                                                */
  2362.     /*----------------------------------------------------------------*/
  2363.     /*----------------------------------------------------------------*/
  2364.     /* Code Body                                                      */
  2365.     /*----------------------------------------------------------------*/
  2366.     mmi_email_util_add_n_history(SCR_ID_EMAIL_PROF_SETTING, mmi_email_entry_prof_setting);
  2367. }
  2368. /*****************************************************************************
  2369.  * FUNCTION
  2370.  *  mmi_email_prof_save_setting
  2371.  * DESCRIPTION
  2372.  *  Save Profile Setting data
  2373.  * PARAMETERS
  2374.  *  void
  2375.  * RETURNS
  2376.  *  void
  2377.  *****************************************************************************/
  2378. void mmi_email_prof_save_setting(void)
  2379. {
  2380.     /*----------------------------------------------------------------*/
  2381.     /* Local Variables                                                */
  2382.     /*----------------------------------------------------------------*/
  2383.     U8 count;
  2384.     S32 DownloadMaxSize;
  2385.     /*----------------------------------------------------------------*/
  2386.     /* Code Body                                                      */
  2387.     /*----------------------------------------------------------------*/
  2388.     /* Profile name shall not be empty */
  2389.     if (pfnUnicodeStrlen((S8*) email_p->prof_info.editing_prof.setting_info.prof_name) == 0)
  2390.     {
  2391.         DisplayPopup(
  2392.             (U8*) GetString(STR_EMAIL_PROFILE_NAME_EMPTY),
  2393.             IMG_GLOBAL_EMPTY,
  2394.             1,
  2395.             UI_POPUP_NOTIFYDURATION_TIME,
  2396.             ERROR_TONE);
  2397.         return;
  2398.     }
  2399.     /* check if profile name duplicated */
  2400.     for (count = 0; count < MMI_EMAIL_MAX_ACCTS; count++)
  2401.     {
  2402.         if (email_p->prof_info.prof_misc.curr_sel_prof == count)
  2403.         {
  2404.             continue;
  2405.         }
  2406.         if (pfnUnicodeStrcmp
  2407.             ((S8*) email_p->prof_info.editing_prof.setting_info.prof_name,
  2408.              (S8*) email_p->prof_info.prof_misc.acct_names[count]) == 0)
  2409.         {
  2410.             DisplayPopup(
  2411.                 (U8*) GetString(STR_EMAIL_PROFILE_NAME_DUPLICATED),
  2412.                 IMG_GLOBAL_ERROR,
  2413.                 0,
  2414.                 UI_POPUP_NOTIFYDURATION_TIME,
  2415.                 ERROR_TONE);
  2416.             return;
  2417.         }
  2418.     }
  2419.     CloseCategory57Screen();
  2420.     DownloadMaxSize = gui_atoi((UI_string_type) email_p->prof_info.editing_prof.setting_info.dwnl_size);
  2421.     /* Download size exceeds boundary */
  2422.     if (DownloadMaxSize < MMI_EMAIL_MIN_MSG_SIZE || DownloadMaxSize > MMI_EMAIL_MAX_MSG_SIZE)
  2423.     {
  2424.         S8 *asciiMaxString = OslMalloc(EMAIL_MAX_DWNL_LEN);
  2425.         S8 *ucs2MaxString = OslMalloc(EMAIL_MAX_DWNL_LEN * ENCODING_LENGTH);
  2426.         if (DownloadMaxSize < MMI_EMAIL_MIN_MSG_SIZE)
  2427.         {
  2428.             sprintf((S8*) asciiMaxString, "n < %u", (U32) MMI_EMAIL_MIN_MSG_SIZE);
  2429.         }
  2430.         else
  2431.         {
  2432.             sprintf((S8*) asciiMaxString, "n > %u", (U32) MMI_EMAIL_MAX_MSG_SIZE);
  2433.         }
  2434.         pfnUnicodeStrcpy((S8*) email_p->comm_buff, (S8*) GetString(STR_EMAIL_MAX_SIZE));
  2435.         AnsiiToUnicodeString((S8*) ucs2MaxString, (S8*) asciiMaxString);
  2436.         pfnUnicodeStrcat((S8*) email_p->comm_buff, (S8*) ucs2MaxString);
  2437.         DisplayPopup((U8*) email_p->comm_buff, IMG_GLOBAL_EMPTY, 1, UI_POPUP_NOTIFYDURATION_TIME, ERROR_TONE);
  2438.         OslMfree(asciiMaxString);
  2439.         OslMfree(ucs2MaxString);
  2440.     }
  2441.     else
  2442.     {
  2443.         mmi_email_pre_entry_progressing(
  2444.             STR_EMAIL_MAIN_ID,
  2445.             GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2446.             0,
  2447.             0,
  2448.             0,
  2449.             0,
  2450.             (U8*) GetString(STR_GLOBAL_SAVING),
  2451.             NULL,
  2452.             IMG_EMAIL_SENDING_ID,
  2453.             NULL,
  2454.             NULL,
  2455.             NULL,
  2456.             0);
  2457.         mmi_email_ps_set_acct_profile_req();
  2458.     }
  2459. }
  2460. /*****************************************************************************
  2461.  * FUNCTION
  2462.  *  mmi_email_prof_fill_setting_inline_struct
  2463.  * DESCRIPTION
  2464.  *  Fill inline structure data for Profile Setting screen.
  2465.  * PARAMETERS
  2466.  *  void
  2467.  * RETURNS
  2468.  *  void
  2469.  *****************************************************************************/
  2470. void mmi_email_prof_fill_setting_inline_struct(void)
  2471. {
  2472.     /*----------------------------------------------------------------*/
  2473.     /* Local Variables                                                */
  2474.     /*----------------------------------------------------------------*/
  2475.     S32 max_dwnl_len;
  2476.     /*----------------------------------------------------------------*/
  2477.     /* Code Body                                                      */
  2478.     /*----------------------------------------------------------------*/
  2479. #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  2480.     /* protocol list */
  2481.     email_p->prof_info.prof_misc.prot_list[0] = (U8*) GetString(STR_EMAIL_POP3_ID);
  2482.     email_p->prof_info.prof_misc.prot_list[1] = (U8*) GetString(STR_EMAIL_IMAP4_ID);
  2483. #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */ 
  2484. #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
  2485.     /* check interval list */
  2486.     email_p->prof_info.prof_misc.chk_interval[0] = (U8*) GetString(STR_GLOBAL_OFF);
  2487.     email_p->prof_info.prof_misc.chk_interval[1] = (U8*) GetString(STR_EMAIL_5_MIN_ID);
  2488.     email_p->prof_info.prof_misc.chk_interval[2] = (U8*) GetString(STR_EMAIL_30_MIN_ID);
  2489.     email_p->prof_info.prof_misc.chk_interval[3] = (U8*) GetString(STR_EMAIL_1_HOUR_ID);
  2490.     email_p->prof_info.prof_misc.chk_interval[4] = (U8*) GetString(STR_EMAIL_2_HOURS_ID);
  2491. #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */ 
  2492.     /* Profile Name caption */
  2493.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_NAME_CAP], KEY_LSK, KEY_EVENT_UP);
  2494.     SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_NAME_CAP], (U8*) GetString(STR_EMAIL_PROFILE_NAME_ID));
  2495.     /* Profile Name */
  2496.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_NAME], KEY_LSK, KEY_EVENT_UP);
  2497.     SetInlineItemFullScreenEdit(
  2498.         &wgui_inline_items[EMAIL_SETTING_NAME],
  2499.         STR_EMAIL_PROFILE_NAME_ID,
  2500.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2501.         (U8*) email_p->prof_info.editing_prof.setting_info.prof_name,
  2502.         (EMAIL_MAX_ACCT_NAME + 1),
  2503.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
  2504.     SetInlineFullScreenEditCustomFunction(&wgui_inline_items[EMAIL_SETTING_NAME], mmi_email_hilite_prof_full_edit);
  2505.     /* Data Account Caption */
  2506.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT_CAP], KEY_LSK, KEY_EVENT_UP);
  2507.     SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT_CAP], (U8*) GetString(STR_EMAIL_DATA_ACCOUNT_ID));
  2508.     /* Data Account */
  2509.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT], KEY_LSK, KEY_EVENT_UP);
  2510.     SetInlineItemImageText(
  2511.         &wgui_inline_items[EMAIL_SETTING_DATA_ACCT],
  2512.         (U8*) email_p->prof_info.prof_misc.data_acct_name,
  2513.         (PU8) NULL,
  2514.         NULL,
  2515.         NULL,
  2516.         MAX_DATA_ACCOUNT_NAME_LEN,
  2517.         0,
  2518.         0,
  2519.         INPUT_TYPE_ALPHANUMERIC_SENTENCECASE);
  2520.     SetInlineFullScreenEditCustomFunctionImageText(
  2521.         &wgui_inline_items[EMAIL_SETTING_DATA_ACCT],
  2522.         mmi_email_prof_list_data_acct);
  2523.     ShowAsControl(&wgui_inline_items[EMAIL_SETTING_DATA_ACCT]);
  2524. #if !defined(__MMI_SLIM_EMAIL_NO_IMAP4__)
  2525.     /* Protocol Caption */
  2526.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_PROTOCOL_CAP], KEY_LSK, KEY_EVENT_UP);
  2527.     SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_PROTOCOL_CAP], (U8*) GetString(STR_EMAIL_PROTOCOL_ID));
  2528.     /* Protocol */
  2529.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_PROTOCOL], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2530.     SetInlineItemSelect(
  2531.         &wgui_inline_items[EMAIL_SETTING_PROTOCOL],
  2532.         EMAIL_MAX_PROT_ITEM,
  2533.         email_p->prof_info.prof_misc.prot_list,
  2534.         &email_p->prof_info.editing_prof.setting_info.in_prot);
  2535. #endif /* !defined(__MMI_SLIM_EMAIL_NO_IMAP4__) */ 
  2536. #if !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__)
  2537.     /* Check interval caption */
  2538.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_CHK_INT_CAP], KEY_LSK, KEY_EVENT_UP);
  2539.     SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_CHK_INT_CAP], (U8*) GetString(STR_EMAIL_CHECK_INTERVAL_ID));
  2540.     /* Check interval */
  2541.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_CHK_INT], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2542.     SetInlineItemSelect(
  2543.         &wgui_inline_items[EMAIL_SETTING_CHK_INT],
  2544.         EMAIL_MAX_CHK_INTERVAL_ITEM,
  2545.         email_p->prof_info.prof_misc.chk_interval,
  2546.         &email_p->prof_info.editing_prof.setting_info.chk_interval);
  2547. #endif /* !defined(__MMI_SLIM_EMAIL_NO_AUTO_CHECK__) */ 
  2548.     /* Maximum size of download caption */
  2549.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE_CAP], KEY_LSK, KEY_EVENT_UP);
  2550.     SetInlineItemCaption(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE_CAP], (U8*) GetString(STR_EMAIL_MAX_SIZE));
  2551.     /* Max size */
  2552.     max_dwnl_len = mmi_email_util_get_num_len(MMI_EMAIL_MAX_MSG_SIZE) + 1;
  2553.     SetInlineItemActivation(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE], INLINE_ITEM_ACTIVATE_WITHOUT_KEY_EVENT, 0);
  2554.     SetInlineItemTextEdit(
  2555.         &wgui_inline_items[EMAIL_SETTING_DWNL_TYPE],
  2556.         (U8*) email_p->prof_info.editing_prof.setting_info.dwnl_size,
  2557.         max_dwnl_len,
  2558.         INPUT_TYPE_NUMERIC);
  2559.     DisableInlineItemHighlight(&wgui_inline_items[EMAIL_SETTING_DWNL_TYPE]);
  2560. }
  2561. /*****************************************************************************
  2562.  * FUNCTION
  2563.  *  mmi_email_prof_list_data_acct
  2564.  * DESCRIPTION
  2565.  *  Enter Data Account option.
  2566.  *  If GPRS is enabled, go to CSD/GPRS screen; otherwse, go to CSD account list
  2567.  * PARAMETERS
  2568.  *  void
  2569.  * RETURNS
  2570.  *  void
  2571.  *****************************************************************************/
  2572. void mmi_email_prof_list_data_acct(void)
  2573. {
  2574.     /*----------------------------------------------------------------*/
  2575.     /* Local Variables                                                */
  2576.     /*----------------------------------------------------------------*/
  2577.     /*----------------------------------------------------------------*/
  2578.     /* Code Body                                                      */
  2579.     /*----------------------------------------------------------------*/
  2580. #if 0
  2581. /* under construction !*/
  2582. #ifdef __MMI_GPRS_FEATURES__
  2583. /* under construction !*/
  2584. #else 
  2585. /* under construction !*/
  2586. #endif
  2587. #endif /* 0 */
  2588.     mmi_dtcnt_select_account(mmi_email_prof_data_acct_callback, MENU_ID_EMAIL_MAIN, DATA_ACCOUNT_BEARER_ALL);
  2589. }
  2590. /*****************************************************************************
  2591.  * FUNCTION
  2592.  *  mmi_email_prof_data_acct_callback
  2593.  * DESCRIPTION
  2594.  *  Callback function for Data Account
  2595.  * PARAMETERS
  2596.  *  index       [IN]        Index of seleted account
  2597.  * RETURNS
  2598.  *  void
  2599.  *****************************************************************************/
  2600. void mmi_email_prof_data_acct_callback(U16 index)
  2601. {
  2602.     /*----------------------------------------------------------------*/
  2603.     /* Local Variables                                                */
  2604.     /*----------------------------------------------------------------*/
  2605.     /*----------------------------------------------------------------*/
  2606.     /* Code Body                                                      */
  2607.     /*----------------------------------------------------------------*/
  2608.     email_p->prof_info.prof_misc.curr_data_acct = (S32) index;
  2609.     mmi_email_prof_save_data_acct();
  2610. }
  2611. /*****************************************************************************
  2612.  * FUNCTION
  2613.  *  mmi_email_entry_prof_csd_data_acct
  2614.  * DESCRIPTION
  2615.  *  Display CSD accont list
  2616.  * PARAMETERS
  2617.  *  void
  2618.  * RETURNS
  2619.  *  void
  2620.  *****************************************************************************/
  2621. void mmi_email_entry_prof_csd_data_acct(void)
  2622. {
  2623.     /*----------------------------------------------------------------*/
  2624.     /* Local Variables                                                */
  2625.     /*----------------------------------------------------------------*/
  2626.     /*----------------------------------------------------------------*/
  2627.     /* Code Body                                                      */
  2628.     /*----------------------------------------------------------------*/
  2629.     email_p->prof_info.prof_misc.data_acct_type = EMAIL_DATA_ACCT_GSM;
  2630. #if 0
  2631. /* under construction !*/
  2632. #endif
  2633. }
  2634. #ifdef __MMI_GPRS_FEATURES__
  2635. /*****************************************************************************
  2636.  * FUNCTION
  2637.  *  mmi_email_entry_prof_data_acct
  2638.  * DESCRIPTION
  2639.  *  Enter Profile -> Setting -> CSD/GPRS screen.
  2640.  * PARAMETERS
  2641.  *  void
  2642.  * RETURNS
  2643.  *  void
  2644.  *****************************************************************************/
  2645. void mmi_email_entry_prof_data_acct(void)
  2646. {
  2647.     /*----------------------------------------------------------------*/
  2648.     /* Local Variables                                                */
  2649.     /*----------------------------------------------------------------*/
  2650.     U16 numItems;
  2651.     U16 nStrItemList[2];    /* only CSD/GPRS */
  2652.     U8 *guiBuffer;
  2653.     /*----------------------------------------------------------------*/
  2654.     /* Code Body                                                      */
  2655.     /*----------------------------------------------------------------*/
  2656.     EntryNewScreen(SCR_ID_EMAIL_PROF_DATA_ACCT, NULL, mmi_email_entry_prof_data_acct, NULL);
  2657.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_DATA_ACCT);
  2658.     SetParentHandler(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT);
  2659.     numItems = GetNumOfChild(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT);
  2660.     GetSequenceStringIds(MENU_ID_EMAIL_PROF_DATA_ACCT_OPT, nStrItemList);
  2661.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2662.     ShowCategory52Screen(
  2663.         STR_EMAIL_DATA_ACCOUNT_ID,
  2664.         GetRootTitleIcon(MENU_ID_EMAIL_MAIN),
  2665.         STR_GLOBAL_OK,
  2666.         IMG_GLOBAL_OK,
  2667.         STR_GLOBAL_BACK,
  2668.         IMG_GLOBAL_BACK,
  2669.         numItems,
  2670.         nStrItemList,
  2671.         (U16*) gIndexIconsImageList,
  2672.         NULL,
  2673.         0,
  2674.         0,
  2675.         guiBuffer);
  2676.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2677. }
  2678. /*****************************************************************************
  2679.  * FUNCTION
  2680.  *  mmi_email_hilite_prof_csd
  2681.  * DESCRIPTION
  2682.  *  Highlight handler of Profile->Edit->Setting->Data Account-> CSD option
  2683.  * PARAMETERS
  2684.  *  void
  2685.  * RETURNS
  2686.  *  void
  2687.  *****************************************************************************/
  2688. void mmi_email_hilite_prof_csd(void)
  2689. {
  2690.     /*----------------------------------------------------------------*/
  2691.     /* Local Variables                                                */
  2692.     /*----------------------------------------------------------------*/
  2693.     /*----------------------------------------------------------------*/
  2694.     /* Code Body                                                      */
  2695.     /*----------------------------------------------------------------*/
  2696.     SetLeftSoftkeyFunction(mmi_email_entry_prof_csd_data_acct, KEY_EVENT_UP);
  2697.     SetKeyHandler(mmi_email_entry_prof_csd_data_acct, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2698. }
  2699. /*****************************************************************************
  2700.  * FUNCTION
  2701.  *  mmi_email_hilite_prof_gprs
  2702.  * DESCRIPTION
  2703.  *  Highlight handler of Profile->Edit->Setting->Data Account-> GPRS option
  2704.  * PARAMETERS
  2705.  *  void
  2706.  * RETURNS
  2707.  *  void
  2708.  *****************************************************************************/
  2709. void mmi_email_hilite_prof_gprs(void)
  2710. {
  2711.     /*----------------------------------------------------------------*/
  2712.     /* Local Variables                                                */
  2713.     /*----------------------------------------------------------------*/
  2714.     /*----------------------------------------------------------------*/
  2715.     /* Code Body                                                      */
  2716.     /*----------------------------------------------------------------*/
  2717.     SetLeftSoftkeyFunction(mmi_email_entry_prof_gprs_data_acct, KEY_EVENT_UP);
  2718.     SetKeyHandler(mmi_email_entry_prof_gprs_data_acct, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  2719. }
  2720. /*****************************************************************************
  2721.  * FUNCTION
  2722.  *  mmi_email_entry_prof_gprs_data_acct
  2723.  * DESCRIPTION
  2724.  *  Display GPRS accont list
  2725.  * PARAMETERS
  2726.  *  void
  2727.  * RETURNS
  2728.  *  void
  2729.  *****************************************************************************/
  2730. void mmi_email_entry_prof_gprs_data_acct(void)
  2731. {
  2732.     /*----------------------------------------------------------------*/
  2733.     /* Local Variables                                                */
  2734.     /*----------------------------------------------------------------*/
  2735.     /*----------------------------------------------------------------*/
  2736.     /* Code Body                                                      */
  2737.     /*----------------------------------------------------------------*/
  2738.     email_p->prof_info.prof_misc.data_acct_type = EMAIL_DATA_ACCT_GPRS;
  2739. #if 0
  2740. /* under construction !*/
  2741. #endif
  2742. }
  2743. #endif /* __MMI_GPRS_FEATURES__ */ 
  2744. /*****************************************************************************
  2745.  * FUNCTION
  2746.  *  mmi_email_hilite_prof_data_acct
  2747.  * DESCRIPTION
  2748.  *  Highlight handler of data account list
  2749.  * PARAMETERS
  2750.  *  index       [IN]        
  2751.  * RETURNS
  2752.  *  void
  2753.  *****************************************************************************/
  2754. void mmi_email_hilite_prof_data_acct(S32 index)
  2755. {
  2756.     /*----------------------------------------------------------------*/
  2757.     /* Local Variables                                                */
  2758.     /*----------------------------------------------------------------*/
  2759.     /*----------------------------------------------------------------*/
  2760.     /* Code Body                                                      */
  2761.     /*----------------------------------------------------------------*/
  2762.     email_p->prof_info.prof_misc.curr_data_acct = index;
  2763. }
  2764. /*****************************************************************************
  2765.  * FUNCTION
  2766.  *  mmi_email_prof_save_data_acct
  2767.  * DESCRIPTION
  2768.  *  Save setting of data account and update the account name of buffer in inline editor
  2769.  * PARAMETERS
  2770.  *  void
  2771.  * RETURNS
  2772.  *  void
  2773.  *****************************************************************************/
  2774. void mmi_email_prof_save_data_acct(void)
  2775. {
  2776.     /*----------------------------------------------------------------*/
  2777.     /* Local Variables                                                */
  2778.     /*----------------------------------------------------------------*/
  2779.     /*----------------------------------------------------------------*/
  2780.     /* Code Body                                                      */
  2781.     /*----------------------------------------------------------------*/
  2782. #if 0
  2783. /* under construction !*/
  2784. /* under construction !*/
  2785. /* under construction !*/
  2786. /* under construction !*/
  2787. /* under construction !*/
  2788. /* under construction !*/
  2789. /* under construction !*/
  2790. /* under construction !*/
  2791. #ifdef __MMI_GPRS_FEATURES__
  2792. /* under construction !*/
  2793. /* under construction !*/
  2794. /* under construction !*/
  2795. /* under construction !*/
  2796. /* under construction !*/
  2797. /* under construction !*/
  2798. /* under construction !*/
  2799. /* under construction !*/
  2800. /* under construction !*/
  2801. #endif /* __MMI_GPRS_FEATURES__ */
  2802. #endif /* 0 */
  2803.     mmi_dtcnt_get_account_name(
  2804.         email_p->prof_info.prof_misc.curr_data_acct,
  2805.         (S8*) email_p->prof_info.prof_misc.data_acct_name,
  2806.         MAX_DATA_ACCOUNT_NAME_LEN);
  2807.     email_p->prof_info.editing_prof.setting_info.data_acct = email_p->prof_info.prof_misc.curr_data_acct;
  2808.     DeleteUptoScrID(SCR_ID_EMAIL_PROF_SETTING);
  2809.     GoBackHistory();
  2810.     SetInlineListMenuChanged();
  2811. }
  2812. /*****************************************************************************
  2813.  * FUNCTION
  2814.  *  mmi_email_entry_prof_smtp
  2815.  * DESCRIPTION
  2816.  *  Entry SMTP setting screen
  2817.  * PARAMETERS
  2818.  *  void
  2819.  * RETURNS
  2820.  *  void
  2821.  *****************************************************************************/
  2822. void mmi_email_entry_prof_smtp(void)
  2823. {
  2824.     /*----------------------------------------------------------------*/
  2825.     /* Local Variables                                                */
  2826.     /*----------------------------------------------------------------*/
  2827.     U16 smtp_icons[EMAIL_SMTP_TOTAL_ITEM] = 
  2828.     {
  2829.         IMG_EMAIL_OUTGOING_SERVER_ID, 0,
  2830.         IMG_EMAIL_OUTGOING_PORT_ID, 0,
  2831.         IMG_EMAIL_DISPLAY_NAME_ID, 0,
  2832.         IMG_EMAIL_EMAIL_ADDRESS_ID, 0,
  2833.         IMG_EMAIL_USER_NAME_ID, 0,
  2834.         IMG_EMAIL_PASSWORD_ID, 0,
  2835.     };
  2836.     U8 *guiBuffer;
  2837.     U8 *inputBuffer;
  2838.     U16 inputBufferSize;
  2839.     /*----------------------------------------------------------------*/
  2840.     /* Code Body                                                      */
  2841.     /*----------------------------------------------------------------*/
  2842.     EntryNewScreen(SCR_ID_EMAIL_PROF_SMTP, mmi_email_exit_prof_smtp, NULL, NULL);
  2843.     InitializeCategory57Screen();
  2844.     guiBuffer = GetCurrGuiBuffer(SCR_ID_EMAIL_PROF_SMTP);
  2845.     inputBuffer = GetCurrNInputBuffer(SCR_ID_EMAIL_PROF_SMTP, &inputBufferSize);
  2846.     mmi_email_prof_fill_smtp_inline_struct();
  2847.     if (inputBuffer != NULL)
  2848.     {
  2849.         SetCategory57Data(wgui_inline_items, EMAIL_SMTP_TOTAL_ITEM, inputBuffer);
  2850.     }