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

MTK

开发平台:

C/C++

  1.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_NORWEGIAN_STRING_ID);
  2.             break;
  3.         case INPUT_MODE_SMART_LOWERCASE_NORWEGIAN:
  4.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_norwegian_STRING_ID);
  5.             break;
  6.     #endif /* defined(__MMI_T9_NORWEGIAN__) || defined(__MMI_ZI_NORWEGIAN__) */ 
  7.             //Norwegian end
  8.             //PMT NO_AR_SL_DU END 20050909
  9.             //PMT START SWEDISH 20050916
  10.     #if defined(__MMI_T9_SWEDISH__) || defined(__MMI_ZI_SWEDISH__) || defined(__MMI_CSTAR_SWEDISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  11.         case INPUT_MODE_SMART_UPPERCASE_SWEDISH:
  12.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_SWEDISH_STRING_ID);
  13.             break;
  14.         case INPUT_MODE_SMART_LOWERCASE_SWEDISH:
  15.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_swedish_STRING_ID);
  16.             break;
  17.     #endif /* defined(__MMI_T9_SWEDISH__) || defined(__MMI_ZI_SWEDISH__) */ 
  18.             /* PMT END SWEDISH 20050916 */
  19.             /* PMT START CR_ROM_SLO 20050923 */
  20.     #if defined(__MMI_T9_CROATIAN__) || defined(__MMI_ZI_CROATIAN__) || defined(__MMI_CSTAR_CROATIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  21.         case INPUT_MODE_SMART_UPPERCASE_CROATIAN:
  22.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_CROATIAN_STRING_ID);
  23.             break;
  24.         case INPUT_MODE_SMART_LOWERCASE_CROATIAN:
  25.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_croatian_STRING_ID);
  26.             break;
  27.     #endif /* defined(__MMI_T9_CROATIAN__) || defined(__MMI_ZI_CROATIAN__) */ 
  28.             /* PMT START LANGUAGE 20060104 */
  29.     #if defined(__MMI_ZI_ROMANIAN__) || defined(__MMI_T9_ROMANIAN__) || defined(__MMI_CSTAR_ROMANIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  30.             /* PMT END LANGUAGE 20060104 */
  31.         case INPUT_MODE_SMART_UPPERCASE_ROMANIAN:
  32.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_ROMANIAN_STRING_ID);
  33.             break;
  34.         case INPUT_MODE_SMART_LOWERCASE_ROMANIAN:
  35.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_romanian_STRING_ID);
  36.             break;
  37.     #endif /* defined(__MMI_ZI_ROMANIAN__) || defined(__MMI_T9_ROMANIAN__) */ 
  38.     #if defined(__MMI_T9_SLOVENIAN__) || defined(__MMI_ZI_SLOVENIAN__) || defined(__MMI_CSTAR_SLOVENIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  39.         case INPUT_MODE_SMART_UPPERCASE_SLOVENIAN:
  40.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_SLOVENIAN_STRING_ID);
  41.             break;
  42.         case INPUT_MODE_SMART_LOWERCASE_SLOVENIAN:
  43.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_slovenian_STRING_ID);
  44.             break;
  45.     #endif /* defined(__MMI_T9_SLOVENIAN__) || defined(__MMI_ZI_SLOVENIAN__) */ 
  46.             /* PMT END CR_ROM_SLO 20050923 */
  47.             /* PMT START GR_HE_CZ_FI_DA_HU 20051007 */
  48.     #if defined(__MMI_T9_GREEK__) || defined(__MMI_ZI_GREEK__) || defined(__MMI_CSTAR_GREEK__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  49.         case INPUT_MODE_SMART_UPPERCASE_GREEK:
  50.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_GREEK_STRING_ID);
  51.             break;
  52.         case INPUT_MODE_SMART_LOWERCASE_GREEK:
  53.             inputmode_string = (UI_string_type) get_string(WGUI_CATEGORY_greek_STRING_ID);
  54.             break;
  55.     #endif /* defined(__MMI_T9_GREEK__) || defined(__MMI_ZI_GREEK__) */ 
  56.             //PMT END GR_HE_CZ_FI_DA_HU 20051007
  57.             //MTK end
  58.     }
  59.     gui_set_font(f);
  60.     gui_set_text_color(c);
  61.     gui_reset_text_clip();
  62.     x = 1;
  63. #if defined(__MMI_T9__) || defined(__MMI_ITAP__) || defined(__MMI_KA__)|| defined(__MMI_CSTAR__)     //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
  64.     if (wgui_EMS_inputbox_information_icon == NULL)
  65.     {
  66.         /* MTK Elvis for R2L characters */
  67.         if (!r2lMMIFlag)
  68.         {
  69.             x = 2;
  70.         }
  71.         else
  72.         {
  73.             x = UI_device_width - 2;
  74.         }
  75.         /* MTK end */
  76.     }
  77.     else
  78.     {
  79.         /* MTK Elvis for R2L characters */
  80.         gui_measure_image(wgui_EMS_inputbox_information_icon, &width, &height);
  81.         if (!r2lMMIFlag)
  82.         {
  83.         #if !defined(__MMI_TOUCH_SCREEN__)
  84.             gui_show_transparent_image(
  85.                 x,
  86.                 wgui_EMS_inputbox_information_bar_y + 1,
  87.                 wgui_EMS_inputbox_information_icon,
  88.                 0);
  89.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  90.             gui_show_transparent_image(
  91.                 x,
  92.                 wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  93.                 wgui_EMS_inputbox_information_icon,
  94.                 0);
  95.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  96.             x = width + 2;
  97.         }
  98.         else
  99.         {
  100.         #if !defined(__MMI_TOUCH_SCREEN__)
  101.             gui_show_transparent_image(
  102.                 UI_device_width - 1 - width,
  103.                 wgui_EMS_inputbox_information_bar_y + 1,
  104.                 wgui_EMS_inputbox_information_icon,
  105.                 0);
  106.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  107.             gui_show_transparent_image(
  108.                 UI_device_width - 1 - width,
  109.                 wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  110.                 wgui_EMS_inputbox_information_icon,
  111.                 0);
  112.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  113.             x = UI_device_width - 2 - width;
  114.         }
  115.         /* MTK end */
  116.     }
  117. #elif defined(__MMI_ZI__)
  118.     if (wgui_EMS_inputbox_information_icon == NULL)
  119.     {
  120.         /* MTK Elvis for R2L characters */
  121.         if (!r2lMMIFlag)
  122.         {
  123.             x = 2;
  124.         }
  125.         else
  126.         {
  127.             x = UI_device_width - 2;
  128.         }
  129.         /* MTK end */
  130.     }
  131.     else
  132.     {
  133.         /* MTK Elvis for R2L characters */
  134.         gui_measure_image(get_image(WGUI_INPUT_INFORMATION_ICON1), &width, &height);
  135.         if (!r2lMMIFlag)
  136.         {
  137.         #if !defined(__MMI_TOUCH_SCREEN__)
  138.             gui_show_transparent_image(
  139.                 x,
  140.                 wgui_EMS_inputbox_information_bar_y + 1,
  141.                 get_image(WGUI_INPUT_INFORMATION_ICON1),
  142.                 0);
  143.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  144.             gui_show_transparent_image(
  145.                 x,
  146.                 wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  147.                 get_image(WGUI_INPUT_INFORMATION_ICON1),
  148.                 0);
  149.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  150.             x = width + 2;
  151.         }
  152.         else
  153.         {
  154.         #if !defined(__MMI_TOUCH_SCREEN__)
  155.             gui_show_transparent_image(
  156.                 UI_device_width - 1 - width,
  157.                 wgui_EMS_inputbox_information_bar_y + 1,
  158.                 get_image(WGUI_INPUT_INFORMATION_ICON1),
  159.                 0);
  160.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  161.             gui_show_transparent_image(
  162.                 UI_device_width - 1 - width,
  163.                 wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  164.                 get_image(WGUI_INPUT_INFORMATION_ICON1),
  165.                 0);
  166.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  167.             x = UI_device_width - 2 - width;
  168.         }
  169.         /* MTK end */
  170.     }
  171. #else 
  172.     if (wgui_EMS_inputbox_information_icon == NULL)
  173.     {
  174.         /* MTK Elvis for R2L characters */
  175.         if (!r2lMMIFlag)
  176.         {
  177.             x = 2;
  178.         }
  179.         else
  180.         {
  181.             x = UI_device_width - 2;
  182.         }
  183.         /* MTK end */
  184.     }
  185.     else
  186.     {
  187.         /* MTK Elvis for R2L characters */
  188.         gui_measure_image(wgui_EMS_inputbox_information_icon, &width, &height);
  189.         if (!r2lMMIFlag)
  190.         {
  191.         #if !defined(__MMI_TOUCH_SCREEN__)
  192.             gui_show_transparent_image(
  193.                 x,
  194.                 wgui_EMS_inputbox_information_bar_y + 1,
  195.                 wgui_EMS_inputbox_information_icon,
  196.                 0);
  197.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  198.             gui_show_transparent_image(
  199.                 x,
  200.                 wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  201.                 wgui_EMS_inputbox_information_icon,
  202.                 0);
  203.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  204.             x = width + 2;
  205.         }
  206.         else
  207.         {
  208.         #if !defined(__MMI_TOUCH_SCREEN__)
  209.             gui_show_transparent_image(
  210.                 UI_device_width - 1 - width,
  211.                 wgui_EMS_inputbox_information_bar_y + 1,
  212.                 wgui_EMS_inputbox_information_icon,
  213.                 0);
  214.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  215.             gui_show_transparent_image(
  216.                 UI_device_width - 1 - width,
  217.                 wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  218.                 wgui_EMS_inputbox_information_icon,
  219.                 0);
  220.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  221.             x = UI_device_width - 2 - width;
  222.         }
  223.         /* MTK end */
  224.     }
  225. #endif 
  226. #if defined(__MMI_TOUCH_SCREEN__)
  227.     /*  3 is from display icon shift position by adjusting x value
  228.      *  4 is draw rectangle width in touch screen case
  229.      *  
  230.      */
  231.     wgui_information_bar_input_mode_display_width = width + 7;
  232.     wgui_information_bar_input_mode_display_height = height;
  233.     gui_measure_string(inputmode_string, &width, &height);
  234.     #ifdef __MMI_T9__
  235.     /*  T9 chinese input mode uses icon instead of inputmode_string and
  236.      *  no need to adjust x value ,so previous +7 ,now -7
  237.      */
  238.     if(width == 0) 
  239.     {
  240.         wgui_information_bar_input_mode_display_width -= 7;
  241.     }
  242.     #endif
  243.     rect_height = gui_get_character_height();
  244. //KP Jerry add for avoid rect_height over the infomation_bar_height on 2007-4-16 start
  245.     if(rect_height > wgui_inputbox_information_bar_height - 2) 
  246.     {
  247.         rect_height = wgui_inputbox_information_bar_height - 2;
  248.     }
  249. //KP Jerry add for avoid rect_height over the infomation_bar_height on 2007-4-16 end
  250.     wgui_information_bar_input_mode_display_width += width;
  251.     if(rect_height > wgui_information_bar_input_mode_display_height)
  252.     {
  253.         wgui_information_bar_input_mode_display_height = rect_height;
  254.     }
  255. #endif /* defined(__MMI_TOUCH_SCREEN__) */ 
  256.     switch (MMI_current_input_mode)
  257.     {
  258.         case INPUT_MODE_MULTITAP_UPPERCASE_ABC:
  259.         case INPUT_MODE_MULTITAP_LOWERCASE_ABC:
  260.             /* PMT dara added for Multitap thai */
  261.     #if defined(__MMI_MULTITAP_THAI__)
  262.         case INPUT_MODE_MULTITAP_THAI:
  263.     #endif 
  264.             /* MTk Terry for Spanish French German Italian Russian Turkish Portuguese Indonesian Malay Vietnamese */
  265.     #if defined(__MMI_MULTITAP_SPANISH__)
  266.         case INPUT_MODE_MULTITAP_UPPERCASE_SPANISH:
  267.         case INPUT_MODE_MULTITAP_LOWERCASE_SPANISH:
  268.     #endif /* defined(__MMI_MULTITAP_SPANISH__) */ 
  269.             /* PMT VIKASG START 20050729 */
  270.     #if defined(__MMI_MULTITAP_DANISH__)
  271.         case INPUT_MODE_MULTITAP_UPPERCASE_DANISH:
  272.         case INPUT_MODE_MULTITAP_LOWERCASE_DANISH:
  273.     #endif /* defined(__MMI_MULTITAP_DANISH__) */ 
  274.             //PMT VIKASG END 20050729
  275.             //PMT CZ_PO_TU START 20050812
  276.     #if defined(__MMI_MULTITAP_POLISH__)    /* Polish-Vikas */
  277.         case INPUT_MODE_MULTITAP_UPPERCASE_POLISH:
  278.         case INPUT_MODE_MULTITAP_LOWERCASE_POLISH:
  279.     #endif /* defined(__MMI_MULTITAP_POLISH__) */ 
  280.             /* PMT CZ_PO_TU END 20050812 */
  281.     #if defined(__MMI_MULTITAP_FRENCH__)
  282.         case INPUT_MODE_MULTITAP_UPPERCASE_FRENCH:
  283.         case INPUT_MODE_MULTITAP_LOWERCASE_FRENCH:
  284.     #endif /* defined(__MMI_MULTITAP_FRENCH__) */ 
  285.     #if defined(__MMI_MULTITAP_GERMAN__)
  286.         case INPUT_MODE_MULTITAP_UPPERCASE_GERMAN:
  287.         case INPUT_MODE_MULTITAP_LOWERCASE_GERMAN:
  288.     #endif /* defined(__MMI_MULTITAP_GERMAN__) */ 
  289.     #if defined(__MMI_MULTITAP_ITALIAN__)
  290.         case INPUT_MODE_MULTITAP_UPPERCASE_ITALIAN:
  291.         case INPUT_MODE_MULTITAP_LOWERCASE_ITALIAN:
  292.     #endif /* defined(__MMI_MULTITAP_ITALIAN__) */ 
  293.     #if defined(__MMI_MULTITAP_RUSSIAN__)
  294.         case INPUT_MODE_MULTITAP_UPPERCASE_RUSSIAN:
  295.         case INPUT_MODE_MULTITAP_LOWERCASE_RUSSIAN:
  296.     #endif /* defined(__MMI_MULTITAP_RUSSIAN__) */ 
  297.             /* PMT BULGARIAN START 20051201 */
  298.     #if defined(__MMI_MULTITAP_BULGARIAN__)
  299.         case INPUT_MODE_MULTITAP_UPPERCASE_BULGARIAN:
  300.         case INPUT_MODE_MULTITAP_LOWERCASE_BULGARIAN:
  301.     #endif /* defined(__MMI_MULTITAP_BULGARIAN__) */ 
  302.             /* PMT BULGARIAN END 20051201 */
  303.     #if defined(__MMI_MULTITAP_TURKISH__)
  304.         case INPUT_MODE_MULTITAP_UPPERCASE_TURKISH:
  305.         case INPUT_MODE_MULTITAP_LOWERCASE_TURKISH:
  306.     #endif /* defined(__MMI_MULTITAP_TURKISH__) */ 
  307.     #if defined(__MMI_MULTITAP_PORTUGUESE__)
  308.         case INPUT_MODE_MULTITAP_UPPERCASE_PORTUGUESE:
  309.         case INPUT_MODE_MULTITAP_LOWERCASE_PORTUGUESE:
  310.     #endif /* defined(__MMI_MULTITAP_PORTUGUESE__) */ 
  311.     #if defined(__MMI_MULTITAP_HINDI__)
  312.         case INPUT_MODE_MULTITAP_HINDI:
  313.     #endif 
  314.             /* PMT RAKESH START 20061006 */
  315.     #if defined(__MMI_MULTITAP_MARATHI__)
  316.         case INPUT_MODE_MULTITAP_MARATHI:
  317.     #endif 
  318.             /* PMT RAKESH END 20061006 */
  319.     #if defined(__MMI_MULTITAP_INDONESIAN__)
  320.         case INPUT_MODE_MULTITAP_UPPERCASE_INDONESIAN:
  321.         case INPUT_MODE_MULTITAP_LOWERCASE_INDONESIAN:
  322.     #endif /* defined(__MMI_MULTITAP_INDONESIAN__) */ 
  323.             /* PMT CZ_PO_TU START 20050812 */
  324.     #if defined(__MMI_MULTITAP_CZECH__)
  325.         case INPUT_MODE_MULTITAP_UPPERCASE_CZECH:
  326.         case INPUT_MODE_MULTITAP_LOWERCASE_CZECH:
  327.     #endif /* defined(__MMI_MULTITAP_CZECH__) */ 
  328.             /* PMT CZ_PO_TU END 20050812 */
  329.     #if defined(__MMI_MULTITAP_MALAY__)
  330.         case INPUT_MODE_MULTITAP_UPPERCASE_MALAY:
  331.         case INPUT_MODE_MULTITAP_LOWERCASE_MALAY:
  332.     #endif /* defined(__MMI_MULTITAP_MALAY__) */ 
  333.     #if defined(__MMI_MULTITAP_VIETNAMESE__)
  334.         case INPUT_MODE_MULTITAP_UPPERCASE_VIETNAMESE:
  335.         case INPUT_MODE_MULTITAP_LOWERCASE_VIETNAMESE:
  336.     #endif /* defined(__MMI_MULTITAP_VIETNAMESE__) */ 
  337.             /* PMT START HU_FI 20050825 */
  338.     #if defined(__MMI_MULTITAP_FINNISH__)
  339.         case INPUT_MODE_MULTITAP_UPPERCASE_FINNISH:
  340.         case INPUT_MODE_MULTITAP_LOWERCASE_FINNISH:
  341.     #endif /* defined(__MMI_MULTITAP_FINNISH__) */ 
  342.     #if defined(__MMI_MULTITAP_HUNGARIAN__)
  343.         case INPUT_MODE_MULTITAP_UPPERCASE_HUNGARIAN:
  344.         case INPUT_MODE_MULTITAP_LOWERCASE_HUNGARIAN:
  345.     #endif /* defined(__MMI_MULTITAP_HUNGARIAN__) */ 
  346.             //PMT END HU_FI 20050825
  347.             //MTK end
  348.             /* PMT START GR_HE_CZ_FI_DA_HU 20051007 */
  349.     #if defined(__MMI_MULTITAP_HEBREW__)
  350.         case INPUT_MODE_MULTITAP_HEBREW:
  351.     #endif 
  352.             //PMT END GR_HE_CZ_FI_DA_HU 20051007
  353.             //PMT NO_AR_SL_DU START 20050909
  354.     #if defined(__MMI_MULTITAP_SLOVAK__)
  355.         case INPUT_MODE_MULTITAP_UPPERCASE_SLOVAK:
  356.         case INPUT_MODE_MULTITAP_LOWERCASE_SLOVAK:
  357.     #endif /* defined(__MMI_MULTITAP_SLOVAK__) */ 
  358.     #if defined(__MMI_MULTITAP_DUTCH__)
  359.         case INPUT_MODE_MULTITAP_UPPERCASE_DUTCH:
  360.         case INPUT_MODE_MULTITAP_LOWERCASE_DUTCH:
  361.     #endif /* defined(__MMI_MULTITAP_DUTCH__) */ 
  362.             //MTK end
  363.             //Norwegian start
  364.     #if defined(__MMI_MULTITAP_NORWEGIAN__)
  365.         case INPUT_MODE_MULTITAP_UPPERCASE_NORWEGIAN:
  366.         case INPUT_MODE_MULTITAP_LOWERCASE_NORWEGIAN:
  367.     #endif /* defined(__MMI_MULTITAP_NORWEGIAN__) */ 
  368.             /* Norwegian end */
  369.     #if defined(__MMI_MULTITAP_ARABIC__)
  370.         case INPUT_MODE_MULTITAP_ARABIC:
  371.     #endif 
  372.             /* PMT START PERSIAN */
  373.     #if defined(__MMI_MULTITAP_PERSIAN__)
  374.         case INPUT_MODE_MULTITAP_PERSIAN:
  375.     #endif 
  376.             //PMT END PERSIAN
  377.             //PMT NO_AR_SL_DU END 20050909
  378.             //PMT START SWEDISH 20050916
  379.     #if defined(__MMI_MULTITAP_SWEDISH__)
  380.         case INPUT_MODE_MULTITAP_UPPERCASE_SWEDISH:
  381.         case INPUT_MODE_MULTITAP_LOWERCASE_SWEDISH:
  382.     #endif /* defined(__MMI_MULTITAP_SWEDISH__) */ 
  383.             //PMT END SWEDISH 20050916
  384.             //PMT START CR_ROM_SLO 20050923
  385.     #if defined(__MMI_MULTITAP_CROATIAN__)
  386.         case INPUT_MODE_MULTITAP_UPPERCASE_CROATIAN:
  387.         case INPUT_MODE_MULTITAP_LOWERCASE_CROATIAN:
  388.     #endif /* defined(__MMI_MULTITAP_CROATIAN__) */ 
  389.     #if defined(__MMI_MULTITAP_ROMANIAN__)
  390.         case INPUT_MODE_MULTITAP_UPPERCASE_ROMANIAN:
  391.         case INPUT_MODE_MULTITAP_LOWERCASE_ROMANIAN:
  392.     #endif /* defined(__MMI_MULTITAP_ROMANIAN__) */ 
  393.     #if defined(__MMI_MULTITAP_SLOVENIAN__)
  394.         case INPUT_MODE_MULTITAP_UPPERCASE_SLOVENIAN:
  395.         case INPUT_MODE_MULTITAP_LOWERCASE_SLOVENIAN:
  396.     #endif /* defined(__MMI_MULTITAP_SLOVENIAN__) */ 
  397.             //PMT END CR_ROM_SLO 20050923
  398.             //PMT START GR_HE_CZ_FI_DA_HU 20051007
  399.     #if defined(__MMI_MULTITAP_GREEK__)
  400.         case INPUT_MODE_MULTITAP_UPPERCASE_GREEK:
  401.         case INPUT_MODE_MULTITAP_LOWERCASE_GREEK:
  402.     #endif /* defined(__MMI_MULTITAP_GREEK__) */ 
  403.             /* PMT END GR_HE_CZ_FI_DA_HU 20051007 */
  404.         case INPUT_MODE_123:
  405.             /* START PMT VIJAY 20050725     ......removed additional 3 pixels for hindi string */
  406.             if (MMI_current_input_mode == INPUT_MODE_MULTITAP_HINDI)
  407.             {
  408.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y);
  409.             }
  410.             /* PMT RAKESH START 20061006 */
  411.             else if (MMI_current_input_mode == INPUT_MODE_MULTITAP_MARATHI)
  412.             {
  413.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y + 1);
  414.             }
  415.             /* PMT RAKESH END 20061006 */
  416.             else
  417.         #if !defined(__MMI_TOUCH_SCREEN__)
  418.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y + 3);
  419.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  420.             {
  421.                 gui_draw_filled_area(
  422.                     wgui_EMS_inputbox_information_bar_x + x + 2,
  423.                     wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - rect_height) / 2 - 1,
  424.                     wgui_EMS_inputbox_information_bar_x + x + 4 + width,
  425.                     wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height + rect_height) / 2,
  426.                     &information_bar_BG_filler);
  427.                 gui_move_text_cursor(
  428.                     wgui_EMS_inputbox_information_bar_x + x + 3,
  429.                     wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2);
  430.             }
  431.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  432.             /* END VIJAY PMT 20050725 */
  433.             gui_print_text(inputmode_string);
  434.             break;
  435.         #if defined (__MMI_T9__) || defined(__MMI_ITAP__) || defined(__MMI_KA__)|| defined(__MMI_CSTAR__)     //KP Jerry add "__MMI_CSTAR__" on 2007-3-8
  436.         case INPUT_MODE_SMART_UPPERCASE_ABC:
  437.         case INPUT_MODE_SMART_LOWERCASE_ABC:
  438.             /* MTK Terry for Spanish French German Italian */
  439.         #if defined(__MMI_T9_SPANISH__) || defined(__MMI_CSTAR_SPANISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  440.         case INPUT_MODE_SMART_UPPERCASE_SPANISH:
  441.         case INPUT_MODE_SMART_LOWERCASE_SPANISH:
  442.         #endif /* defined(__MMI_T9_SPANISH__) */ 
  443.             /* PMT VIKASG START 20050729 */
  444.         #if defined(__MMI_T9_DANISH__) || defined(__MMI_CSTAR_DANISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  445.         case INPUT_MODE_SMART_UPPERCASE_DANISH:
  446.         case INPUT_MODE_SMART_LOWERCASE_DANISH:
  447.         #endif /* defined(__MMI_T9_DANISH__) */ 
  448.             //PMT VIKASG END 20050729
  449.             //PMT CZ_PO_TU START 20050812
  450.         #if defined(__MMI_T9_POLISH__) || defined(__MMI_CSTAR_POLISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  451.         case INPUT_MODE_SMART_UPPERCASE_POLISH:
  452.         case INPUT_MODE_SMART_LOWERCASE_POLISH:
  453.         #endif /* defined(__MMI_T9_POLISH__) */ 
  454.             /* PMT CZ_PO_TU END 20050812 */
  455.         #if defined(__MMI_T9_FRENCH__) || defined(__MMI_CSTAR_FRENCH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  456.         case INPUT_MODE_SMART_UPPERCASE_FRENCH:
  457.         case INPUT_MODE_SMART_LOWERCASE_FRENCH:
  458.         #endif /* defined(__MMI_T9_FRENCH__) */ 
  459.         #if defined(__MMI_T9_GERMAN__) || defined(__MMI_CSTAR_GERMAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  460.         case INPUT_MODE_SMART_UPPERCASE_GERMAN:
  461.         case INPUT_MODE_SMART_LOWERCASE_GERMAN:
  462.         #endif /* defined(__MMI_T9_GERMAN__) */ 
  463.         #if defined(__MMI_T9_ITALIAN__) || defined(__MMI_CSTAR_ITALIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  464.         case INPUT_MODE_SMART_UPPERCASE_ITALIAN:
  465.         case INPUT_MODE_SMART_LOWERCASE_ITALIAN:
  466.         #endif /* defined(__MMI_T9_ITALIAN__) */ 
  467.             /* PMT BHASKAR START 20052907 */
  468.         #if defined(__MMI_T9_VIETNAMESE__) || defined(__MMI_CSTAR_VIETNAMESE__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  469.         case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
  470.         case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
  471.         #endif /* defined(__MMI_T9_VIETNAMESE__) */ 
  472.             // PMT BHASKAR END 20052907
  473.             //PMT CZ_PO_TU START 20050812
  474.         #if defined(__MMI_T9_TURKISH__) || defined(__MMI_CSTAR_TURKISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  475.         case INPUT_MODE_SMART_UPPERCASE_TURKISH:
  476.         case INPUT_MODE_SMART_LOWERCASE_TURKISH:
  477.         #endif /* defined(__MMI_T9_TURKISH__) */ 
  478.             //PMT CZ_PO_TU END 20050812
  479.             //PMT Gurdev Start 20050729
  480.         #if defined(__MMI_T9_INDONESIAN__) || defined(__MMI_CSTAR_INDONESIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  481.         case INPUT_MODE_SMART_UPPERCASE_INDONESIAN:
  482.         case INPUT_MODE_SMART_LOWERCASE_INDONESIAN:
  483.         #endif /* defined(__MMI_T9_INDONESIAN__) */ 
  484.             //PMT Gurdev End 20050729
  485.             //PMT CZ_PO_TU START 20050812
  486.         #if defined(__MMI_T9_CZECH__) || defined(__MMI_CSTAR_CZECH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  487.         case INPUT_MODE_SMART_UPPERCASE_CZECH:
  488.         case INPUT_MODE_SMART_LOWERCASE_CZECH:
  489.         #endif /* defined(__MMI_T9_CZECH__) */ 
  490.             //PMT CZ_PO_TU END 20050812
  491.             //MTK end
  492.             //PMT dara added for T9 thai 
  493.         #if defined(__MMI_T9_THAI__) || defined(__MMI_CSTAR_THAI__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  494.         case INPUT_MODE_SMART_THAI:
  495.         #endif 
  496.             //PMT End
  497.             //START PMT VANDANA 20051506
  498.         #if defined(__MMI_T9_RUSSIAN__) || defined(__MMI_CSTAR_RUSSIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  499.         case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
  500.         case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
  501.         #endif /* defined(__MMI_T9_RUSSIAN__) */ 
  502.             /* END PMT */
  503.             /* PMT BULGARIAN START 20051201 */
  504.         #if defined(__MMI_T9_BULGARIAN__) || defined(__MMI_CSTAR_BULGARIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  505.         case INPUT_MODE_SMART_UPPERCASE_BULGARIAN:
  506.         case INPUT_MODE_SMART_LOWERCASE_BULGARIAN:
  507.         #endif /* defined(__MMI_T9_BULGARIAN__) */ 
  508.             //PMT BULGARIAN END 20051201
  509.             //PMT SHARIQ START 20050729
  510.         #if defined(__MMI_T9_PORTUGUESE__) || defined(__MMI_CSTAR_PORTUGUESE__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  511.         case INPUT_MODE_SMART_UPPERCASE_PORTUGUESE:
  512.         case INPUT_MODE_SMART_LOWERCASE_PORTUGUESE:
  513.         #endif /* defined(__MMI_T9_PORTUGUESE__) */ 
  514.             //PMT SHARIQ END 20050729
  515.             //PMT START HU_FI 20050825
  516.         #if defined(__MMI_T9_FINNISH__) || defined(__MMI_CSTAR_FINNISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  517.         case INPUT_MODE_SMART_UPPERCASE_FINNISH:
  518.         case INPUT_MODE_SMART_LOWERCASE_FINNISH:
  519.         #endif /* defined(__MMI_T9_FINNISH__) */ 
  520.         #if defined(__MMI_T9_HUNGARIAN__) || defined(__MMI_CSTAR_HUNGARIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  521.         case INPUT_MODE_SMART_UPPERCASE_HUNGARIAN:
  522.         case INPUT_MODE_SMART_LOWERCASE_HUNGARIAN:
  523.         #endif /* defined(__MMI_T9_HUNGARIAN__) */ 
  524.             /* PMT END HU_FI 20050825 */
  525.             /* PMT NO_AR_SL_DU START 20050909 */
  526.         #if defined(__MMI_T9_ARABIC__) || defined(__MMI_CSTAR_ARABIC__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  527.         case INPUT_MODE_SMART_ARABIC:
  528.         #endif 
  529.             /* PMT VIKAS GUPTA START 20051129 */
  530.         #if defined(__MMI_T9_HINDI__) || defined(__MMI_CSTAR_HINDI__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  531.         case INPUT_MODE_SMART_HINDI:
  532.         #endif 
  533.             //PMT VIKAS GUPTA END 20051129
  534.             //Norwegian start
  535.         #if defined(__MMI_T9_NORWEGIAN__) || defined(__MMI_CSTAR_NORWEGIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  536.         case INPUT_MODE_SMART_UPPERCASE_NORWEGIAN:
  537.         case INPUT_MODE_SMART_LOWERCASE_NORWEGIAN:
  538.         #endif /* defined(__MMI_T9_NORWEGIAN__) */ 
  539.             //Norwegian end
  540.             //START DUTCH_T9 20051021
  541.         #if defined(__MMI_T9_DUTCH__) || defined(__MMI_CSTAR_DUTCH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  542.         case INPUT_MODE_SMART_UPPERCASE_DUTCH:
  543.         case INPUT_MODE_SMART_LOWERCASE_DUTCH:
  544.         #endif /* defined(__MMI_T9_DUTCH__) */ 
  545.             //END DUTCH_T9 20051021
  546.             //PMT LANGUAGE START 20051221
  547.         #if defined(__MMI_T9_SLOVENIAN__) || defined(__MMI_CSTAR_SLOVENIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  548.         case INPUT_MODE_SMART_UPPERCASE_SLOVENIAN:
  549.         case INPUT_MODE_SMART_LOWERCASE_SLOVENIAN:
  550.         #endif /* defined(__MMI_T9_SLOVENIAN__) */ 
  551.         #if defined(__MMI_T9_SWEDISH__) || defined(__MMI_CSTAR_SWEDISH__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  552.         case INPUT_MODE_SMART_UPPERCASE_SWEDISH:
  553.         case INPUT_MODE_SMART_LOWERCASE_SWEDISH:
  554.         #endif /* defined(__MMI_T9_SWEDISH__) */ 
  555.         #if defined(__MMI_T9_GREEK__) || defined(__MMI_CSTAR_GREEK__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  556.         case INPUT_MODE_SMART_UPPERCASE_GREEK:
  557.         case INPUT_MODE_SMART_LOWERCASE_GREEK:
  558.         #endif /* defined(__MMI_T9_GREEK__) */ 
  559.         #if defined(__MMI_T9_HEBREW__) || defined(__MMI_CSTAR_HEBREW__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  560.         case INPUT_MODE_SMART_HEBREW:
  561.         #endif 
  562.             //PMT LANGUAGE END 20051221
  563.             //PMT NO_AR_SL_DU END 20050909
  564.             //PMT START LANGUAGE 20060104
  565.         #if defined(__MMI_T9_MALAY__) || defined(__MMI_CSTAR_MALAY__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  566.         case INPUT_MODE_SMART_UPPERCASE_MALAY:
  567.         case INPUT_MODE_SMART_LOWERCASE_MALAY:
  568.         #endif /* defined(__MMI_T9_MALAY__) */ 
  569.         #if defined(__MMI_T9_CROATIAN__) || defined(__MMI_CSTAR_CROATIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  570.         case INPUT_MODE_SMART_UPPERCASE_CROATIAN:
  571.         case INPUT_MODE_SMART_LOWERCASE_CROATIAN:
  572.         #endif /* defined(__MMI_T9_CROATIAN__) */ 
  573.         #if defined(__MMI_T9_SLOVAK__) || defined(__MMI_CSTAR_SLOVAK__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  574.         case INPUT_MODE_SMART_UPPERCASE_SLOVAK:
  575.         case INPUT_MODE_SMART_LOWERCASE_SLOVAK:
  576.         #endif /* defined(__MMI_T9_SLOVAK__) */ 
  577.         #if defined(__MMI_T9_ROMANIAN__) || defined(__MMI_CSTAR_ROMANIAN__)    //KP Jerry add "__MMI_CSTAR_XXX__" on 2007-4-18
  578.         case INPUT_MODE_SMART_UPPERCASE_ROMANIAN:
  579.         case INPUT_MODE_SMART_LOWERCASE_ROMANIAN:
  580.         #endif /* defined(__MMI_T9_ROMANIAN__) */ 
  581.             //PMT END LANGUAGE 20060104
  582.             //PMT VIKAS GUPTA START 20051129
  583.             if (MMI_current_input_mode == INPUT_MODE_SMART_HINDI)
  584.             {
  585.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y);
  586.             }
  587.             /* PMT RAKESH START 20061006 */
  588.             else if (MMI_current_input_mode == INPUT_MODE_MULTITAP_MARATHI)
  589.             {
  590.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y + 1);
  591.             }
  592.             /* PMT RAKESH START 20061006 */
  593.             else
  594.                 /* PMT VIKAS GUPTA END 20051129 */
  595.         #if !defined(__MMI_TOUCH_SCREEN__)
  596.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y + 3);
  597.         #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  598.                 gui_move_text_cursor(
  599.                     wgui_EMS_inputbox_information_bar_x + x,
  600.                     wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2);
  601.         #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  602.             gui_print_text(inputmode_string);
  603.             break;
  604.         #elif defined(__MMI_ZI__)
  605.         case INPUT_MODE_SMART_UPPERCASE_ABC:
  606.         case INPUT_MODE_SMART_LOWERCASE_ABC:
  607.             /* MTK Terry for Russian Spanish French German Italian Turkish Portuguese Indonesian Malay Vietnamese */
  608.         #if defined(__MMI_ZI_EU_SPANISH__) || defined(__MMI_ZI_SA_SPANISH__)
  609.         case INPUT_MODE_SMART_UPPERCASE_SPANISH:
  610.         case INPUT_MODE_SMART_LOWERCASE_SPANISH:
  611.         #endif /* defined(__MMI_ZI_EU_SPANISH__) || defined(__MMI_ZI_SA_SPANISH__) */ 
  612.             /* PMT VIKASG START 20050729 */
  613.         #if defined(__MMI_ZI_DANISH__)
  614.         case INPUT_MODE_SMART_UPPERCASE_DANISH:
  615.         case INPUT_MODE_SMART_LOWERCASE_DANISH:
  616.         #endif /* defined(__MMI_ZI_DANISH__) */ 
  617.             //PMT VIKASG END 20050729
  618.             //PMT CZ_PO_TU START 20050812
  619.         #if defined(__MMI_ZI_POLISH__)
  620.         case INPUT_MODE_SMART_UPPERCASE_POLISH:
  621.         case INPUT_MODE_SMART_LOWERCASE_POLISH:
  622.         #endif /* defined(__MMI_ZI_POLISH__) */ 
  623.             //PMT CZ_PO_TU END 20050812
  624.             //PMT VIKAS GUPTA START PO_NO_ZI 20050930
  625.         #if defined(__MMI_ZI_NORWEGIAN__)
  626.         case INPUT_MODE_SMART_UPPERCASE_NORWEGIAN:
  627.         case INPUT_MODE_SMART_LOWERCASE_NORWEGIAN:
  628.         #endif /* defined(__MMI_ZI_NORWEGIAN__) */ 
  629.             /* PMT VIKAS GUPTA END PO_NO_ZI 20050930 */
  630.         #if defined(__MMI_ZI_CA_FRENCH__) || defined(__MMI_ZI_EU_FRENCH__)
  631.         case INPUT_MODE_SMART_UPPERCASE_FRENCH:
  632.         case INPUT_MODE_SMART_LOWERCASE_FRENCH:
  633.         #endif /* defined(__MMI_ZI_CA_FRENCH__) || defined(__MMI_ZI_EU_FRENCH__) */ 
  634.         #if defined(__MMI_ZI_GERMAN__)
  635.         case INPUT_MODE_SMART_UPPERCASE_GERMAN:
  636.         case INPUT_MODE_SMART_LOWERCASE_GERMAN:
  637.         #endif /* defined(__MMI_ZI_GERMAN__) */ 
  638.         #if defined(__MMI_ZI_ITALIAN__)
  639.         case INPUT_MODE_SMART_UPPERCASE_ITALIAN:
  640.         case INPUT_MODE_SMART_LOWERCASE_ITALIAN:
  641.         #endif /* defined(__MMI_ZI_ITALIAN__) */ 
  642.         #if defined(__MMI_ZI_RUSSIAN__) || defined(__MMI_ZI_RECOMMENDED_SIZE_RUSSIAN__)
  643.         case INPUT_MODE_SMART_UPPERCASE_RUSSIAN:
  644.         case INPUT_MODE_SMART_LOWERCASE_RUSSIAN:
  645.         #endif /* defined(__MMI_ZI_RUSSIAN__) || defined(__MMI_ZI_RECOMMENDED_SIZE_RUSSIAN__) */ 
  646.             /* PMT BULGARIAN START 20051201 */
  647.         #if defined(__MMI_ZI_BULGARIAN__)
  648.         case INPUT_MODE_SMART_UPPERCASE_BULGARIAN:
  649.         case INPUT_MODE_SMART_LOWERCASE_BULGARIAN:
  650.         #endif /* defined(__MMI_ZI_BULGARIAN__) */ 
  651.             /* PMT BULGARIAN END 20051201 */
  652.         #if defined(__MMI_ZI_TURKISH__)
  653.         case INPUT_MODE_SMART_UPPERCASE_TURKISH:
  654.         case INPUT_MODE_SMART_LOWERCASE_TURKISH:
  655.         #endif /* defined(__MMI_ZI_TURKISH__) */ 
  656.         #if defined(__MMI_ZI_EU_PORTUGUESE__) || defined(__MMI_ZI_SA_PORTUGUESE__) || defined(__MMI_ZI_BZ_PORTUGUESE__)
  657.         case INPUT_MODE_SMART_UPPERCASE_PORTUGUESE:
  658.         case INPUT_MODE_SMART_LOWERCASE_PORTUGUESE:
  659.         #endif /* defined(__MMI_ZI_EU_PORTUGUESE__) || defined(__MMI_ZI_SA_PORTUGUESE__) || defined(__MMI_ZI_BZ_PORTUGUESE__) */ 
  660.         #if defined(__MMI_ZI_INDONESIAN__)
  661.         case INPUT_MODE_SMART_UPPERCASE_INDONESIAN:
  662.         case INPUT_MODE_SMART_LOWERCASE_INDONESIAN:
  663.         #endif /* defined(__MMI_ZI_INDONESIAN__) */ 
  664.             /* PMT CZ_PO_TU START 20050812 */
  665.         #if defined(__MMI_ZI_CZECH__)
  666.         case INPUT_MODE_SMART_UPPERCASE_CZECH:
  667.         case INPUT_MODE_SMART_LOWERCASE_CZECH:
  668.         #endif /* defined(__MMI_ZI_CZECH__) */ 
  669.             /* PMT CZ_PO_TU END 20050812 */
  670.         #if defined(__MMI_ZI_MALAY__)
  671.         case INPUT_MODE_SMART_UPPERCASE_MALAY:
  672.         case INPUT_MODE_SMART_LOWERCASE_MALAY:
  673.         #endif /* defined(__MMI_ZI_MALAY__) */ 
  674.         #if defined(__MMI_ZI_VIETNAMESE__)
  675.         case INPUT_MODE_SMART_UPPERCASE_VIETNAMESE:
  676.         case INPUT_MODE_SMART_LOWERCASE_VIETNAMESE:
  677.         #endif /* defined(__MMI_ZI_VIETNAMESE__) */ 
  678.             /* PMT NO_AR_SL_DU START 20050909 */
  679.         #if defined(__MMI_ZI_SLOVAK__)
  680.         case INPUT_MODE_SMART_UPPERCASE_SLOVAK:
  681.         case INPUT_MODE_SMART_LOWERCASE_SLOVAK:
  682.         #endif /* defined(__MMI_ZI_SLOVAK__) */ 
  683.         #if defined(__MMI_ZI_DUTCH__)
  684.         case INPUT_MODE_SMART_UPPERCASE_DUTCH:
  685.         case INPUT_MODE_SMART_LOWERCASE_DUTCH:
  686.         #endif /* defined(__MMI_ZI_DUTCH__) */ 
  687.             //PMT NO_AR_SL_DU END 20050909
  688.             //PMT START SWEDISH 20050916
  689.         #if defined(__MMI_ZI_SWEDISH__)
  690.         case INPUT_MODE_SMART_UPPERCASE_SWEDISH:
  691.         case INPUT_MODE_SMART_LOWERCASE_SWEDISH:
  692.         #endif /* defined(__MMI_ZI_SWEDISH__) */ 
  693.             /* PMT END SWEDISH 20050916 */
  694.             /* PMT START CR_ROM_SLO 20050923 */
  695.         #if defined(__MMI_ZI_CROATIAN__)
  696.         case INPUT_MODE_SMART_UPPERCASE_CROATIAN:
  697.         case INPUT_MODE_SMART_LOWERCASE_CROATIAN:
  698.         #endif /* defined(__MMI_ZI_CROATIAN__) */ 
  699.         #if defined(__MMI_ZI_ROMANIAN__)
  700.         case INPUT_MODE_SMART_UPPERCASE_ROMANIAN:
  701.         case INPUT_MODE_SMART_LOWERCASE_ROMANIAN:
  702.         #endif /* defined(__MMI_ZI_ROMANIAN__) */ 
  703.         #if defined(__MMI_ZI_SLOVENIAN__)
  704.         case INPUT_MODE_SMART_UPPERCASE_SLOVENIAN:
  705.         case INPUT_MODE_SMART_LOWERCASE_SLOVENIAN:
  706.         #endif /* defined(__MMI_ZI_SLOVENIAN__) */ 
  707.             //PMT END CR_ROM_SLO 20050923
  708.             //PMT START GR_HE_CZ_FI_DA_HU 20051007
  709.         #if defined(__MMI_ZI_GREEK__)
  710.         case INPUT_MODE_SMART_UPPERCASE_GREEK:
  711.         case INPUT_MODE_SMART_LOWERCASE_GREEK:
  712.         #endif /* defined(__MMI_ZI_GREEK__) */ 
  713.         #if defined(__MMI_ZI_FINNISH__)
  714.         case INPUT_MODE_SMART_UPPERCASE_FINNISH:
  715.         case INPUT_MODE_SMART_LOWERCASE_FINNISH:
  716.         #endif /* defined(__MMI_ZI_FINNISH__) */ 
  717.         #if defined(__MMI_ZI_HUNGARIAN__)
  718.         case INPUT_MODE_SMART_UPPERCASE_HUNGARIAN:
  719.         case INPUT_MODE_SMART_LOWERCASE_HUNGARIAN:
  720.         #endif /* defined(__MMI_ZI_HUNGARIAN__) */ 
  721.             //PMT END GR_HE_CZ_FI_DA_HU 20051007
  722.             //MTK end
  723.         case INPUT_MODE_SMART_THAI:
  724.             /* MTK Elvis for R2L characters */
  725.         case INPUT_MODE_SMART_ARABIC:
  726.             /* PMT START PERSIAN */
  727.         case INPUT_MODE_SMART_PERSIAN:
  728.             /* PMT END PERSIAN */
  729.             /* PMT VIKAS GUPTA START 20051129 */
  730.         case INPUT_MODE_SMART_HINDI:
  731.             //PMT VIKAS GUPTA END 20051129
  732.             //PMT START GR_HE_CZ_FI_DA_HU 20051007
  733.         case INPUT_MODE_SMART_HEBREW:
  734.             //PMT END GR_HE_CZ_FI_DA_HU 20051007
  735.             //MTK end
  736.             if (wgui_EMS_inputbox_information_icon == NULL)
  737.             {
  738.                 /* MTK Elvis for R2L characters */
  739.                 if (!r2lMMIFlag)
  740.                 {
  741.                     x += width + 2;
  742.                 }
  743.                 else
  744.                 {
  745.                     x -= (width + 2);
  746.                 }
  747.                 /* MTK end */
  748.             }
  749.             else
  750.             {
  751.                 /* MTK Elvis for R2L characters */
  752.                 gui_measure_image(wgui_EMS_inputbox_information_icon, &width, &height);
  753.                 if (!r2lMMIFlag)
  754.                 {
  755.                 #if !defined(__MMI_TOUCH_SCREEN__)
  756.                     gui_show_transparent_image(
  757.                         x,
  758.                         wgui_EMS_inputbox_information_bar_y + 1,
  759.                         wgui_EMS_inputbox_information_icon,
  760.                         0);
  761.                 #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  762.                     gui_show_transparent_image(
  763.                         x,
  764.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  765.                         wgui_EMS_inputbox_information_icon,
  766.                         0);
  767.                 #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  768.                     x += width + 2;
  769.                 }
  770.                 else
  771.                 {
  772.                 #if !defined(__MMI_TOUCH_SCREEN__)
  773.                     gui_show_transparent_image(
  774.                         x - width,
  775.                         wgui_EMS_inputbox_information_bar_y + 1,
  776.                         wgui_EMS_inputbox_information_icon,
  777.                         0);
  778.                 #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  779.                     gui_show_transparent_image(
  780.                         x - width,
  781.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  782.                         wgui_EMS_inputbox_information_icon,
  783.                         0);
  784.                 #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  785.                     x -= (width + 2);
  786.                 }
  787.                 /* MTK end */
  788.             }
  789.             /* PMT VIKAS GUPTA START 20051129 */
  790.             if (MMI_current_input_mode == INPUT_MODE_SMART_HINDI)
  791.             {
  792.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y);
  793.             }
  794.             /* PMT RAKESH START 20061006 */
  795.             else if (MMI_current_input_mode == INPUT_MODE_MULTITAP_MARATHI)
  796.             {
  797.                gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y + 1);
  798.             }
  799.             /* PMT RAKESH END 20061006 */
  800.             else
  801.                 /* PMT VIKAS GUPTA END 20051129 */
  802.             {
  803.                 gui_move_text_cursor(wgui_EMS_inputbox_information_bar_x + x, wgui_EMS_inputbox_information_bar_y + 3);
  804.             }
  805.             gui_print_text(inputmode_string);
  806.             break;
  807.         case INPUT_MODE_TR_MULTITAP_BOPOMO:
  808.         case INPUT_MODE_SM_MULTITAP_PINYIN:
  809.         case INPUT_MODE_SM_STROKE:
  810.         case INPUT_MODE_TR_STROKE:
  811.             if (wgui_EMS_inputbox_information_icon == NULL)
  812.             {
  813.                 /* MTK Elvis for R2L characters */
  814.                 if (!r2lMMIFlag)
  815.                 {
  816.                     x += width + 2;
  817.                 }
  818.                 else
  819.                 {
  820.                     x -= (width + 2);
  821.                 }
  822.                 /* MTK end */
  823.             }
  824.             else
  825.             {
  826.                 /* MTK Elvis for R2L characters */
  827.                 gui_measure_image(wgui_EMS_inputbox_information_icon, &width, &height);
  828.             #if defined(__MMI_TOUCH_SCREEN__)
  829.                 wgui_information_bar_input_mode_display_width += width;
  830.             #endif
  831.                 if (!r2lMMIFlag)
  832.                 {
  833.                 #if !defined(__MMI_TOUCH_SCREEN__)
  834.                     gui_show_transparent_image(
  835.                         x,
  836.                         wgui_EMS_inputbox_information_bar_y + 1,
  837.                         wgui_EMS_inputbox_information_icon,
  838.                         0);
  839.                 #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  840.                     gui_draw_filled_area(
  841.                         x,
  842.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - rect_height) / 2 - 1,
  843.                         x + 4 + width,
  844.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height + rect_height) / 2,
  845.                         &information_bar_BG_filler);
  846.                     gui_show_transparent_image(
  847.                         x + 2,
  848.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2 + 1,
  849.                         wgui_EMS_inputbox_information_icon,
  850.                         0);
  851.                 #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  852.                     x += width + 2;
  853.                 }
  854.                 else
  855.                 {
  856.                 #if !defined(__MMI_TOUCH_SCREEN__)
  857.                     gui_show_transparent_image(
  858.                         x - width,
  859.                         wgui_EMS_inputbox_information_bar_y + 1,
  860.                         wgui_EMS_inputbox_information_icon,
  861.                         0);
  862.                 #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  863.                     gui_draw_filled_area(
  864.                         x - width,
  865.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - rect_height) / 2 - 1,
  866.                         x + 4 + width,
  867.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height + rect_height) / 2,
  868.                         &information_bar_BG_filler);
  869.                     gui_show_transparent_image(
  870.                         x - width + 2,
  871.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2 + 1,
  872.                         wgui_EMS_inputbox_information_icon,
  873.                         0);
  874.                 #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  875.                     x -= (width + 2);
  876.                 }
  877.                 /* MTK end */
  878.             }
  879.             break;
  880.         case INPUT_MODE_TR_BOPOMO:
  881.         case INPUT_MODE_SM_PINYIN:
  882.             gui_measure_image(get_image(WGUI_ZI_EZITEXT_LOGO), &width, &height);
  883.         #if defined(__MMI_TOUCH_SCREEN__)
  884.             wgui_information_bar_input_mode_display_width += width;
  885.         #endif
  886.             /* MTK Elvis for R2L characters */
  887.             if (!r2lMMIFlag)
  888.             {
  889.             #if !defined(__MMI_TOUCH_SCREEN__)
  890.                 gui_show_transparent_image(
  891.                     x,
  892.                     wgui_EMS_inputbox_information_bar_y + 1,
  893.                     get_image(WGUI_ZI_EZITEXT_LOGO),
  894.                     0);
  895.             #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  896.                 gui_show_transparent_image(
  897.                     x,
  898.                     wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  899.                     get_image(WGUI_ZI_EZITEXT_LOGO),
  900.                     0);
  901.             #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  902.                 x += width + 2;
  903.             }
  904.             else
  905.             {
  906.             #if !defined(__MMI_TOUCH_SCREEN__)
  907.                 gui_show_transparent_image(
  908.                     x - width,
  909.                     wgui_EMS_inputbox_information_bar_y + 1,
  910.                     get_image(WGUI_ZI_EZITEXT_LOGO),
  911.                     0);
  912.             #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  913.                 gui_show_transparent_image(
  914.                     x - width,
  915.                     wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2,
  916.                     get_image(WGUI_ZI_EZITEXT_LOGO),
  917.                     0);
  918.             #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  919.                 x -= (width + 2);
  920.             }
  921.             /* MTK end */
  922.             if (wgui_EMS_inputbox_information_icon == NULL)
  923.             {
  924.                 /* MTK Elvis for R2L characters */
  925.                 if (!r2lMMIFlag)
  926.                 {
  927.                     x += width + 2;
  928.                 }
  929.                 else
  930.                 {
  931.                     x -= (width + 2);
  932.                 }
  933.                 /* MTK end */
  934.             }
  935.             else
  936.             {
  937.                 /* MTK Elvis for R2L characters */
  938.                 gui_measure_image(wgui_EMS_inputbox_information_icon, &width, &height);
  939.             #if defined(__MMI_TOUCH_SCREEN__)
  940.                 wgui_information_bar_input_mode_display_width += width;
  941.             #endif    
  942.                 if (!r2lMMIFlag)
  943.                 {
  944.                 #if !defined(__MMI_TOUCH_SCREEN__)
  945.                     gui_show_transparent_image(
  946.                         x,
  947.                         wgui_EMS_inputbox_information_bar_y + 1,
  948.                         wgui_EMS_inputbox_information_icon,
  949.                         0);
  950.                 #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  951.                     gui_draw_filled_area(
  952.                         x,
  953.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - rect_height) / 2 - 1,
  954.                         x + 4 + width,
  955.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height + rect_height) / 2,
  956.                         &information_bar_BG_filler);
  957.                     gui_show_transparent_image(
  958.                         x,
  959.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2 + 1,
  960.                         wgui_EMS_inputbox_information_icon,
  961.                         0);
  962.                 #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  963.                     x += width + 2;
  964.                 }
  965.                 else
  966.                 {
  967.                 #if !defined(__MMI_TOUCH_SCREEN__)
  968.                     gui_show_transparent_image(
  969.                         x - width,
  970.                         wgui_EMS_inputbox_information_bar_y + 1,
  971.                         wgui_EMS_inputbox_information_icon,
  972.                         0);
  973.                 #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  974.                     gui_draw_filled_area(
  975.                         x - width,
  976.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - rect_height) / 2 - 1,
  977.                         x + 4 + width,
  978.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height + rect_height) / 2,
  979.                         &information_bar_BG_filler);
  980.                     gui_show_transparent_image(
  981.                         x - width,
  982.                         wgui_EMS_inputbox_information_bar_y + (wgui_inputbox_information_bar_height - height) / 2 + 1,
  983.                         wgui_EMS_inputbox_information_icon,
  984.                         0);
  985.                 #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  986.                     x -= (width + 2);
  987.                 }
  988.                 /* MTK end */
  989.             }
  990.             break;
  991.         #endif 
  992.     }
  993. }
  994. /* MTK end */
  995. /*****************************************************************************
  996.  * FUNCTION
  997.  *  wgui_EMS_redraw_remaining_characters_display
  998.  * DESCRIPTION
  999.  *  
  1000.  * PARAMETERS
  1001.  *  void
  1002.  * RETURNS
  1003.  *  void
  1004.  *****************************************************************************/
  1005. void wgui_EMS_redraw_remaining_characters_display(void)
  1006. {
  1007. #ifndef __MMI_HIDE_EMS_REMAINING_CHAR__
  1008.     /*----------------------------------------------------------------*/
  1009.     /* Local Variables                                                */
  1010.     /*----------------------------------------------------------------*/
  1011.     color c;
  1012.     /* MTK Elvis for R2L characters */
  1013.     S32 x1;
  1014.     S32 x2;
  1015.     S32 y1 = wgui_EMS_inputbox_information_bar_y;
  1016.     S32 y2 = wgui_EMS_inputbox_information_bar_y + wgui_EMS_inputbox_information_bar_height - 1;
  1017.     /* MTK end */
  1018. #if !defined(__MMI_TOUCH_SCREEN__)
  1019.     stFontAttribute *f = &MMI_small_font;
  1020.     S32 w, n, max_n;
  1021. #else /* !defined(__MMI_TOUCH_SCREEN__) */ 
  1022.     stFontAttribute *f = &MMI_medium_font;
  1023.     S32 w, h, n, max_n;
  1024. #endif /* !defined(__MMI_TOUCH_SCREEN__) */ 
  1025.     UI_character_type str[32];
  1026.     /*----------------------------------------------------------------*/
  1027.     /* Code Body                                                      */
  1028.     /*----------------------------------------------------------------*/
  1029.     /* MTK Elvis for R2L characters */
  1030.     if (!r2lMMIFlag)
  1031.     {
  1032.         x1 = wgui_EMS_inputbox_information_bar_x + (wgui_EMS_inputbox_information_bar_width >> 1);
  1033.         x2 = wgui_EMS_inputbox_information_bar_x + wgui_EMS_inputbox_information_bar_width - 1;
  1034.     }
  1035.     else
  1036.     {
  1037.         x1 = wgui_EMS_inputbox_information_bar_x;
  1038.         x2 = wgui_EMS_inputbox_information_bar_x + (wgui_EMS_inputbox_information_bar_width / 2) - 1;
  1039.     }
  1040.     /* MTK end */
  1041. #if(UI_DOUBLE_BUFFER_SUPPORT)
  1042.     gui_lock_double_buffer();
  1043. #endif 
  1044. #if(UI_DISABLE_EMS_INPUT_BOX)
  1045. #ifdef __UCS2_ENCODING
  1046.     n = (MMI_multiline_inputbox.text_length >> 1) - 1;
  1047.     if (MMI_multiline_inputbox.UCS2_count > 0)
  1048.     {
  1049.         max_n = 268;
  1050.     }
  1051.     else
  1052.     {
  1053.         max_n = 612;
  1054.     }
  1055. #endif /* __UCS2_ENCODING */ 
  1056. #ifdef __ASCII
  1057.     n = MMI_multiline_inputbox.text_length - 1;
  1058.     if (MMI_multiline_inputbox.UCS2_count > 0)
  1059.     {
  1060.         max_n = 268;
  1061.     }
  1062.     else
  1063.     {
  1064.         max_n = 612;
  1065.     }
  1066. #endif /* __ASCII */ 
  1067. #else /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1068.     /* reassign MMI_EMS_inputbox.available_length because it might be one byte difference per segment for EMS 5.1 */
  1069.     gui_EMS_change_DCS(&MMI_EMS_inputbox);
  1070.     n = MMI_EMS_inputbox.available_length - EMS_get_remaining_length(MMI_EMS_inputbox.data);
  1071.     if (MMI_EMS_inputbox.UCS2_count > 0)
  1072.     {
  1073.         n = MMI_EMS_inputbox.available_length - (EMS_get_remaining_length(MMI_EMS_inputbox.data) >> 1);
  1074.     }
  1075.     else if (MMI_EMS_inputbox.GSM_ext_count > 0)
  1076.     {
  1077.         n = MMI_EMS_inputbox.available_length - EMS_get_remaining_length(MMI_EMS_inputbox.data);
  1078.     }
  1079.     max_n = MMI_EMS_inputbox.available_length;
  1080. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1081.     wgui_EMS_input_information_background(x1, y1, x2, y2);
  1082.     gui_reset_text_clip();
  1083.     gui_sprintf(str, "%d/%d", n, max_n);
  1084.     c = *current_MMI_theme->remaining_length_text_color;
  1085.     gui_set_font(f);
  1086.     gui_set_text_color(c);
  1087.     gui_set_text_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
  1088. #if !defined(__MMI_TOUCH_SCREEN__)
  1089.     w = gui_get_string_width(str);
  1090. #else 
  1091.     gui_measure_string(str, &w, &h);
  1092. #endif 
  1093.     /* MTK Elvis for R2L characters */
  1094.     if (!r2lMMIFlag)
  1095. #if !defined(__MMI_TOUCH_SCREEN__)
  1096.         gui_move_text_cursor(x2 - 2 - w, y1 + 2);
  1097. #else 
  1098.         gui_move_text_cursor(x2 - 2 - w, y1 + (wgui_inputbox_information_bar_height - h) / 2);
  1099. #endif 
  1100.     else
  1101. #if !defined(__MMI_TOUCH_SCREEN__)
  1102.         gui_move_text_cursor(x1 + 2 + w, y1 + 2);
  1103. #else 
  1104.         gui_move_text_cursor(x1 + 2 + w, y1 + (wgui_inputbox_information_bar_height - h) / 2);
  1105. #endif 
  1106.     /* MTK end */
  1107.     gui_print_text(str);
  1108. #if(UI_DOUBLE_BUFFER_SUPPORT)
  1109.     gui_unlock_double_buffer();
  1110.     gui_BLT_double_buffer(x1, y1, x2, y2);
  1111. #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
  1112. #endif /* __MMI_HIDE_EMS_REMAINING_CHAR__ */ 
  1113. }
  1114. /*****************************************************************************
  1115.  * FUNCTION
  1116.  *  wgui_EMS_redraw_input_information_bar
  1117.  * DESCRIPTION
  1118.  *  
  1119.  * PARAMETERS
  1120.  *  void
  1121.  * RETURNS
  1122.  *  void
  1123.  *****************************************************************************/
  1124. void wgui_EMS_redraw_input_information_bar(void)
  1125. {
  1126.     /*----------------------------------------------------------------*/
  1127.     /* Local Variables                                                */
  1128.     /*----------------------------------------------------------------*/
  1129.     S32 x1 = wgui_EMS_inputbox_information_bar_x;
  1130.     S32 y1 = wgui_EMS_inputbox_information_bar_y;
  1131.     S32 x2 = wgui_EMS_inputbox_information_bar_x + wgui_EMS_inputbox_information_bar_width - 1;
  1132.     S32 y2 = wgui_EMS_inputbox_information_bar_y + wgui_EMS_inputbox_information_bar_height - 1;
  1133.     /*----------------------------------------------------------------*/
  1134.     /* Code Body                                                      */
  1135.     /*----------------------------------------------------------------*/
  1136.     gui_lock_double_buffer();
  1137.     wgui_EMS_input_information_background(x1, y1, x2, y2);
  1138.     wgui_EMS_show_input_mode();
  1139.     wgui_EMS_redraw_remaining_characters_display();
  1140.     gui_unlock_double_buffer();
  1141.     gui_BLT_double_buffer(x1, y1, x2, y2);
  1142. }
  1143. extern S16 MMI_current_input_type;
  1144. #if(EMS_USE_STUB_MENU)
  1145. /*****************************************************************************
  1146.  * FUNCTION
  1147.  *  EntryEMSEditOptionsMenu
  1148.  * DESCRIPTION
  1149.  *  
  1150.  * PARAMETERS
  1151.  *  void
  1152.  * RETURNS
  1153.  *  void
  1154.  *****************************************************************************/
  1155. void EntryEMSEditOptionsMenu(void)
  1156. {
  1157.     /*----------------------------------------------------------------*/
  1158.     /* Local Variables                                                */
  1159.     /*----------------------------------------------------------------*/
  1160.     /*----------------------------------------------------------------*/
  1161.     /* Code Body                                                      */
  1162.     /*----------------------------------------------------------------*/
  1163. }
  1164. #endif /* (EMS_USE_STUB_MENU) */ 
  1165. /*****************************************************************************
  1166.  * FUNCTION
  1167.  *  wgui_EMS_inputbox_insert_symbol
  1168.  * DESCRIPTION
  1169.  *  
  1170.  * PARAMETERS
  1171.  *  symbol      [IN]        
  1172.  * RETURNS
  1173.  *  void
  1174.  *****************************************************************************/
  1175. void wgui_EMS_inputbox_insert_symbol(UI_character_type symbol)
  1176. {
  1177.     /*----------------------------------------------------------------*/
  1178.     /* Local Variables                                                */
  1179.     /*----------------------------------------------------------------*/
  1180.     /*----------------------------------------------------------------*/
  1181.     /* Code Body                                                      */
  1182.     /*----------------------------------------------------------------*/
  1183. #if(!UI_DISABLE_EMS_INPUT_BOX)
  1184.     EMS_inputbox_direct_input(symbol);
  1185. #endif 
  1186. }
  1187. /*****************************************************************************
  1188.  * FUNCTION
  1189.  *  temp_ems_insert_character
  1190.  * DESCRIPTION
  1191.  *  
  1192.  * PARAMETERS
  1193.  *  void
  1194.  * RETURNS
  1195.  *  void
  1196.  *****************************************************************************/
  1197. void temp_ems_insert_character(void)
  1198. {
  1199.     /*----------------------------------------------------------------*/
  1200.     /* Local Variables                                                */
  1201.     /*----------------------------------------------------------------*/
  1202.     UI_character_type symbol = 0xabc;
  1203.     /*----------------------------------------------------------------*/
  1204.     /* Code Body                                                      */
  1205.     /*----------------------------------------------------------------*/
  1206. #if(!UI_DISABLE_EMS_INPUT_BOX)
  1207.     EMS_inputbox_direct_input(symbol);
  1208. #endif 
  1209. }
  1210. #if(UI_DISABLE_EMS_INPUT_BOX)
  1211. /*****************************************************************************
  1212.  * FUNCTION
  1213.  *  EMS_inputbox_insert_predefined_picture
  1214.  * DESCRIPTION
  1215.  *  
  1216.  * PARAMETERS
  1217.  *  index       [IN]        
  1218.  * RETURNS
  1219.  *  
  1220.  *****************************************************************************/
  1221. EMSTATUS EMS_inputbox_insert_predefined_picture(S32 index)
  1222. {
  1223.     /*----------------------------------------------------------------*/
  1224.     /* Local Variables                                                */
  1225.     /*----------------------------------------------------------------*/
  1226.     /*----------------------------------------------------------------*/
  1227.     /* Code Body                                                      */
  1228.     /*----------------------------------------------------------------*/
  1229.     UI_UNUSED_PARAMETER(index);
  1230.     return (0);
  1231. }
  1232. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1233. /*****************************************************************************
  1234.  * FUNCTION
  1235.  *  AppendEMSString
  1236.  * DESCRIPTION
  1237.  *  
  1238.  * PARAMETERS
  1239.  *  input_type          [IN]        
  1240.  *  data                [?]         
  1241.  *  s                   [?]         
  1242.  *  dcs                 [IN]        
  1243.  *  history_buffer      [?]         
  1244.  * RETURNS
  1245.  *  
  1246.  *****************************************************************************/
  1247. U8 AppendEMSString(S16 input_type, EMSData *data, U8 *s, U8 dcs, U8 *history_buffer)
  1248. {
  1249.     /*----------------------------------------------------------------*/
  1250.     /* Local Variables                                                */
  1251.     /*----------------------------------------------------------------*/
  1252.     S32 l, box_height;
  1253.     /*----------------------------------------------------------------*/
  1254.     /* Code Body                                                      */
  1255.     /*----------------------------------------------------------------*/
  1256.     l = gui_strlen((UI_string_type) s);
  1257.     box_height = MMI_content_height - MMI_multitap_height - 10;
  1258.     gui_create_EMS_input_box(&MMI_EMS_inputbox, 0, (MMI_title_y + MMI_title_height) + 12, UI_device_width, box_height);
  1259.     gui_set_EMS_input_box_data(&MMI_EMS_inputbox, data);
  1260.     EMSSetDCS(MMI_EMS_inputbox.data, dcs);
  1261.     if (AddString(MMI_EMS_inputbox.data, s, (U16) l, NULL) == EMS_OK)
  1262.     {
  1263.         return 1;
  1264.     }
  1265.     else
  1266.     {
  1267.         return 0;
  1268.     }
  1269. }
  1270. /*****************************************************************************
  1271.  * FUNCTION
  1272.  *  move_EMS_inputbox
  1273.  * DESCRIPTION
  1274.  *  
  1275.  * PARAMETERS
  1276.  *  x       [IN]        
  1277.  *  y       [IN]        
  1278.  * RETURNS
  1279.  *  void
  1280.  *****************************************************************************/
  1281. void move_EMS_inputbox(S32 x, S32 y)
  1282. {
  1283.     /*----------------------------------------------------------------*/
  1284.     /* Local Variables                                                */
  1285.     /*----------------------------------------------------------------*/
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Code Body                                                      */
  1288.     /*----------------------------------------------------------------*/
  1289.     gui_move_EMS_input_box(&MMI_EMS_inputbox, x, y);
  1290. }
  1291. /*****************************************************************************
  1292.  * FUNCTION
  1293.  *  resize_EMS_inputbox
  1294.  * DESCRIPTION
  1295.  *  
  1296.  * PARAMETERS
  1297.  *  width       [IN]        
  1298.  *  height      [IN]        
  1299.  * RETURNS
  1300.  *  void
  1301.  *****************************************************************************/
  1302. void resize_EMS_inputbox(S32 width, S32 height)
  1303. {
  1304.     /*----------------------------------------------------------------*/
  1305.     /* Local Variables                                                */
  1306.     /*----------------------------------------------------------------*/
  1307.     /*----------------------------------------------------------------*/
  1308.     /* Code Body                                                      */
  1309.     /*----------------------------------------------------------------*/
  1310.     gui_resize_EMS_input_box(&MMI_EMS_inputbox, width, height);
  1311. }
  1312. extern U8 category28_RSK_label_clear;
  1313. /*****************************************************************************
  1314.  * FUNCTION
  1315.  *  wgui_set_EMS_inputbox_RSK
  1316.  * DESCRIPTION
  1317.  *  
  1318.  * PARAMETERS
  1319.  *  void
  1320.  * RETURNS
  1321.  *  void
  1322.  *****************************************************************************/
  1323. void wgui_set_EMS_inputbox_RSK(void)
  1324. {
  1325.     /*----------------------------------------------------------------*/
  1326.     /* Local Variables                                                */
  1327.     /*----------------------------------------------------------------*/
  1328.     /*----------------------------------------------------------------*/
  1329.     /* Code Body                                                      */
  1330.     /*----------------------------------------------------------------*/
  1331.     category28_RSK_label_clear = 0;
  1332. #if defined(__MMI_WITH_C_KEY__)
  1333.     SetKeyHandler(handle_category28_right_softkey_down, KEY_CLEAR, KEY_EVENT_DOWN);
  1334.     SetKeyHandler(handle_category28_right_softkey_long_press, KEY_CLEAR, KEY_LONG_PRESS);
  1335.     set_right_softkey_function(handle_category28_right_softkey_up, KEY_EVENT_UP);
  1336. #else /* defined(__MMI_WITH_C_KEY__) */ 
  1337.     set_right_softkey_function(handle_category28_right_softkey_down, KEY_EVENT_DOWN);
  1338.     set_right_softkey_function(handle_category28_right_softkey_long_press, KEY_LONG_PRESS);
  1339. #endif /* defined(__MMI_WITH_C_KEY__) */ 
  1340.     register_EMS_inputbox_input_callback(handle_category28_input);
  1341.     handle_category28_input();
  1342.     if (gui_EMS_inputbox_empty(&MMI_EMS_inputbox))
  1343.     {
  1344.     #if defined(__MMI_WITH_C_KEY__)
  1345.         SetKeyHandler(handle_category28_right_softkey_up, KEY_CLEAR, KEY_EVENT_UP);
  1346.     #else 
  1347.         set_right_softkey_function(handle_category28_right_softkey_up, KEY_EVENT_UP);
  1348.     #endif 
  1349.     }
  1350. }
  1351. #if(ENABLE_EMS_TEST_DEMO)
  1352. /* Removed by Leo useless code..... */
  1353. /*****************************************************************************
  1354.  * FUNCTION
  1355.  *  RedrawCategory29Screen
  1356.  * DESCRIPTION
  1357.  *  Redraws the MT EMS/SMS screen
  1358.  * PARAMETERS
  1359.  *  void
  1360.  * RETURNS
  1361.  *  void
  1362.  *****************************************************************************/
  1363. void RedrawCategory29Screen(void)
  1364. {
  1365.     /*----------------------------------------------------------------*/
  1366.     /* Local Variables                                                */
  1367.     /*----------------------------------------------------------------*/
  1368.     /*----------------------------------------------------------------*/
  1369.     /* Code Body                                                      */
  1370.     /*----------------------------------------------------------------*/
  1371.     gdi_layer_lock_frame_buffer();
  1372.     clear_screen();
  1373.     show_title_status_icon();
  1374.     draw_title();
  1375.     show_softkey_background();
  1376.     show_left_softkey();
  1377.     show_right_softkey();
  1378. #if(UI_DISABLE_EMS_INPUT_BOX)
  1379.     show_multiline_inputbox();
  1380. #else 
  1381.     show_EMS_inputbox();
  1382. #endif 
  1383.     gdi_layer_unlock_frame_buffer();
  1384.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  1385. }
  1386. /*****************************************************************************
  1387.  * FUNCTION
  1388.  *  ShowCategory29Screen
  1389.  * DESCRIPTION
  1390.  *  Displays the MT EMS/SMS screen
  1391.  * PARAMETERS
  1392.  *  title                   [IN]        Title for the screen
  1393.  *  title_icon              [IN]        Icon shown with the title
  1394.  *  left_softkey            [IN]        Left softkey label
  1395.  *  left_softkey_icon       [IN]        Icon for the left softkey
  1396.  *  right_softkey           [IN]        Right softkey label
  1397.  *  right_softkey_icon      [IN]        Icon for the right softkey
  1398.  *  data                    [IN]        EMSData (Pre-allocated and initialized)
  1399.  *  history_buffer          [IN]        History buffer
  1400.  * RETURNS
  1401.  *  void
  1402.  *****************************************************************************/
  1403. void ShowCategory29Screen(
  1404.         U16 title,
  1405.         U16 title_icon,
  1406.         U16 left_softkey,
  1407.         U16 left_softkey_icon,
  1408.         U16 right_softkey,
  1409.         U16 right_softkey_icon,
  1410.         EMSData *data,
  1411.         U8 *history_buffer)
  1412. {
  1413.     /*----------------------------------------------------------------*/
  1414.     /* Local Variables                                                */
  1415.     /*----------------------------------------------------------------*/
  1416.     dm_data_struct dm_data;
  1417.     S16 input_type = 0;
  1418. #if(UI_DISABLE_EMS_INPUT_BOX)
  1419.     S32 length;
  1420.     S32 i, j, h, fh;
  1421.     UI_UNUSED_PARAMETER(history_buffer);
  1422. #else /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1423.     U8 h;
  1424. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1425.     /*----------------------------------------------------------------*/
  1426.     /* Code Body                                                      */
  1427.     /*----------------------------------------------------------------*/
  1428.     EMS_inputbox_has_changed = 0;
  1429. #ifdef __MMI_MESSAGES_EMS__
  1430.     initialize_EMS_objects();
  1431. #endif 
  1432.     MMI_menu_shortcut_number = -1;
  1433.     change_left_softkey(left_softkey, left_softkey_icon);
  1434.     change_right_softkey(right_softkey, right_softkey_icon);
  1435.     SetupCategoryKeyHandlers();
  1436.     MMI_title_string = (UI_string_type) get_string(title);
  1437.     MMI_title_icon = (PU8) get_image(title_icon);
  1438. #if(UI_DISABLE_EMS_INPUT_BOX)
  1439.     length = (data->textBufferSize >> 1);
  1440.     if (length == 0)
  1441.     {
  1442.         UI_string_type s = (UI_string_type) "EMS Data not initialized";
  1443.         S32 l = gui_strlen((UI_string_type) s);
  1444.         temp_EMS_buffer = (UI_string_type) gui_malloc(l * sizeof(UI_character_type));
  1445.         gui_strcpy((UI_string_type) temp_EMS_buffer, (UI_string_type) s);
  1446.         length = l + 1;
  1447.         i = l;
  1448.     }
  1449.     else
  1450.     {
  1451.         temp_EMS_buffer = (UI_string_type) gui_malloc(length * sizeof(UI_character_type));
  1452.         i = j = 0;
  1453.         while (j < data->textLength)
  1454.         {
  1455.             if ((data->textBuffer[j] == '') && (data->textBuffer[j + 1] == ''))
  1456.             {
  1457.                 temp_EMS_buffer[i] = '';
  1458.                 break;
  1459.             }
  1460.             else
  1461.             {
  1462.                 temp_EMS_buffer[i] = data->textBuffer[j + 1];
  1463.             }
  1464.             i++;
  1465.             j += 2;
  1466.         }
  1467.     }
  1468.     temp_EMS_data = data;
  1469.     create_multiline_inputbox_set_buffer(temp_EMS_buffer, length, i, 0);
  1470.     register_multiline_inputbox_keys();
  1471.     register_hide_multitap(category5_hide_multitap);
  1472.     move_multiline_inputbox(0, (MMI_title_y + MMI_title_height) + 2);
  1473.     h = MMI_content_height - MMI_multitap_height - 8;
  1474.     gui_set_font(MMI_multiline_inputbox.text_font);
  1475.     fh = gui_get_character_height();
  1476.     h = ((h / fh) * fh) + 8;
  1477.     resize_multiline_inputbox(MMI_multiline_inputbox.width, h);
  1478.     set_multiline_inputbox_mask(0);
  1479. #else /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1480. #if((UI_ENABLE_FRAME_SKIPPING) && (ENABLE_EMS_INPUTBOX_FRAME_SKIPPING))
  1481.     wgui_EMS_inputbox_frame_counter = 0;
  1482. #endif 
  1483.     h = set_EMS_inputbox_category_history(MMI_CATEGORY29_ID, history_buffer, (S16*) & input_type);
  1484.     gui_create_EMS_input_box(
  1485.         &MMI_EMS_inputbox,
  1486.         0,
  1487.         (MMI_title_y + MMI_title_height),
  1488.         MMI_content_width,
  1489.         MMI_content_height + 2);
  1490.     MMI_EMS_inputbox.flags |= UI_EMS_INPUT_BOX_VIEW_MODE;
  1491.     if (!h)
  1492.     {
  1493.         gui_set_EMS_input_box_data(&MMI_EMS_inputbox, data);
  1494.         ResetCurrentPosition(MMI_EMS_inputbox.data);
  1495.     }
  1496.     register_EMS_inputbox_viewer_keys();
  1497. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1498.     ExitCategoryFunction = ExitCategory29Screen;
  1499.     dm_setup_category_functions(dm_redraw_category_screen, GetCategory29History, GetCategory29HistorySize);
  1500.     dm_data.s32ScrId = (S32) GetActiveScreenId();
  1501.     dm_data.s32CatId = MMI_CATEGORY29_ID;
  1502.     dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
  1503.     dm_setup_data(&dm_data);
  1504.     dm_redraw_category_screen();
  1505. }
  1506. /*****************************************************************************
  1507.  * FUNCTION
  1508.  *  CloseCategory29Screen
  1509.  * DESCRIPTION
  1510.  *  Releases data used by the MT EMS/SMS screen
  1511.  * PARAMETERS
  1512.  *  void
  1513.  * RETURNS
  1514.  *  void
  1515.  *****************************************************************************/
  1516. void CloseCategory29Screen(void)
  1517. {
  1518. #if(UI_DISABLE_EMS_INPUT_BOX)
  1519.     /*----------------------------------------------------------------*/
  1520.     /* Local Variables                                                */
  1521.     /*----------------------------------------------------------------*/
  1522.     S32 length;
  1523.     S32 i, j;
  1524.     U8 *buffer;
  1525.     /*----------------------------------------------------------------*/
  1526.     /* Code Body                                                      */
  1527.     /*----------------------------------------------------------------*/
  1528.     length = MMI_multiline_inputbox.text_length;
  1529.     buffer = (U8*) gui_malloc((length << 1) + 2);
  1530.     i = j = 0;
  1531.     ResetCurrentPosition(temp_EMS_data);
  1532.     while (i < length)
  1533.     {
  1534.         buffer[j++] = 0;
  1535.         buffer[j++] = (U8) temp_EMS_buffer[i++];
  1536.     }
  1537.     buffer[j++] = 0;
  1538.     buffer[j++] = '';
  1539.     AddString(temp_EMS_data, buffer, (U16) length, NULL);
  1540.     gui_free(buffer);
  1541.     gui_free(temp_EMS_buffer);
  1542. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1543. }
  1544. /*****************************************************************************
  1545.  * FUNCTION
  1546.  *  ExitCategory29Screen
  1547.  * DESCRIPTION
  1548.  *  Exits the MT EMS/SMS screen
  1549.  * PARAMETERS
  1550.  *  void
  1551.  * RETURNS
  1552.  *  void
  1553.  *****************************************************************************/
  1554. void ExitCategory29Screen(void)
  1555. {
  1556.     /*----------------------------------------------------------------*/
  1557.     /* Local Variables                                                */
  1558.     /*----------------------------------------------------------------*/
  1559.     /*----------------------------------------------------------------*/
  1560.     /* Code Body                                                      */
  1561.     /*----------------------------------------------------------------*/
  1562. #if(!UI_DISABLE_EMS_INPUT_BOX)
  1563.     reset_EMS_inputbox();
  1564. #endif 
  1565. #ifdef __MMI_MESSAGES_EMS__
  1566.     close_EMS_objects();
  1567. #endif 
  1568.     ExitCategoryFunction = MMI_dummy_function;
  1569.     RedrawCategoryFunction = MMI_dummy_function;
  1570.     GetCategoryHistory = dummy_get_history;
  1571.     GetCategoryHistorySize = dummy_get_history_size;
  1572. }
  1573. /*****************************************************************************
  1574.  * FUNCTION
  1575.  *  GetCategory29HistorySize
  1576.  * DESCRIPTION
  1577.  *  Gets the history buffer size for the MT EMS/SMS screen
  1578.  * PARAMETERS
  1579.  *  void
  1580.  * RETURNS
  1581.  *  size in U8s of the history buffer
  1582.  *****************************************************************************/
  1583. S32 GetCategory29HistorySize(void)
  1584. {
  1585. #if(UI_DISABLE_EMS_INPUT_BOX)
  1586.     /*----------------------------------------------------------------*/
  1587.     /* Local Variables                                                */
  1588.     /*----------------------------------------------------------------*/
  1589.     /*----------------------------------------------------------------*/
  1590.     /* Code Body                                                      */
  1591.     /*----------------------------------------------------------------*/
  1592.     return (0);
  1593. #else /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1594.     return (sizeof(EMS_inputbox_category_history));
  1595. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1596. }
  1597. /*****************************************************************************
  1598.  * FUNCTION
  1599.  *  GetCategory29History
  1600.  * DESCRIPTION
  1601.  *  Gets the history buffer for the MT EMS/SMS screen
  1602.  * PARAMETERS
  1603.  *  history_buffer      [IN]        Is the buffer into which the history data is stored (pre-allocated)
  1604.  * RETURNS
  1605.  *  pointer to the history buffer
  1606.  *****************************************************************************/
  1607. U8 *GetCategory29History(U8 *history_buffer)
  1608. {
  1609. #if(UI_DISABLE_EMS_INPUT_BOX)
  1610.     /*----------------------------------------------------------------*/
  1611.     /* Local Variables                                                */
  1612.     /*----------------------------------------------------------------*/
  1613.     /*----------------------------------------------------------------*/
  1614.     /* Code Body                                                      */
  1615.     /*----------------------------------------------------------------*/
  1616.     return (history_buffer);
  1617. #else /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1618.     get_EMS_inputbox_category_history(MMI_CATEGORY28_ID, history_buffer, MMI_current_input_type);
  1619.     return (history_buffer);
  1620. #endif /* (UI_DISABLE_EMS_INPUT_BOX) */ 
  1621. }
  1622. #endif /* (ENABLE_EMS_TEST_DEMO) */ 
  1623. /* If EMS_VIEWER_HEADER_HEIGHT_AUTO is 1, then EMS_VIEWER_HEADER_HEIGHT defines
  1624.    the maximum possible height for the header. Otherwise, it defines the fixed
  1625.    height of the header */
  1626. #define EMS_VIEWER_HEADER_HEIGHT          48
  1627. #define EMS_VIEWER_HEADER_HEIGHT_AUTO        1
  1628. /* If 1, uses multiline input box to display the header (word wrapping, no truncation),
  1629.    else uses normal text output (no word wrapping, truncation for lines longer than screen width)     */
  1630. #define EMS_VIEWER_HEADER_MULTILINE_INPUTBOX 0
  1631. UI_filled_area EMS_viewer_header_background_filler = {UI_FILLED_AREA_TYPE_COLOR,
  1632.     UI_NULL_IMAGE,
  1633.     NULL,
  1634.     {180, 220, 220, 100},
  1635.     {0, 0, 0, 0},
  1636.     {0, 0, 0, 0},
  1637.     {0, 0, 0, 0},
  1638.     0
  1639. };
  1640. #if(EMS_VIEWER_HEADER_MULTILINE_INPUTBOX)
  1641. multi_line_input_box EMS_viewer_header_inputbox;
  1642. UI_multi_line_input_box_theme EMS_viewer_header_theme = { &EMS_viewer_header_background_filler,
  1643.     &EMS_viewer_header_background_filler,
  1644.     &EMS_viewer_header_background_filler,
  1645.     {0, 0, 0, 100},
  1646.     {0, 0, 0, 100},
  1647.     {128, 128, 128, 100},
  1648.     {0, 0, 0, 100},
  1649.     {255, 255, 255, 100},
  1650.     {51, 88, 171, 100},
  1651.     {255, 0, 0, 100},
  1652.     &MMI_default_font,
  1653.     1,
  1654.     0,
  1655.     '*',
  1656.     1
  1657. };
  1658. /* EMS header implementation using multi-line input box  */
  1659. /*****************************************************************************
  1660.  * FUNCTION
  1661.  *  create_EMS_viewer_header
  1662.  * DESCRIPTION
  1663.  *  
  1664.  * PARAMETERS
  1665.  *  message     [?]     
  1666.  * RETURNS
  1667.  *  void
  1668.  *****************************************************************************/
  1669. void create_EMS_viewer_header(U8 *message)
  1670. {
  1671.     /*----------------------------------------------------------------*/
  1672.     /* Local Variables                                                */
  1673.     /*----------------------------------------------------------------*/
  1674.     S32 l, ll;
  1675. #if(EMS_VIEWER_HEADER_HEIGHT_AUTO)
  1676.     S32 fh, n_lines, h;
  1677. #endif 
  1678.     /*----------------------------------------------------------------*/
  1679.     /* Code Body                                                      */
  1680.     /*----------------------------------------------------------------*/
  1681.     l = gui_strlen((UI_string_type) message);
  1682.     ll = (l + 1) * ENCODING_LENGTH;
  1683.     gui_create_multi_line_input_box_set_buffer(
  1684.         &EMS_viewer_header_inputbox,
  1685.         0,
  1686.         0,
  1687.         MMI_EMS_inputbox.width - MMI_EMS_inputbox.vbar.width,
  1688.         EMS_VIEWER_HEADER_HEIGHT,
  1689.         (UI_string_type) message,
  1690.         ll,
  1691.         ll,
  1692.         0);
  1693.     gui_set_multi_line_input_box_theme(&EMS_viewer_header_inputbox, &EMS_viewer_header_theme);
  1694.     EMS_viewer_header_inputbox.flags |=
  1695.         (UI_MULTI_LINE_INPUT_BOX_USE_PRESET_CLIPPING | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR |
  1696.          UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW);
  1697. #if(EMS_VIEWER_HEADER_HEIGHT_AUTO)
  1698.     gui_set_font(EMS_viewer_header_inputbox.text_font);
  1699.     fh = gui_get_character_height();
  1700.     EMS_viewer_header_inputbox.flags |= UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
  1701.     gui_show_multi_line_input_box(&EMS_viewer_header_inputbox);
  1702.     EMS_viewer_header_inputbox.flags &= ~UI_MULTI_LINE_INPUT_BOX_DISABLE_DRAW;
  1703.     n_lines = EMS_viewer_header_inputbox.n_lines;
  1704.     if (n_lines > 3)
  1705.     {
  1706.         n_lines = 3;
  1707.     }
  1708.     h = n_lines * fh + 6;
  1709.     if (h > EMS_VIEWER_HEADER_HEIGHT)
  1710.     {
  1711.         h = EMS_VIEWER_HEADER_HEIGHT;
  1712.     }
  1713.     gui_resize_multi_line_input_box(&EMS_viewer_header_inputbox, EMS_viewer_header_inputbox.width, h);
  1714. #endif /* (EMS_VIEWER_HEADER_HEIGHT_AUTO) */ 
  1715. }
  1716. /*****************************************************************************
  1717.  * FUNCTION
  1718.  *  EMS_viewer_show_header
  1719.  * DESCRIPTION
  1720.  *  
  1721.  * PARAMETERS
  1722.  *  x1      [IN]        
  1723.  *  y1      [IN]        
  1724.  *  x2      [IN]        
  1725.  *  y2      [IN]        
  1726.  * RETURNS
  1727.  *  void
  1728.  *****************************************************************************/
  1729. void EMS_viewer_show_header(S32 x1, S32 y1, S32 x2, S32 y2)
  1730. {
  1731.     /*----------------------------------------------------------------*/
  1732.     /* Local Variables                                                */
  1733.     /*----------------------------------------------------------------*/
  1734.     S32 ex1, ey1, ex2, ey2;
  1735.     /*----------------------------------------------------------------*/
  1736.     /* Code Body                                                      */
  1737.     /*----------------------------------------------------------------*/
  1738.     ex1 = MMI_EMS_inputbox.x + 1;
  1739.     ex2 = ex1 + MMI_EMS_inputbox.width - 2;
  1740.     ey1 = MMI_EMS_inputbox.y + 1;
  1741.     ey2 = ey1 + MMI_EMS_inputbox.height - 2;
  1742.     gui_set_text_clip(ex1, ey1, ex2, ey2);
  1743.     gui_set_clip(ex1, ey1, ex2, ey2);
  1744.     gui_move_multi_line_input_box(&EMS_viewer_header_inputbox, x1, y1);
  1745.     gui_show_multi_line_input_box(&EMS_viewer_header_inputbox);
  1746. }
  1747. /*****************************************************************************
  1748.  * FUNCTION
  1749.  *  EMS_viewer_measure_header
  1750.  * DESCRIPTION
  1751.  *  
  1752.  * PARAMETERS
  1753.  *  void
  1754.  * RETURNS
  1755.  *  
  1756.  *****************************************************************************/
  1757. S32 EMS_viewer_measure_header(void)
  1758. {
  1759.     /*----------------------------------------------------------------*/
  1760.     /* Local Variables                                                */
  1761.     /*----------------------------------------------------------------*/
  1762.     /*----------------------------------------------------------------*/
  1763.     /* Code Body                                                      */
  1764.     /*----------------------------------------------------------------*/
  1765.     return (EMS_viewer_header_inputbox.height);
  1766. }
  1767. #else /* (EMS_VIEWER_HEADER_MULTILINE_INPUTBOX) */ 
  1768. /* EMS header implementation using normal text output          */
  1769. /* Requires message to contain line breaks where ever necessary   */
  1770. #define EMS_VIEWER_HEADER_MAX_LINES          4
  1771. #define EMS_VIEWER_HEADER_MAX_LINE_LENGTH    32*ENCODING_LENGTH
  1772. U8 EMS_header_text_strings[EMS_VIEWER_HEADER_MAX_LINES][EMS_VIEWER_HEADER_MAX_LINE_LENGTH];
  1773. S32 EMS_header_text_string_heights[EMS_VIEWER_HEADER_MAX_LINES];
  1774. S32 EMS_header_height = 0;
  1775. S32 EMS_header_n_lines = 0;
  1776. #if(0)
  1777. /* Assumes the following format:
  1778. <line1>n
  1779. <line2>n
  1780. ....
  1781. Long lines are truncated by ... */
  1782. void create_EMS_viewer_header(U8* message)
  1783. { byte done=0;
  1784. byte inner_done;
  1785. S32 i,j;
  1786. UI_buffer_type text=message;
  1787. UI_buffer_type out_text;
  1788. S32 sw,sh;
  1789. UI_character_type c;
  1790. pixtel_UI_set_font(&MMI_default_font);
  1791. EMS_header_n_lines=0;
  1792. EMS_header_height=0;
  1793. i=0;
  1794. while(!done)
  1795. { if(EMS_header_n_lines>=EMS_VIEWER_HEADER_MAX_LINES) break;
  1796. inner_done=0;
  1797. j=0;
  1798. out_text=(UI_buffer_type)EMS_header_text_strings[EMS_header_n_lines];
  1799. EMS_header_text_strings[EMS_header_n_lines][0]='';
  1800. EMS_header_text_strings[EMS_header_n_lines][1]=0;
  1801. while(!inner_done)
  1802. { if(j>=(EMS_VIEWER_HEADER_MAX_LINE_LENGTH-ENCODING_LENGTH)) break;
  1803. UI_STRING_GET_NEXT_CHARACTER(text,c);
  1804. if(UI_STRING_LINE_BREAK_CHARACTER(c))
  1805. { inner_done=1;
  1806. break;
  1807. }
  1808. if(UI_STRING_END_OF_STRING_CHARACTER(c))
  1809. { inner_done=1;
  1810. done=1;
  1811. break;
  1812. }
  1813. UI_STRING_INSERT_CHARACTER(out_text,c);
  1814. j+=ENCODING_LENGTH;
  1815. }
  1816. UI_STRING_INSERT_CHARACTER(out_text,'');
  1817. while(!inner_done)
  1818. { UI_STRING_GET_NEXT_CHARACTER(text,c);
  1819. if(UI_STRING_LINE_BREAK_CHARACTER(c))
  1820. { inner_done=1;
  1821. break;
  1822. }
  1823. if(UI_STRING_END_OF_STRING_CHARACTER(c))
  1824. { inner_done=1;
  1825. done=1;
  1826. break;
  1827. }
  1828. }
  1829. pixtel_UI_measure_string((UI_string_type)EMS_header_text_strings[EMS_header_n_lines],&sw,&sh);
  1830. sh+=1;
  1831. EMS_header_text_string_heights[EMS_header_n_lines]=sh;
  1832. EMS_header_height+=sh;
  1833. EMS_header_n_lines++;
  1834. }
  1835. if(EMS_header_height>0) EMS_header_height+=2;
  1836. }
  1837. #else /* (0) */ 
  1838. /* Returns true when end of string is reached   */
  1839. /* loads n delimited strings             */
  1840. /*****************************************************************************
  1841.  * FUNCTION
  1842.  *  load_EMS_viewer_header_string
  1843.  * DESCRIPTION
  1844.  *  
  1845.  * PARAMETERS
  1846.  *  src                 [IN]        
  1847.  *  dst                 [IN]        
  1848.  *  max_dst_length      [IN]        
  1849.  * RETURNS
  1850.  *  
  1851.  *****************************************************************************/
  1852. U8 load_EMS_viewer_header_string(U8 **src, U8 **dst, S32 max_dst_length)
  1853. {
  1854.     /*----------------------------------------------------------------*/
  1855.     /* Local Variables                                                */
  1856.     /*----------------------------------------------------------------*/
  1857.     UI_buffer_type text = *src;
  1858.     UI_buffer_type out_text = *dst;
  1859.     U8 inner_done = 0;
  1860.     S32 j = 0;
  1861.     U8 done = 0;
  1862.     UI_character_type c;
  1863.     /*----------------------------------------------------------------*/
  1864.     /* Code Body                                                      */
  1865.     /*----------------------------------------------------------------*/
  1866.     while (!inner_done)
  1867.     {
  1868.         if (j >= (max_dst_length - ENCODING_LENGTH))
  1869.         {
  1870.             break;
  1871.         }
  1872.         UI_STRING_GET_NEXT_CHARACTER(text, c);
  1873.         if (UI_STRING_LINE_BREAK_CHARACTER(c))
  1874.         {
  1875.             inner_done = 1;
  1876.             break;
  1877.         }
  1878.         if (UI_STRING_END_OF_STRING_CHARACTER(c))
  1879.         {
  1880.             inner_done = 1;
  1881.             done = 1;
  1882.             break;
  1883.         }
  1884.         UI_STRING_INSERT_CHARACTER(out_text, c);
  1885.         j += ENCODING_LENGTH;
  1886.     }
  1887.     UI_STRING_INSERT_CHARACTER(out_text, '');
  1888.     while (!inner_done)
  1889.     {
  1890.         UI_STRING_GET_NEXT_CHARACTER(text, c);
  1891.         if (UI_STRING_LINE_BREAK_CHARACTER(c))
  1892.         {
  1893.             inner_done = 1;
  1894.             break;
  1895.         }
  1896.         if (UI_STRING_END_OF_STRING_CHARACTER(c))
  1897.         {
  1898.             inner_done = 1;
  1899.             done = 1;
  1900.             break;
  1901.         }
  1902.     }
  1903.     *src = text;
  1904.     *dst = out_text;
  1905.     return (done);
  1906. }
  1907. #define UI_EMS_HEADER_NUMBER_OF_BREAK_CHARACTERS      (1)
  1908. UI_character_type EMS_header_break_characters[] = { ' '
  1909. };
  1910. #define UI_EMS_HEADER_BREAK_CHARACTER(c,flag)                                                   
  1911. {  S32 _ii_;                                                                                    
  1912.    flag=0;                                                                                      
  1913.    for(_ii_=0;_ii_<UI_EMS_HEADER_NUMBER_OF_BREAK_CHARACTERS;_ii_++)                             
  1914.    {  if((UI_character_type)c==(UI_character_type)EMS_header_break_characters[_ii_])            
  1915.       {  flag=1;                                                                                
  1916.          break;                                                                                 
  1917.       }                                                                                         
  1918.    }                                                                                            
  1919. }
  1920. /* Assumes the following format:
  1921.    From:n
  1922.    Name/numbern
  1923.    Daten
  1924.    Timen
  1925.    Attempts to combine first two lines */
  1926. /*****************************************************************************
  1927.  * FUNCTION
  1928.  *  create_EMS_viewer_header
  1929.  * DESCRIPTION
  1930.  *  
  1931.  * PARAMETERS
  1932.  *  message     [?]     
  1933.  * RETURNS
  1934.  *  void
  1935.  *****************************************************************************/
  1936. void create_EMS_viewer_header(U8 *message)
  1937. {
  1938.     /*----------------------------------------------------------------*/
  1939.     /* Local Variables                                                */
  1940.     /*----------------------------------------------------------------*/
  1941.     U8 done = 0;
  1942.     U8 inner_done;
  1943.     S32 j;
  1944.     UI_buffer_type text = message;
  1945.     UI_buffer_type out_text;
  1946.     S32 sw, sh, break_count;
  1947.     UI_character_type c;
  1948.     S32 l1_w, l1_h, l2_w, l2_h;
  1949.     U8 temp_string[EMS_VIEWER_HEADER_MAX_LINE_LENGTH];
  1950.     /* U8             space_string[]={' ',0,'',0};   */
  1951.     /* U8             blank_string[]={'',0};      */
  1952.     S32 character_width, character_height;
  1953.     S32 box_width = (MMI_EMS_inputbox.width - MMI_EMS_inputbox.vbar.width - 2);
  1954.     UI_buffer_type temp_text1, temp_text2;
  1955.     U8 break_flag;
  1956.     U16 from_len = 0;
  1957.     U16 name_number_len = 0;
  1958.     /*----------------------------------------------------------------*/
  1959.     /* Code Body                                                      */
  1960.     /*----------------------------------------------------------------*/
  1961.     gui_set_font(&MMI_default_font);
  1962.     EMS_header_n_lines = 0;
  1963.     EMS_header_height = 0;
  1964.     out_text = (UI_buffer_type) EMS_header_text_strings[EMS_header_n_lines];
  1965.     /* "From:"  */
  1966.     done = load_EMS_viewer_header_string(&text, &out_text, EMS_VIEWER_HEADER_MAX_LINE_LENGTH);
  1967.     gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], &l1_w, &l1_h);
  1968.     l1_h++;
  1969.     EMS_header_height += l1_h;
  1970.     EMS_header_text_string_heights[EMS_header_n_lines] = l1_h;
  1971.     from_len = pfnUnicodeStrlen((S8*) EMS_header_text_strings[EMS_header_n_lines]);
  1972.     /* "Name/number"  */
  1973.     if (!done)
  1974.     {
  1975.         out_text = (UI_buffer_type) temp_string;
  1976.         done = load_EMS_viewer_header_string(&text, &out_text, EMS_VIEWER_HEADER_MAX_LINE_LENGTH);
  1977.         gui_measure_string((UI_string_type) temp_string, &l2_w, &l2_h);
  1978.         name_number_len = pfnUnicodeStrlen((S8*) temp_string);
  1979.         if (((l1_w + l2_w) < box_width) &&
  1980.             ((from_len + name_number_len) < EMS_VIEWER_HEADER_MAX_LINE_LENGTH / ENCODING_LENGTH))
  1981.         {
  1982.             gui_strcat((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], (UI_string_type) temp_string);
  1983.             gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], &sw, &sh);
  1984.             sh++;
  1985.             EMS_header_height -= l1_h;
  1986.             EMS_header_height += sh;
  1987.             EMS_header_text_string_heights[EMS_header_n_lines] = sh;
  1988.             EMS_header_n_lines++;
  1989.         }
  1990.         else if ((l2_w <= box_width) && (name_number_len < EMS_VIEWER_HEADER_MAX_LINE_LENGTH / ENCODING_LENGTH))
  1991.         {
  1992.             EMS_header_n_lines++;
  1993.             gui_strcpy((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], (UI_string_type) temp_string);
  1994.             gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], &sw, &sh);
  1995.             sh++;
  1996.             EMS_header_height += sh;
  1997.             EMS_header_text_string_heights[EMS_header_n_lines] = sh;
  1998.             EMS_header_n_lines++;
  1999.         }
  2000.         else    /* break "Name/number" into two lines  */
  2001.         {
  2002.             out_text = (UI_buffer_type) temp_string;
  2003.             break_count = 0;
  2004.             inner_done = 0;
  2005.             sw = l1_w;
  2006.             j = 0;
  2007.             while (!inner_done)
  2008.             {
  2009.                 UI_STRING_GET_NEXT_CHARACTER(out_text, c);
  2010.                 if (UI_STRING_END_OF_STRING_CHARACTER(c))
  2011.                 {
  2012.                     break_count = j;
  2013.                     inner_done = 1;
  2014.                     done = 1;
  2015.                     break;
  2016.                 }
  2017.                 UI_EMS_HEADER_BREAK_CHARACTER(c, break_flag);
  2018.                 if (break_flag)
  2019.                 {
  2020.                     break_count = j + 1;
  2021.                 }
  2022.                 gui_measure_character(c, &character_width, &character_height);
  2023.                 character_width += 1;
  2024.                 if ((sw + character_width) > box_width)
  2025.                 {
  2026.                     inner_done = 1;
  2027.                     break;
  2028.                 }
  2029.                 sw += character_width;
  2030.                 j++;
  2031.             }
  2032.             if (break_count == 0)
  2033.             {
  2034.                 break_count = j;
  2035.             }
  2036.             temp_text1 = (UI_buffer_type) EMS_header_text_strings[EMS_header_n_lines + 1];
  2037.             temp_text2 = (UI_buffer_type) temp_string;
  2038.             for (j = 0; j < break_count; j++)
  2039.             {
  2040.                 UI_STRING_GET_NEXT_CHARACTER(temp_text2, c);
  2041.                 UI_STRING_INSERT_CHARACTER(temp_text1, c);
  2042.             }
  2043.             UI_STRING_INSERT_CHARACTER(temp_text1, '');
  2044.             gui_strcat(
  2045.                 (UI_string_type) EMS_header_text_strings[EMS_header_n_lines],
  2046.                 (UI_string_type) EMS_header_text_strings[EMS_header_n_lines + 1]);
  2047.             inner_done = 0;
  2048.             temp_text1 = (UI_buffer_type) EMS_header_text_strings[EMS_header_n_lines + 1];
  2049.             while (!inner_done)
  2050.             {
  2051.                 UI_STRING_GET_NEXT_CHARACTER(temp_text2, c);
  2052.                 if (UI_STRING_END_OF_STRING_CHARACTER(c))
  2053.                 {
  2054.                     inner_done = 1;
  2055.                     break;
  2056.                 }
  2057.                 if (UI_STRING_LINE_BREAK_CHARACTER(c))
  2058.                 {
  2059.                     inner_done = 1;
  2060.                     break;
  2061.                 }
  2062.                 UI_STRING_INSERT_CHARACTER(temp_text1, c);
  2063.             }
  2064.             UI_STRING_INSERT_CHARACTER(temp_text1, '');
  2065.             gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], &sw, &sh);
  2066.             sh++;
  2067.             EMS_header_text_string_heights[EMS_header_n_lines] = sh;
  2068.             EMS_header_height -= l1_h;
  2069.             EMS_header_height += sh;
  2070.             gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines + 1], &sw, &sh);
  2071.             sh++;
  2072.             EMS_header_text_string_heights[EMS_header_n_lines + 1] = sh;
  2073.             EMS_header_height += sh;
  2074.             EMS_header_n_lines += 2;
  2075.         }
  2076.     }
  2077.     else
  2078.     {
  2079.         EMS_header_n_lines++;
  2080.     }
  2081.     if (!done)
  2082.     {
  2083.         out_text = (UI_buffer_type) EMS_header_text_strings[EMS_header_n_lines];
  2084.         done = load_EMS_viewer_header_string(&text, &out_text, EMS_VIEWER_HEADER_MAX_LINE_LENGTH);
  2085.         gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], &sw, &sh);
  2086.         sh++;
  2087.         EMS_header_height += sh;
  2088.         EMS_header_text_string_heights[EMS_header_n_lines] = sh;
  2089.         EMS_header_n_lines++;
  2090.     }
  2091.     if (!done)
  2092.     {
  2093.         out_text = (UI_buffer_type) EMS_header_text_strings[EMS_header_n_lines];
  2094.         done = load_EMS_viewer_header_string(&text, &out_text, EMS_VIEWER_HEADER_MAX_LINE_LENGTH);
  2095.         gui_measure_string((UI_string_type) EMS_header_text_strings[EMS_header_n_lines], &sw, &sh);
  2096.         sh++;
  2097.         EMS_header_height += sh;
  2098.         EMS_header_text_string_heights[EMS_header_n_lines] = sh;
  2099.         EMS_header_n_lines++;
  2100.     }
  2101.     if (EMS_header_height > 0)
  2102.     {
  2103.         EMS_header_height += 2;
  2104.     }
  2105. }
  2106. #endif /* (0) */ 
  2107. /*****************************************************************************
  2108.  * FUNCTION
  2109.  *  EMS_viewer_show_header
  2110.  * DESCRIPTION
  2111.  *  
  2112.  * PARAMETERS
  2113.  *  x1      [IN]        
  2114.  *  y1      [IN]        
  2115.  *  x2      [IN]        
  2116.  *  y2      [IN]        
  2117.  * RETURNS
  2118.  *  void
  2119.  *****************************************************************************/
  2120. void EMS_viewer_show_header(S32 x1, S32 y1, S32 x2, S32 y2)
  2121. {
  2122.     /*----------------------------------------------------------------*/
  2123.     /* Local Variables                                                */
  2124.     /*----------------------------------------------------------------*/
  2125.     S32 ex1, ey1, ex2, ey2, x, y, xwidth, i;
  2126.     /*----------------------------------------------------------------*/
  2127.     /* Code Body                                                      */
  2128.     /*----------------------------------------------------------------*/
  2129.     if (EMS_header_height <= 0)
  2130.     {
  2131.         return;
  2132.     }
  2133.     ex1 = MMI_EMS_inputbox.x + 1;
  2134.     ex2 = ex1 + MMI_EMS_inputbox.width - 5;
  2135.     ey1 = MMI_EMS_inputbox.y + 1;
  2136.     ey2 = ey1 + MMI_EMS_inputbox.height - 2;
  2137.     gui_set_text_clip(ex1, ey1, ex2, ey2);
  2138.     gui_set_clip(ex1, ey1, ex2, ey2);
  2139.     gui_set_font(&MMI_default_font);
  2140.     gui_set_text_color(*current_MMI_theme->UI_black_color);
  2141.     gui_draw_filled_area(ex1, y1, ex2, y2, &EMS_viewer_header_background_filler);
  2142.     /* MTK Elvis for R2L characters */
  2143.     if (r2lMMIFlag)
  2144.     {
  2145.         x = UI_device_width - 3;
  2146.     }
  2147.     else
  2148.     {
  2149.         x = ex1 + 1;
  2150.     }
  2151.     /* MTK end */
  2152.     y = y1 + 2;
  2153.     xwidth = (ex2 - ex1 - 3);
  2154.     for (i = 0; i < EMS_header_n_lines; i++)
  2155.     {
  2156.         gui_print_truncated_text(x, y, xwidth, (UI_string_type) EMS_header_text_strings[i]);
  2157.         y += EMS_header_text_string_heights[i];
  2158.     }
  2159. }
  2160. /*****************************************************************************
  2161.  * FUNCTION
  2162.  *  EMS_viewer_measure_header
  2163.  * DESCRIPTION
  2164.  *  
  2165.  * PARAMETERS
  2166.  *  void
  2167.  * RETURNS
  2168.  *  
  2169.  *****************************************************************************/
  2170. S32 EMS_viewer_measure_header(void)
  2171. {
  2172.     /*----------------------------------------------------------------*/
  2173.     /* Local Variables                                                */
  2174.     /*----------------------------------------------------------------*/
  2175.     /*----------------------------------------------------------------*/
  2176.     /* Code Body                                                      */
  2177.     /*----------------------------------------------------------------*/
  2178.     return (EMS_header_height);
  2179. }
  2180. #endif /* (EMS_VIEWER_HEADER_MULTILINE_INPUTBOX) */ 
  2181. #if(ENABLE_EMS_TEST_DEMO)
  2182. #define EMS_TEST_DEMO_SCREEN_ID           (MAIN_MENU_BASE+80)
  2183. #define EMS_OBJECT_LIST_TEST_SCREEN_ID    (MAIN_MENU_BASE+81)
  2184. EMSData EMS_demo_EMS_data;
  2185. S32 EMS_demo_object_index;
  2186. S32 EMS_demo_n_objects;
  2187. void EMS_demo_exit_category28(void);
  2188. void EMS_demo_exit_category29(void);
  2189. void EMS_demo_exit_object_list(void);
  2190. void EMS_demo_enter_object_list(void);
  2191. void EMS_demo_exit_object_list2(void);
  2192. void EMS_demo_enter_object_list2(void);
  2193. /*****************************************************************************
  2194.  * FUNCTION
  2195.  *  EMS_demo_close_category28
  2196.  * DESCRIPTION
  2197.  *  
  2198.  * PARAMETERS
  2199.  *  void
  2200.  * RETURNS
  2201.  *  void
  2202.  *****************************************************************************/
  2203. void EMS_demo_close_category28(void)
  2204. {
  2205.     /*----------------------------------------------------------------*/
  2206.     /* Local Variables                                                */
  2207.     /*----------------------------------------------------------------*/
  2208.     /*----------------------------------------------------------------*/
  2209.     /* Code Body                                                      */
  2210.     /*----------------------------------------------------------------*/
  2211.     CloseCategory28Screen();
  2212.     GoBackHistory();
  2213. }
  2214. #define EMS_GSM_ASCII_TEST    0
  2215. #define EMS_OBJECT_VIEWER_TEST   0
  2216. /*****************************************************************************
  2217.  * FUNCTION
  2218.  *  EMS_demo_category28
  2219.  * DESCRIPTION
  2220.  *  
  2221.  * PARAMETERS
  2222.  *  void
  2223.  * RETURNS
  2224.  *  void
  2225.  *****************************************************************************/
  2226. void EMS_demo_category28(void)
  2227. {
  2228. #if(EMS_GSM_ASCII_TEST)
  2229.     /*----------------------------------------------------------------*/
  2230.     /* Local Variables                                                */
  2231.     /*----------------------------------------------------------------*/
  2232.     U8 s[2] = {0, 0};
  2233.     S32 i;
  2234. #endif /* (EMS_GSM_ASCII_TEST) */ 
  2235.     U8 *guiBuffer;
  2236.     /*----------------------------------------------------------------*/
  2237.     /* Code Body                                                      */
  2238.     /*----------------------------------------------------------------*/
  2239.     ExecuteCurrExitHandler();
  2240.     guiBuffer = GetCurrGuiBuffer(EMS_TEST_DEMO_SCREEN_ID);
  2241.     if (guiBuffer == NULL)
  2242.     {
  2243.         InitializeEMSData(&EMS_demo_EMS_data, SMSAL_DEFAULT_DCS);
  2244.     }
  2245. #if(EMS_GSM_ASCII_TEST)
  2246.     for (i = 0; i < 128; i++)
  2247.     {
  2248.         s[0] = (U8) i;
  2249.         AddString(&EMS_demo_EMS_data, s, 1, NULL);
  2250.     }
  2251.     ResetCurrentPosition(&EMS_demo_EMS_data);
  2252.     EMS_ConvertGSM7BitDefaultEncodingToAscii(&EMS_demo_EMS_data);
  2253.     EMS_ConvertAsciiEncodingToGSM7BitDefault(&EMS_demo_EMS_data);
  2254.     EMS_ConvertGSM7BitDefaultEncodingToAscii(&EMS_demo_EMS_data);
  2255. #endif /* (EMS_GSM_ASCII_TEST) */ 
  2256.     ShowCategory28Screen(0, 0, STR_GLOBAL_OK, 0, STR_GLOBAL_BACK, 0, &EMS_demo_EMS_data, guiBuffer);
  2257.     SetCategory28RightSoftkeyFunction(EMS_demo_close_category28, KEY_EVENT_UP);
  2258.     //      SetKeyHandler(EntryInputMethodScreen,KEY_STAR,KEY_EVENT_UP);
  2259.     //      RegisterInputMethodScreenCloseFunction(GoBackHistory);
  2260.     SetExitHandler(EMS_TEST_DEMO_SCREEN_ID, EMS_demo_exit_category28);
  2261. #if(EMS_OBJECT_VIEWER_TEST)
  2262.     SetLeftSoftkeyFunction(EMS_demo_enter_object_list2, KEY_EVENT_UP);
  2263. #endif 
  2264. }
  2265. /*****************************************************************************
  2266.  * FUNCTION
  2267.  *  EMS_demo_exit_category28
  2268.  * DESCRIPTION
  2269.  *  
  2270.  * PARAMETERS
  2271.  *  void
  2272.  * RETURNS
  2273.  *  void
  2274.  *****************************************************************************/
  2275. void EMS_demo_exit_category28(void)
  2276. {
  2277.     /*----------------------------------------------------------------*/
  2278.     /* Local Variables                                                */
  2279.     /*----------------------------------------------------------------*/
  2280.     history h;
  2281.     /*----------------------------------------------------------------*/
  2282.     /* Code Body                                                      */
  2283.     /*----------------------------------------------------------------*/
  2284.     h.scrnID = EMS_TEST_DEMO_SCREEN_ID;
  2285.     h.entryFuncPtr = EMS_demo_category28;
  2286.     GetCategoryHistory(h.guiBuffer);
  2287.     AddHistory(h);
  2288. }
  2289. #define EMS_DEMO_HIDE_PREDEFINED_OBJECTS  1
  2290. EMSObject *EMS_demo_object_list;
  2291. /*****************************************************************************
  2292.  * FUNCTION
  2293.  *  EMS_demo_enter_object_list
  2294.  * DESCRIPTION
  2295.  *  
  2296.  * PARAMETERS
  2297.  *  void
  2298.  * RETURNS
  2299.  *  void
  2300.  *****************************************************************************/
  2301. void EMS_demo_enter_object_list(void)
  2302. {
  2303.     /*----------------------------------------------------------------*/
  2304.     /* Local Variables                                                */
  2305.     /*----------------------------------------------------------------*/
  2306.     U8 *guiBuffer;
  2307.     /*----------------------------------------------------------------*/
  2308.     /* Code Body                                                      */
  2309.     /*----------------------------------------------------------------*/
  2310.     ExecuteCurrExitHandler();
  2311.     guiBuffer = GetCurrGuiBuffer(EMS_OBJECT_LIST_TEST_SCREEN_ID);
  2312.     EMS_demo_object_index = 0;
  2313.     EMS_demo_n_objects = 0;
  2314. #if(EMS_DEMO_HIDE_PREDEFINED_OBJECTS)
  2315.     CreateCategory143ObjectList(&EMS_demo_EMS_data, &EMS_demo_object_list);
  2316. #else 
  2317.     EMS_demo_object_list = EMS_demo_EMS_data.listHead;
  2318. #endif 
  2319.     ShowCategory143Screen(
  2320.         0,
  2321.         0,
  2322.         0,
  2323.         0,
  2324.         STR_GLOBAL_BACK,
  2325.         0,
  2326.         EMS_demo_object_list,
  2327.         &EMS_demo_n_objects,
  2328.         &EMS_demo_object_index,
  2329.         guiBuffer);
  2330.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2331.     SetExitHandler(EMS_OBJECT_LIST_TEST_SCREEN_ID, EMS_demo_exit_object_list);
  2332. }
  2333. /*****************************************************************************
  2334.  * FUNCTION
  2335.  *  EMS_demo_exit_object_list
  2336.  * DESCRIPTION
  2337.  *  
  2338.  * PARAMETERS
  2339.  *  void
  2340.  * RETURNS
  2341.  *  void
  2342.  *****************************************************************************/
  2343. void EMS_demo_exit_object_list(void)
  2344. {
  2345.     /*----------------------------------------------------------------*/
  2346.     /* Local Variables                                                */
  2347.     /*----------------------------------------------------------------*/
  2348.     history h;
  2349.     /*----------------------------------------------------------------*/
  2350.     /* Code Body                                                      */
  2351.     /*----------------------------------------------------------------*/
  2352. #if(EMS_DEMO_HIDE_PREDEFINED_OBJECTS)
  2353.     FreeCategory143ObjectList(&EMS_demo_object_list);
  2354. #endif 
  2355.     h.scrnID = EMS_OBJECT_LIST_TEST_SCREEN_ID;
  2356.     h.entryFuncPtr = EMS_demo_enter_object_list;
  2357.     GetCategoryHistory(h.guiBuffer);
  2358.     AddHistory(h);
  2359. }
  2360. U16 EMS_demo_object_list2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, };
  2361. U8 *EMS_demo_object_list3[10];
  2362. /*****************************************************************************
  2363.  * FUNCTION
  2364.  *  EMS_demo_object_list2_loader
  2365.  * DESCRIPTION
  2366.  *  
  2367.  * PARAMETERS
  2368.  *  index       [IN]        
  2369.  * RETURNS
  2370.  *  
  2371.  *****************************************************************************/
  2372. U8 *EMS_demo_object_list2_loader(S32 index)
  2373. {
  2374.     /*----------------------------------------------------------------*/
  2375.     /* Local Variables                                                */
  2376.     /*----------------------------------------------------------------*/
  2377.     /*----------------------------------------------------------------*/
  2378.     /* Code Body                                                      */
  2379.     /*----------------------------------------------------------------*/
  2380.     return (EMS_predefined_pictures[index]);
  2381. }
  2382. /*****************************************************************************
  2383.  * FUNCTION
  2384.  *  EMS_demo_enter_object_list2
  2385.  * DESCRIPTION
  2386.  *  
  2387.  * PARAMETERS
  2388.  *  void
  2389.  * RETURNS
  2390.  *  void
  2391.  *****************************************************************************/
  2392. void EMS_demo_enter_object_list2(void)
  2393. {
  2394.     /*----------------------------------------------------------------*/
  2395.     /* Local Variables                                                */
  2396.     /*----------------------------------------------------------------*/
  2397.     U8 *guiBuffer;
  2398.     /*----------------------------------------------------------------*/
  2399.     /* Code Body                                                      */
  2400.     /*----------------------------------------------------------------*/
  2401.     ExecuteCurrExitHandler();
  2402.     guiBuffer = GetCurrGuiBuffer(EMS_OBJECT_LIST_TEST_SCREEN_ID);
  2403.     EMS_demo_object_index = 0;
  2404.     EMS_demo_n_objects = 10;
  2405.     RegisterCategory144ObjectLoader(EMS_demo_object_list2_loader);
  2406.     ShowCategory144Screen(
  2407.         0,
  2408.         0,
  2409.         STR_GLOBAL_OK,
  2410.         0,
  2411.         STR_GLOBAL_BACK,
  2412.         0,
  2413.         /* EMS_PREDEFINED_PICTURE */ 0,
  2414.         EMS_demo_n_objects,
  2415.         NULL,
  2416.         EMS_demo_object_list2,
  2417.         EMS_demo_object_list3,
  2418.         &EMS_demo_object_index,
  2419.         guiBuffer);
  2420.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2421.     SetExitHandler(EMS_OBJECT_LIST_TEST_SCREEN_ID, EMS_demo_exit_object_list2);
  2422. }
  2423. /*****************************************************************************
  2424.  * FUNCTION
  2425.  *  EMS_demo_exit_object_list2
  2426.  * DESCRIPTION
  2427.  *  
  2428.  * PARAMETERS
  2429.  *  void
  2430.  * RETURNS
  2431.  *  void
  2432.  *****************************************************************************/
  2433. void EMS_demo_exit_object_list2(void)
  2434. {
  2435.     /*----------------------------------------------------------------*/
  2436.     /* Local Variables                                                */
  2437.     /*----------------------------------------------------------------*/
  2438.     history h;
  2439.     /*----------------------------------------------------------------*/
  2440.     /* Code Body                                                      */
  2441.     /*----------------------------------------------------------------*/
  2442.     h.scrnID = EMS_OBJECT_LIST_TEST_SCREEN_ID;
  2443.     h.entryFuncPtr = EMS_demo_enter_object_list2;
  2444.     GetCategoryHistory(h.guiBuffer);
  2445.     AddHistory(h);
  2446. }
  2447. /* Cat29 Demo Entry and Exit functions */
  2448. S8 EMS_demo_test_string[] = 
  2449. {
  2450.     'S', 0, 'a', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0, ' ', 0, 'S', 0, 'M', 0, 'S', 0, ' ', 0, 't', 0, 'e', 0, 's', 0, 't',
  2451.         0, ' ', 0, 'm', 0, 'e', 0, 's', 0, 's', 0, 'a', 0, 'g', 0, 'e', 0, '.', 0, ' ', 0, '1', 0, '2', 0, '3', 0, '4',
  2452.         0, ' ', 0, '5', 0, '6', 0, '7', 0, '8', 0, ' ', 0, '9', 0, '0', 0, '1', 0, '2', 0, ' ', 0, 'A', 0, 'B', 0, 'C',
  2453.         0, 'D', 0, ' ', 0, 'e', 0, 'f', 0, 'g', 0, 'h', 0, ' ', 0, 'I', 0, 'J', 0, 'K', 0, 'L', 0, ' ', 0, 'm', 0, 'n',
  2454.         0, 'o', 0, 'p', 0, ' ', 0, 'Q', 0, 'R', 0, 'S', 0, 'T', 0, ' ', 0, 'u', 0, 'v', 0, 'w', 0, 'x', 0, ' ', 0, 'Y',
  2455.         0, 'Z', 0, '', 0
  2456. };
  2457. /*****************************************************************************
  2458.  * FUNCTION
  2459.  *  EMS_demo_close_category29
  2460.  * DESCRIPTION
  2461.  *  
  2462.  * PARAMETERS
  2463.  *  void
  2464.  * RETURNS
  2465.  *  void
  2466.  *****************************************************************************/
  2467. void EMS_demo_close_category29(void)
  2468. {
  2469.     /*----------------------------------------------------------------*/
  2470.     /* Local Variables                                                */
  2471.     /*----------------------------------------------------------------*/
  2472.     /*----------------------------------------------------------------*/
  2473.     /* Code Body                                                      */
  2474.     /*----------------------------------------------------------------*/
  2475.     CloseCategory29Screen();
  2476.     GoBackHistory();
  2477. }
  2478. /*****************************************************************************
  2479.  * FUNCTION
  2480.  *  EMS_demo_category29
  2481.  * DESCRIPTION
  2482.  *  
  2483.  * PARAMETERS
  2484.  *  void
  2485.  * RETURNS
  2486.  *  void
  2487.  *****************************************************************************/
  2488. void EMS_demo_category29(void)
  2489. {
  2490.     /*----------------------------------------------------------------*/
  2491.     /* Local Variables                                                */
  2492.     /*----------------------------------------------------------------*/
  2493.     U8 *guiBuffer;
  2494.     /*----------------------------------------------------------------*/
  2495.     /* Code Body                                                      */
  2496.     /*----------------------------------------------------------------*/
  2497.     ExecuteCurrExitHandler();
  2498.     guiBuffer = GetCurrGuiBuffer(EMS_TEST_DEMO_SCREEN_ID);
  2499.     InitializeEMSData(&EMS_demo_EMS_data, SMSAL_DEFAULT_DCS);
  2500.     AddString(&EMS_demo_EMS_data, (U8*) EMS_demo_test_string, sizeof(EMS_demo_test_string) / 2, NULL);
  2501.     ShowCategory29Screen(0, 0, 0, 0, STR_GLOBAL_BACK, 0, &EMS_demo_EMS_data, guiBuffer);
  2502.     SetRightSoftkeyFunction(EMS_demo_close_category29, KEY_EVENT_UP);
  2503.     SetExitHandler(EMS_TEST_DEMO_SCREEN_ID, EMS_demo_exit_category29);
  2504. }
  2505. /*****************************************************************************
  2506.  * FUNCTION
  2507.  *  EMS_demo_exit_category29
  2508.  * DESCRIPTION
  2509.  *  
  2510.  * PARAMETERS
  2511.  *  void
  2512.  * RETURNS
  2513.  *  void
  2514.  *****************************************************************************/
  2515. void EMS_demo_exit_category29(void)
  2516. {
  2517.     /*----------------------------------------------------------------*/
  2518.     /* Local Variables                                                */
  2519.     /*----------------------------------------------------------------*/
  2520.     history h;
  2521.     /*----------------------------------------------------------------*/
  2522.     /* Code Body                                                      */
  2523.     /*----------------------------------------------------------------*/
  2524.     h.scrnID = EMS_TEST_DEMO_SCREEN_ID;
  2525.     h.entryFuncPtr = EMS_demo_category29;
  2526.     h.inputBuffer[0] = '';
  2527.     GetCategoryHistory(h.guiBuffer);
  2528.     AddHistory(h);
  2529. }
  2530. S8 EMS_demo_header_string[] =
  2531.     { 'S', 0, 'a', 0, 'm', 0, 'p', 0, 'l', 0, 'e', 0, ' ', 0, 'h', 0, 'e', 0, 'a', 0, 'd', 0, 'e', 0, 'r', 0, 'n', 0,
  2532. 'm', 0, 'e', 0, 's', 0, 's', 0, 'a', 0, 'g', 0, 'e', 0, ' ', 0, 's', 0, 't', 0, 'r', 0, 'i', 0, 'n', 0, 'g', 0, 'n', 0, '1', 0, '2', 0,
  2533. '3', 0, '4', 0, '5', 0, '6', 0, '', 0
  2534. };
  2535. S8 EMS_demo_header_ASCII_string[] = "From: nABCDE FGHIJKLMNOPn03/04/2003n08:24:35n";
  2536. U8 EMS_demo_header_temp_string[1024];
  2537. void EMS_demo_exit_category39(void);
  2538. /*****************************************************************************
  2539.  * FUNCTION
  2540.  *  EMS_demo_close_category39
  2541.  * DESCRIPTION
  2542.  *  
  2543.  * PARAMETERS
  2544.  *  void
  2545.  * RETURNS
  2546.  *  void
  2547.  *****************************************************************************/
  2548. void EMS_demo_close_category39(void)
  2549. {
  2550.     /*----------------------------------------------------------------*/
  2551.     /* Local Variables                                                */
  2552.     /*----------------------------------------------------------------*/
  2553.     /*----------------------------------------------------------------*/
  2554.     /* Code Body                                                      */
  2555.     /*----------------------------------------------------------------*/
  2556.     CloseCategory39Screen();
  2557.     GoBackHistory();
  2558. }
  2559. /*****************************************************************************
  2560.  * FUNCTION
  2561.  *  EMS_demo_category39
  2562.  * DESCRIPTION
  2563.  *  
  2564.  * PARAMETERS
  2565.  *  void
  2566.  * RETURNS
  2567.  *  void
  2568.  *****************************************************************************/
  2569. void EMS_demo_category39(void)
  2570. {
  2571.     /*----------------------------------------------------------------*/
  2572.     /* Local Variables                                                */
  2573.     /*----------------------------------------------------------------*/
  2574.     U8 *guiBuffer;
  2575.     /*----------------------------------------------------------------*/
  2576.     /* Code Body                                                      */
  2577.     /*----------------------------------------------------------------*/
  2578.     ExecuteCurrExitHandler();
  2579.     guiBuffer = GetCurrGuiBuffer(EMS_TEST_DEMO_SCREEN_ID);
  2580.     InitializeEMSData(&EMS_demo_EMS_data, SMSAL_DEFAULT_DCS);
  2581.     AddString(&EMS_demo_EMS_data, (U8*) EMS_demo_test_string, sizeof(EMS_demo_test_string) / 2, NULL);
  2582.     AnsiiToUnicodeString(EMS_demo_header_temp_string, EMS_demo_header_ASCII_string);
  2583.     ShowCategory39Screen(0, 0, 0, 0, STR_GLOBAL_BACK, 0, &EMS_demo_EMS_data, EMS_demo_header_temp_string, guiBuffer);
  2584.     SetRightSoftkeyFunction(EMS_demo_close_category39, KEY_EVENT_UP);
  2585.     SetExitHandler(EMS_TEST_DEMO_SCREEN_ID, EMS_demo_exit_category39);
  2586. }
  2587. /*****************************************************************************
  2588.  * FUNCTION
  2589.  *  EMS_demo_exit_category39
  2590.  * DESCRIPTION
  2591.  *  
  2592.  * PARAMETERS
  2593.  *  void
  2594.  * RETURNS
  2595.  *  void
  2596.  *****************************************************************************/
  2597. void EMS_demo_exit_category39(void)
  2598. {
  2599.     /*----------------------------------------------------------------*/
  2600.     /* Local Variables                                                */
  2601.     /*----------------------------------------------------------------*/
  2602.     history h;
  2603.     /*----------------------------------------------------------------*/
  2604.     /* Code Body                                                      */
  2605.     /*----------------------------------------------------------------*/
  2606.     h.scrnID = EMS_TEST_DEMO_SCREEN_ID;
  2607.     h.entryFuncPtr = EMS_demo_category39;
  2608.     h.inputBuffer[0] = '';
  2609.     GetCategoryHistory(h.guiBuffer);
  2610.     AddHistory(h);
  2611. }
  2612. #endif /* (ENABLE_EMS_TEST_DEMO) */ 
  2613. #endif /* (!UI_DISABLE_EMS_CATEGORY_SCREENS) */ 
  2614. /*****************************************************************************
  2615.  * FUNCTION
  2616.  *  is_EMS_inputbox_in_view_mode
  2617.  * DESCRIPTION
  2618.  *  
  2619.  * PARAMETERS
  2620.  *  void
  2621.  * RETURNS
  2622.  *  
  2623.  *****************************************************************************/
  2624. MMI_BOOL is_EMS_inputbox_in_view_mode(void)
  2625. {
  2626.     /*----------------------------------------------------------------*/
  2627.     /* Local Variables                                                */
  2628.     /*----------------------------------------------------------------*/
  2629.     /*----------------------------------------------------------------*/
  2630.     /* Code Body                                                      */
  2631.     /*----------------------------------------------------------------*/
  2632.     if (MMI_EMS_inputbox.flags & UI_EMS_INPUT_BOX_VIEW_MODE)
  2633.     {
  2634.         return MMI_TRUE;
  2635.     }
  2636.     else
  2637.     {
  2638.         return MMI_FALSE;
  2639.     }
  2640. }
  2641. /*****************************************************************************
  2642.  * FUNCTION
  2643.  *  wgui_EMS_set_text_format
  2644.  * DESCRIPTION
  2645.  *  
  2646.  * PARAMETERS
  2647.  *  text_format     [IN]        
  2648.  * RETURNS
  2649.  *  void
  2650.  *****************************************************************************/
  2651. void wgui_EMS_set_text_format(EMSTextFormat text_format)
  2652. {
  2653.     /*----------------------------------------------------------------*/
  2654.     /* Local Variables                                                */
  2655.     /*----------------------------------------------------------------*/
  2656.     /*----------------------------------------------------------------*/
  2657.     /* Code Body                                                      */
  2658.     /*----------------------------------------------------------------*/
  2659.     wgui_EMS_text_format = text_format;
  2660. }