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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2002
  8. *
  9. *****************************************************************************/
  10. /*****************************************************************************
  11.  *
  12.  * Filename:
  13.  * ---------
  14.  * MMITask.C
  15.  *
  16.  * Project:
  17.  * --------
  18.  *   MAUI
  19.  *
  20.  * Description:
  21.  * ------------
  22.  *   This file is intends for datetime screen control.
  23.  *
  24.  * Author:
  25.  * -------
  26.  * -------
  27.  *
  28.  *============================================================================
  29.  *             HISTORY
  30.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  31.  *------------------------------------------------------------------------------
  32.  * removed!
  33.  *
  34.  * removed!
  35.  * removed!
  36.  * removed!
  37.  *
  38.  * removed!
  39.  * removed!
  40.  * removed!
  41.  *
  42.  * removed!
  43.  * removed!
  44.  * removed!
  45.  *
  46.  * removed!
  47.  * removed!
  48.  * removed!
  49.  *
  50.  * removed!
  51.  * removed!
  52.  * removed!
  53.  *
  54.  * removed!
  55.  * removed!
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  * removed!
  91.  * removed!
  92.  * removed!
  93.  *
  94.  * removed!
  95.  * removed!
  96.  * removed!
  97.  *
  98.  * removed!
  99.  * removed!
  100.  * removed!
  101.  *
  102.  * removed!
  103.  * removed!
  104.  * removed!
  105.  *
  106.  * removed!
  107.  * removed!
  108.  * removed!
  109.  *
  110.  * removed!
  111.  * removed!
  112.  * removed!
  113.  *
  114.  * removed!
  115.  * removed!
  116.  * removed!
  117.  *
  118.  * removed!
  119.  * removed!
  120.  * removed!
  121.  *
  122.  * removed!
  123.  * removed!
  124.  * removed!
  125.  *
  126.  * removed!
  127.  * removed!
  128.  * removed!
  129.  *
  130.  * removed!
  131.  * removed!
  132.  * removed!
  133.  *
  134.  * removed!
  135.  * removed!
  136.  * removed!
  137.  *
  138.  * removed!
  139.  * removed!
  140.  * removed!
  141.  *
  142.  * removed!
  143.  * removed!
  144.  * removed!
  145.  *
  146.  * removed!
  147.  * removed!
  148.  * removed!
  149.  *
  150.  * removed!
  151.  * removed!
  152.  * removed!
  153.  *
  154.  * removed!
  155.  * removed!
  156.  * removed!
  157.  *
  158.  * removed!
  159.  * removed!
  160.  * removed!
  161.  *
  162.  * removed!
  163.  * removed!
  164.  * removed!
  165.  *
  166.  * removed!
  167.  * removed!
  168.  * removed!
  169.  *
  170.  *------------------------------------------------------------------------------
  171.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  172.  *============================================================================
  173.  ****************************************************************************/
  174. /**
  175.  * Copyright Notice
  176.  * (c) 2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  177.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  178.  *  (It is illegal to remove this copyright notice from this software or any
  179.  *  portion of it)
  180.  */
  181. /**********************************************************************************
  182.    Filename:      wgui_datetime.c
  183.    Author:        manju
  184.    Date Created:  August-07-2002
  185.    Contains:      PixTel UI wrapper routines for Date and Time input / display
  186. **********************************************************************************/
  187. #include "Globaldefs.h"
  188. /*  Include: MMI header file */
  189. #include "MMI_features.h"
  190. #include "stdC.h"
  191. #include "L4Dr1.h"
  192. #include "PixtelDataTypes.h"
  193. /* ... Add More MMI header */
  194. #include "DateTimeType.h"
  195. #include "L4Dr.h"
  196. #include "SettingGprots.h"
  197. #include "wgui_datetime.h"
  198. #include "gdi_include.h"
  199. #include "gui_themes.h"
  200. #include "DateTimeGprot.h"
  201. #include "wgui_fixed_menus.h"
  202. #include "wgui_fixed_menuitems.h"
  203. #include "ScreenSaverDefs.h"
  204. #include "CallManagementGprot.h"
  205. #include "wgui_categories_defs.h"
  206. #include "wgui_categories_CM.h"
  207. #include "BIDIDEF.h"
  208. #include "BIDIProt.h"
  209. #include "UCS2Prot.h"
  210. #include "MiscFunctions.h"
  211. #include "wgui_draw_manager.h"
  212. #include "DebugInitDef.h"
  213. #if ( defined(__MMI_TOUCH_IDLESCREEN_SHORTCUTS__) ||defined(__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__) || defined(__MMI_UI_STATUS_BAR_AT_BOTTOM__) )      //KP Jerry add "__MMI_TOUCH_IDLESCREEN_HW_SHORTCUTS__" on 2006-11-2
  214. #include "wgui_categories_idlescreen.h"
  215. #endif 
  216. #define DT_FLAGS_TYPE   (0x00000fff)
  217. #ifdef __MMI_SUBLCD__
  218. typedef enum
  219. {
  220.     /* Show date before time */
  221.     SUBLCD_DT_DATE_THEN_TIME_TYPE1,
  222.     /* Show time before date */
  223.     SUBLCD_DT_TIME_THEN_DATE_TYPE1,
  224.     SUBLCD_DT_TIME_THEN_DATE_TYPE2
  225. } SUBLCD_DATE_TIME_DISPLAY_TYPE;
  226. #endif /* __MMI_SUBLCD__ */ 
  227. /* MTK Elvis for R2L characters */
  228. #ifdef __MMI_BIDI_ALG__
  229. extern U8 visual_str[];
  230. #endif 
  231. extern BOOL r2lMMIFlag;
  232. /* MTK end */
  233. #ifdef __MMI_AUDIO_PLAYER__
  234. extern BOOL mmi_audply_is_playing(void);
  235. #endif 
  236. /* Date and Time input related objects    */
  237. /* Currently only input boxes are used    */
  238. extern void idle_screen_show_network_details(void);
  239. extern pBOOL IsChineseSet(void);
  240. #ifdef __MMI_SUBLCD__
  241. extern S32 Sub_lcd_title_height;
  242. #endif 
  243. #ifdef __MMI_SUB_WALLPAPER__
  244. extern GDI_HANDLE sublcd_base_layer;
  245. #endif 
  246. /* a single input box for day input */
  247. single_line_input_box wgui_date_input_day;
  248. /* a single input box for month  input */
  249. single_line_input_box wgui_date_input_month;
  250. /* a single input box for year  input */
  251. single_line_input_box wgui_date_input_year;
  252. /* a single input box for hours input */
  253. single_line_input_box wgui_time_input_hours;
  254. /* a single input box for minutes input */
  255. single_line_input_box wgui_time_input_minutes;
  256. /* a single input box for seconds input */
  257. single_line_input_box wgui_time_input_seconds;
  258. /* a single input box for am - pm input */
  259. single_line_input_box wgui_time_input_AM_PM;
  260. single_line_input_box *wgui_date_time_input_object_focus = NULL;
  261. U8 wgui_date_time_input_focus = WGUI_DATE_TIME_INPUT_FOCUS_NONE;
  262. /* store the position of day input previous focus */
  263. U8 wgui_day_input_previous_focus;
  264. /* store the position of day input next focus */
  265. U8 wgui_day_input_next_focus;
  266. /* store the position of month  input previous focus */
  267. U8 wgui_month_input_previous_focus;
  268. /* store the position of month  input next focus */
  269. U8 wgui_month_input_next_focus;
  270. /* store the position of year  input previous focus */
  271. U8 wgui_year_input_previous_focus;
  272. /* store the position of month  input previous focus */
  273. U8 wgui_year_input_next_focus;
  274. /* store the position of month  input previous focus */
  275. U8 wgui_hours_input_previous_focus;
  276. /* store the position of hours   input next focus */
  277. U8 wgui_hours_input_next_focus;
  278. /* store the position of minutes  input previous focus */
  279. U8 wgui_minutes_input_previous_focus;
  280. /* store the position of month  input next focus */
  281. U8 wgui_minutes_input_next_focus;
  282. /* store the position of seconds  input previous focus */
  283. U8 wgui_seconds_input_previous_focus;
  284. /* store the position of seconds   input next focus */
  285. U8 wgui_seconds_input_next_focus;
  286. /* store the position of AM - PM   input previous focus */
  287. U8 wgui_AM_PM_input_previous_focus;
  288. /* store the position of AM -= Pm   input next  focus */
  289. U8 wgui_AM_PM_input_next_focus;
  290. U8 wgui_seconds_input_enabled = 0;
  291. U8 wgui_AM_PM_input_enabled = 0;
  292. U8 wgui_date_input_enabled = 0;
  293. U8 wgui_time_input_enabled = 0;
  294. U8 show_date = 0;
  295. MMI_BOOL main_lcd_update_date_time = MMI_TRUE;
  296. #ifdef __MMI_SUBLCD__
  297. MMI_BOOL sub_lcd_update_date_time = MMI_TRUE;
  298. #endif 
  299. /* MTK Elvis for date boundary setting */
  300. S32 g_date_year_max = 2030, g_date_year_min = 1970, g_date_month_max = 12, g_date_month_min = 1;
  301. /* MTK end */
  302. /* global variable of main lcd date objet */
  303. UI_date_time_display main_LCD_dt_object;
  304. #ifdef __MMI_SUBLCD__
  305.    /* global variable of sublcd lcd date objet city 1 */
  306. UI_date_time_display sub_LCD_dt_object1;
  307.    /* global variable of sublcd lcd date objet city 2 */
  308. UI_date_time_display sub_LCD_dt_object2;
  309. SUBLCD_DATE_TIME_DISPLAY_TYPE sublcd_date_time_display_type;
  310. #endif /* __MMI_SUBLCD__ */ 
  311. /* PMT HIMANSHU START 20050721 */
  312. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  313. extern MMI_ID_TYPE idlescreen_bar_id;//070306 Alpha layer
  314. U8 g_clock_type = ANALOG;   /* default clock for Techno Idlescreen Bar */
  315. U16 *day_string = NULL; /* pointer storing the address of the MMI_ID_TYPE of day string. */
  316. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  317. /* PMT HIMANSHU END 20050721 */
  318. extern U16 GetTotalHoldCallCount(void);
  319. extern S16 GetTotalActiveCallCount(void);
  320. extern S32 UI_get_font_height(UI_font_type f);
  321. extern void CheckCtrExpiry(MYTIME *last_time, MYTIME *curr_time);
  322. extern MYTIME *GetStartCallTime(void);
  323. extern MYTIME *GetCurrStartCallTime(void);
  324. extern U8 PhnsetGetDateFormat(void);
  325. extern U8 PhnsetGetTimeFormat(void);
  326. extern UI_string_type UI_strcat(UI_string_type text1, UI_string_type text2);
  327. extern UI_string_type UI_strcpy(UI_string_type text1, UI_string_type text2);
  328. extern void (*gui_set_clip) (S32 x1, S32 y1, S32 x2, S32 y2);
  329. /* Externals for graphics context switching  */
  330. extern bitmap main_LCD_device_bitmap;           /* main lcd graphicd context */
  331. extern bitmap sub_LCD_device_bitmap;            /* sub lcd graphic context */
  332. void UI_set_main_LCD_graphics_context(void);    /* set main lcd graphic contrext */
  333. void UI_set_sub_LCD_graphics_context(void);     /* set sub lcd graphic cntext */
  334. extern bitmap *current_LCD_device_bitmap;       /* store current graphic context */
  335. #ifdef __MMI_SUBLCD__
  336. extern stFontAttribute MMI_sublcd_font;
  337. extern S32 SUB_LCD_device_width;
  338. extern void RedrawSubLCDAnalogClockScreen(void);
  339. #endif /* __MMI_SUBLCD__ */ 
  340. extern S32 ANALOG_CLOCK_DIAL_X;
  341. extern S32 ANALOG_CLOCK_DIAL_Y;
  342. /* MTK Tim */
  343. extern void kal_get_time(U32 *ticks_ptr);
  344. U32 last_duration_ticks;
  345. U32 last_duration;
  346. UI_time last_duration_time;
  347. /*----------------------------------------------------------------------------
  348. Function:         wgui_date_time_input_callback
  349. Description:      a function pointer store teh address of function
  350.                of date time input callback
  351. Input Parameters: none
  352. Output Parameters:   none
  353. Returns:       none
  354. ----------------------------------------------------------------------------*/
  355. void (*wgui_date_time_input_callback) (void);
  356. /* theme scheme of inline date time input box */
  357. UI_single_line_input_box_theme wgui_date_time_input_theme = { (UI_filled_area *)&MMI_formatted_inputbox_normal_filler,
  358.     (UI_filled_area *)&MMI_formatted_inputbox_disabled_filler,
  359.     (UI_filled_area *)&MMI_formatted_inputbox_selected_filler,
  360.     {0, 0, 0, 100},
  361.     {128, 128, 128, 100},
  362.     {0, 0, 0, 100},
  363.     {255, 255, 255, 100},
  364.     {51, 88, 171, 100},
  365.     {255, 0, 0, 100},
  366.     &UI_DEFAULT_FONT,
  367.     1,
  368.     UI_SINGLE_LINE_INPUT_BOX_CENTER_Y,
  369.     '*'
  370. };
  371. /*****************************************************************************
  372.  * FUNCTION
  373.  *  wgui_set_day_input_navigation
  374.  * DESCRIPTION
  375.  *  function set thevaleu of previous and next cursor focus
  376.  *  of day input single box
  377.  * PARAMETERS
  378.  *  previous_focus      [IN]        Previous cursor position
  379.  *  next_focus          [IN]        Next cursor position
  380.  * RETURNS
  381.  *  void
  382.  *****************************************************************************/
  383. void wgui_set_day_input_navigation(U8 previous_focus, U8 next_focus)
  384. {
  385.     /*----------------------------------------------------------------*/
  386.     /* Local Variables                                                */
  387.     /*----------------------------------------------------------------*/
  388.     /*----------------------------------------------------------------*/
  389.     /* Code Body                                                      */
  390.     /*----------------------------------------------------------------*/
  391.     wgui_day_input_previous_focus = previous_focus;
  392.     wgui_day_input_next_focus = next_focus;
  393. }
  394. /*****************************************************************************
  395.  * FUNCTION
  396.  *  wgui_set_month_input_navigation
  397.  * DESCRIPTION
  398.  *  function set thevaleu of previous and next cursor focus
  399.  *  of month input single box
  400.  * PARAMETERS
  401.  *  previous_focus      [IN]        Previous cursor position
  402.  *  next_focus          [IN]        Next cursor position
  403.  * RETURNS
  404.  *  void
  405.  *****************************************************************************/
  406. void wgui_set_month_input_navigation(U8 previous_focus, U8 next_focus)
  407. {
  408.     /*----------------------------------------------------------------*/
  409.     /* Local Variables                                                */
  410.     /*----------------------------------------------------------------*/
  411.     /*----------------------------------------------------------------*/
  412.     /* Code Body                                                      */
  413.     /*----------------------------------------------------------------*/
  414.     wgui_month_input_previous_focus = previous_focus;
  415.     wgui_month_input_next_focus = next_focus;
  416. }
  417. /*****************************************************************************
  418.  * FUNCTION
  419.  *  wgui_set_year_input_navigation
  420.  * DESCRIPTION
  421.  *  function set the valeu of previous and next cursor focus
  422.  *  of year input single box
  423.  * PARAMETERS
  424.  *  previous_focus      [IN]        Previous cursor position
  425.  *  next_focus          [IN]        Next cursor position
  426.  * RETURNS
  427.  *  void
  428.  *****************************************************************************/
  429. void wgui_set_year_input_navigation(U8 previous_focus, U8 next_focus)
  430. {
  431.     /*----------------------------------------------------------------*/
  432.     /* Local Variables                                                */
  433.     /*----------------------------------------------------------------*/
  434.     /*----------------------------------------------------------------*/
  435.     /* Code Body                                                      */
  436.     /*----------------------------------------------------------------*/
  437.     wgui_year_input_previous_focus = previous_focus;
  438.     wgui_year_input_next_focus = next_focus;
  439. }
  440. /*****************************************************************************
  441.  * FUNCTION
  442.  *  wgui_set_hours_input_navigation
  443.  * DESCRIPTION
  444.  *  function set the valeu of previous and next cursor focus
  445.  *  of hours input single box
  446.  * PARAMETERS
  447.  *  previous_focus      [IN]        Previous cursor position
  448.  *  next_focus          [IN]        Next cursor position
  449.  * RETURNS
  450.  *  void
  451.  *****************************************************************************/
  452. void wgui_set_hours_input_navigation(U8 previous_focus, U8 next_focus)
  453. {
  454.     /*----------------------------------------------------------------*/
  455.     /* Local Variables                                                */
  456.     /*----------------------------------------------------------------*/
  457.     /*----------------------------------------------------------------*/
  458.     /* Code Body                                                      */
  459.     /*----------------------------------------------------------------*/
  460.     wgui_hours_input_previous_focus = previous_focus;
  461.     wgui_hours_input_next_focus = next_focus;
  462. }
  463. /*****************************************************************************
  464.  * FUNCTION
  465.  *  wgui_set_minutes_input_navigation
  466.  * DESCRIPTION
  467.  *  function set the valeu of previous and next cursor focus
  468.  *  of minutes input single box
  469.  * PARAMETERS
  470.  *  previous_focus      [IN]        Previous cursor position
  471.  *  next_focus          [IN]        Next cursor position
  472.  * RETURNS
  473.  *  void
  474.  *****************************************************************************/
  475. void wgui_set_minutes_input_navigation(U8 previous_focus, U8 next_focus)
  476. {
  477.     /*----------------------------------------------------------------*/
  478.     /* Local Variables                                                */
  479.     /*----------------------------------------------------------------*/
  480.     /*----------------------------------------------------------------*/
  481.     /* Code Body                                                      */
  482.     /*----------------------------------------------------------------*/
  483.     wgui_minutes_input_previous_focus = previous_focus;
  484.     wgui_minutes_input_next_focus = next_focus;
  485. }
  486. /*****************************************************************************
  487.  * FUNCTION
  488.  *  wgui_set_seconds_input_navigation
  489.  * DESCRIPTION
  490.  *  function set the valeu of previous and next cursor focus
  491.  *  of seconds input single box
  492.  * PARAMETERS
  493.  *  previous_focus      [IN]        Previous cursor position
  494.  *  next_focus          [IN]        Next cursor position
  495.  * RETURNS
  496.  *  void
  497.  *****************************************************************************/
  498. void wgui_set_seconds_input_navigation(U8 previous_focus, U8 next_focus)
  499. {
  500.     /*----------------------------------------------------------------*/
  501.     /* Local Variables                                                */
  502.     /*----------------------------------------------------------------*/
  503.     /*----------------------------------------------------------------*/
  504.     /* Code Body                                                      */
  505.     /*----------------------------------------------------------------*/
  506.     wgui_seconds_input_previous_focus = previous_focus;
  507.     wgui_seconds_input_next_focus = next_focus;
  508. }
  509. /*****************************************************************************
  510.  * FUNCTION
  511.  *  wgui_set_AM_PM_input_navigation
  512.  * DESCRIPTION
  513.  *  function set the valeu of previous and next cursor focus
  514.  *  of am-pm input single box
  515.  * PARAMETERS
  516.  *  previous_focus      [IN]        Previous cursor position
  517.  *  next_focus          [IN]        Next cursor position
  518.  * RETURNS
  519.  *  void
  520.  *****************************************************************************/
  521. void wgui_set_AM_PM_input_navigation(U8 previous_focus, U8 next_focus)
  522. {
  523.     /*----------------------------------------------------------------*/
  524.     /* Local Variables                                                */
  525.     /*----------------------------------------------------------------*/
  526.     /*----------------------------------------------------------------*/
  527.     /* Code Body                                                      */
  528.     /*----------------------------------------------------------------*/
  529.     wgui_AM_PM_input_previous_focus = previous_focus;
  530.     wgui_AM_PM_input_next_focus = next_focus;
  531. }
  532. /*****************************************************************************
  533.  * FUNCTION
  534.  *  wgui_show_date_input
  535.  * DESCRIPTION
  536.  *  show date input box
  537.  * PARAMETERS
  538.  *  void
  539.  * RETURNS
  540.  *  void
  541.  *****************************************************************************/
  542. void wgui_show_date_input(void)
  543. {
  544.     /*----------------------------------------------------------------*/
  545.     /* Local Variables                                                */
  546.     /*----------------------------------------------------------------*/
  547.     /*----------------------------------------------------------------*/
  548.     /* Code Body                                                      */
  549.     /*----------------------------------------------------------------*/
  550.     /* show day single line inputr box */
  551.     gui_show_single_line_input_box(&wgui_date_input_day);
  552.     /* show month single line input box */
  553.     gui_show_single_line_input_box(&wgui_date_input_month);
  554.     /* show year single line input box */
  555.     gui_show_single_line_input_box(&wgui_date_input_year);
  556. }
  557. /*****************************************************************************
  558.  * FUNCTION
  559.  *  wgui_show_time_input
  560.  * DESCRIPTION
  561.  *  show time input box
  562.  * PARAMETERS
  563.  *  void
  564.  * RETURNS
  565.  *  void
  566.  *****************************************************************************/
  567. void wgui_show_time_input(void)
  568. {
  569.     /*----------------------------------------------------------------*/
  570.     /* Local Variables                                                */
  571.     /*----------------------------------------------------------------*/
  572.     /*----------------------------------------------------------------*/
  573.     /* Code Body                                                      */
  574.     /*----------------------------------------------------------------*/
  575.     /* show hours input box */
  576.     gui_show_single_line_input_box(&wgui_time_input_hours);
  577.     /* show minutes input box */
  578.     gui_show_single_line_input_box(&wgui_time_input_minutes);
  579.     if (wgui_seconds_input_enabled) /* if seconds input is enabled */
  580.     {                               /* show seconds input box */
  581.         gui_show_single_line_input_box(&wgui_time_input_seconds);
  582.     }
  583.     if (wgui_AM_PM_input_enabled)   /* if am-pm input enabled */
  584.     {                               /* show am pm input box */
  585.         gui_show_single_line_input_box(&wgui_time_input_AM_PM);
  586.     }
  587. }
  588. /*****************************************************************************
  589.  * FUNCTION
  590.  *  wgui_show_date_time_input
  591.  * DESCRIPTION
  592.  *  show date time input box
  593.  * PARAMETERS
  594.  *  void
  595.  * RETURNS
  596.  *  void
  597.  *****************************************************************************/
  598. void wgui_show_date_time_input(void)
  599. {
  600.     /*----------------------------------------------------------------*/
  601.     /* Local Variables                                                */
  602.     /*----------------------------------------------------------------*/
  603.     /*----------------------------------------------------------------*/
  604.     /* Code Body                                                      */
  605.     /*----------------------------------------------------------------*/
  606.     gdi_layer_lock_frame_buffer();
  607.     if (wgui_date_input_enabled)    /* if date input box enabled */
  608.     {
  609.         wgui_show_date_input(); /* show date input box -day/month/year */
  610.     }
  611.     if (wgui_time_input_enabled)    /* if time input is enabled */
  612.     {
  613.         wgui_show_time_input(); /* show time input box */
  614.     }
  615.     gdi_layer_unlock_frame_buffer();
  616.     gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
  617. }
  618. /*****************************************************************************
  619.  * FUNCTION
  620.  *  wgui_create_date_time_inputbox
  621.  * DESCRIPTION
  622.  *  create single input box of date or time
  623.  * PARAMETERS
  624.  *  b                   [IN]        Single input box
  625.  *  buffer              [IN]        Buffer
  626.  *  buffer_length       [IN]        Total buffer length
  627.  *  text_length         [IN]        Current text length
  628.  * RETURNS
  629.  *  void
  630.  *****************************************************************************/
  631. void wgui_create_date_time_inputbox(single_line_input_box *b, U8 *buffer, S32 buffer_length, S32 text_length)
  632. {
  633.     /*----------------------------------------------------------------*/
  634.     /* Local Variables                                                */
  635.     /*----------------------------------------------------------------*/
  636.     /*----------------------------------------------------------------*/
  637.     /* Code Body                                                      */
  638.     /*----------------------------------------------------------------*/
  639.     /* create single iput box and set buffer */
  640.     gui_create_single_line_input_box_set_buffer(
  641.         b,
  642.         0,
  643.         0,
  644.         0,
  645.         0,
  646.         (UI_string_type) buffer,
  647.         (buffer_length + 1) * 2,
  648.         (text_length + 1) * 2,
  649.         text_length);
  650.     b->flags |= UI_SINGLE_LINE_INPUT_BOX_OVERWRITE_MODE;
  651.     /* set the cursor position to first character */
  652.     gui_single_line_input_box_goto_first_character(b);
  653. }
  654. /*****************************************************************************
  655.  * FUNCTION
  656.  *  wgui_initialize_date_input
  657.  * DESCRIPTION
  658.  *  set the day,month,year value and length of date input box
  659.  * PARAMETERS
  660.  *  day_buffer              [IN]        Store valeu of day
  661.  *  day_buffer_length       [IN]        Length of day buffer
  662.  *  month_buffer            [IN]        Store value of minth
  663.  *  month_buffer_length     [IN]        Length of month buffer
  664.  *  year_buffer             [IN]        Store valeu of year
  665.  *  year_buffer_length      [IN]        Length of year buffer
  666.  * RETURNS
  667.  *  void
  668.  *****************************************************************************/
  669. void wgui_initialize_date_input(
  670.         UI_buffer_type day_buffer,
  671.         S32 day_buffer_length,
  672.         UI_buffer_type month_buffer,
  673.         S32 month_buffer_length,
  674.         UI_buffer_type year_buffer,
  675.         S32 year_buffer_length)
  676. {
  677.     /*----------------------------------------------------------------*/
  678.     /* Local Variables                                                */
  679.     /*----------------------------------------------------------------*/
  680.     S32 l;
  681.     /*----------------------------------------------------------------*/
  682.     /* Code Body                                                      */
  683.     /*----------------------------------------------------------------*/
  684.     /* set the theme of  date input */
  685.     wgui_date_time_input_theme.normal_filler = current_MMI_theme->formatted_inputbox_normal_filler;
  686.     wgui_date_time_input_theme.disabled_filler = current_MMI_theme->formatted_inputbox_normal_filler;
  687.     wgui_date_time_input_theme.selected_filler = current_MMI_theme->formatted_inputbox_selected_filler;
  688.     /* set the theme of single line input box equal to date time input themem */
  689.     current_single_line_input_box_theme = &wgui_date_time_input_theme;
  690.     l = gui_strlen((UI_string_type) day_buffer);
  691.     /* create day input box and set the buffe of day input box */
  692.     wgui_create_date_time_inputbox(&wgui_date_input_day, day_buffer, day_buffer_length, l);
  693.     l = gui_strlen((UI_string_type) month_buffer);
  694.     /* create month input box and set the buffer of month input box */
  695.     wgui_create_date_time_inputbox(&wgui_date_input_month, month_buffer, month_buffer_length, l);
  696.     l = gui_strlen((UI_string_type) year_buffer);
  697.     /* create year  input box and set the buffer of year  input box */
  698.     wgui_create_date_time_inputbox(&wgui_date_input_year, year_buffer, year_buffer_length, l);
  699.     current_single_line_input_box_theme = current_UI_theme->single_line_input_box_theme;
  700.     wgui_date_time_input_remove_object_focus(&wgui_date_input_day);
  701.     wgui_date_time_input_remove_object_focus(&wgui_date_input_month);
  702.     wgui_date_time_input_remove_object_focus(&wgui_date_input_year);
  703.     /* set the flag of date input enabled */
  704.     wgui_date_input_enabled = 1;
  705. }
  706. /*****************************************************************************
  707.  * FUNCTION
  708.  *  wgui_initialize_time_input
  709.  * DESCRIPTION
  710.  *  set the hour ,minute,second  value and length of time  input box
  711.  * PARAMETERS
  712.  *  hours_buffer                [IN]        Store valeu of hours
  713.  *  hours_buffer_length         [IN]        Length of hours buffer
  714.  *  minutes_buffer              [IN]        Store value of minute
  715.  *  minutes_buffer_length       [IN]        Length of minute buffer
  716.  *  seconds_buffer              [IN]        Store valeu of seconds
  717.  *  seconds_buffer_length       [IN]        Length of second  buffer
  718.  * RETURNS
  719.  *  void
  720.  *****************************************************************************/
  721. void wgui_initialize_time_input(
  722.         UI_buffer_type hours_buffer,
  723.         S32 hours_buffer_length,
  724.         UI_buffer_type minutes_buffer,
  725.         S32 minutes_buffer_length,
  726.         UI_buffer_type seconds_buffer,
  727.         S32 seconds_buffer_length)
  728. {
  729.     /*----------------------------------------------------------------*/
  730.     /* Local Variables                                                */
  731.     /*----------------------------------------------------------------*/
  732.     S32 l;
  733.     /*----------------------------------------------------------------*/
  734.     /* Code Body                                                      */
  735.     /*----------------------------------------------------------------*/
  736.     /* set the theme of time input box */
  737.     wgui_date_time_input_theme.normal_filler = current_MMI_theme->formatted_inputbox_normal_filler;
  738.     wgui_date_time_input_theme.disabled_filler = current_MMI_theme->formatted_inputbox_normal_filler;
  739.     wgui_date_time_input_theme.selected_filler = current_MMI_theme->formatted_inputbox_selected_filler;
  740.     current_single_line_input_box_theme = &wgui_date_time_input_theme;
  741.     l = gui_strlen((UI_string_type) hours_buffer);
  742.     /* create hour inputbox and set the buffer of hour input box */
  743.     wgui_create_date_time_inputbox(&wgui_time_input_hours, hours_buffer, hours_buffer_length, l);
  744.     l = gui_strlen((UI_string_type) minutes_buffer);
  745.     /* create minutes inputbox and set the buffer of minutes input box */
  746.     wgui_create_date_time_inputbox(&wgui_time_input_minutes, minutes_buffer, minutes_buffer_length, l);
  747.     l = gui_strlen((UI_string_type) seconds_buffer);
  748.     /* create seconds inputbox and set the buffer of second  input box */
  749.     wgui_create_date_time_inputbox(&wgui_time_input_seconds, seconds_buffer, seconds_buffer_length, l);
  750.     current_single_line_input_box_theme = current_UI_theme->single_line_input_box_theme;
  751.     wgui_date_time_input_remove_object_focus(&wgui_time_input_hours);
  752.     wgui_date_time_input_remove_object_focus(&wgui_time_input_minutes);
  753.     wgui_date_time_input_remove_object_focus(&wgui_time_input_seconds);
  754.     wgui_date_time_input_remove_object_focus(&wgui_time_input_AM_PM);
  755.     wgui_time_input_enabled = 1;
  756. }
  757. /*****************************************************************************
  758.  * FUNCTION
  759.  *  wgui_reset_date_input
  760.  * DESCRIPTION
  761.  *  set the flag of date input to default valeu
  762.  * PARAMETERS
  763.  *  void
  764.  * RETURNS
  765.  *  void
  766.  *****************************************************************************/
  767. void wgui_reset_date_input(void)
  768. {
  769.     /*----------------------------------------------------------------*/
  770.     /* Local Variables                                                */
  771.     /*----------------------------------------------------------------*/
  772.     /*----------------------------------------------------------------*/
  773.     /* Code Body                                                      */
  774.     /*----------------------------------------------------------------*/
  775.     wgui_date_input_enabled = 0;
  776. }
  777. /*****************************************************************************
  778.  * FUNCTION
  779.  *  wgui_reset_time_input
  780.  * DESCRIPTION
  781.  *  set the flag of time input to default valeu
  782.  * PARAMETERS
  783.  *  void
  784.  * RETURNS
  785.  *  void
  786.  *****************************************************************************/
  787. void wgui_reset_time_input(void)
  788. {
  789.     /*----------------------------------------------------------------*/
  790.     /* Local Variables                                                */
  791.     /*----------------------------------------------------------------*/
  792.     /*----------------------------------------------------------------*/
  793.     /* Code Body                                                      */
  794.     /*----------------------------------------------------------------*/
  795.     wgui_time_input_enabled = 0;
  796. }
  797. /*****************************************************************************
  798.  * FUNCTION
  799.  *  wgui_move_day_input
  800.  * DESCRIPTION
  801.  *  move day input box to particula position x , y equal to valeu pass as parameter
  802.  * PARAMETERS
  803.  *  x       [IN]        
  804.  *  y       [IN]        
  805.  * RETURNS
  806.  *  void
  807.  *****************************************************************************/
  808. void wgui_move_day_input(S32 x, S32 y)
  809. {   /* move the day input box to particular x,y position */
  810.     /*----------------------------------------------------------------*/
  811.     /* Local Variables                                                */
  812.     /*----------------------------------------------------------------*/
  813.     /*----------------------------------------------------------------*/
  814.     /* Code Body                                                      */
  815.     /*----------------------------------------------------------------*/
  816.     gui_move_single_line_input_box(&wgui_date_input_day, x, y);
  817. }
  818. /*****************************************************************************
  819.  * FUNCTION
  820.  *  wgui_resize_day_input
  821.  * DESCRIPTION
  822.  *  resize day inpuit box
  823.  * PARAMETERS
  824.  *  width       [IN]        
  825.  *  height      [IN]        
  826.  * RETURNS
  827.  *  void
  828.  *****************************************************************************/
  829. void wgui_resize_day_input(S32 width, S32 height)
  830. {   /* resize da input box equal to width and height pass as parameter */
  831.     /*----------------------------------------------------------------*/
  832.     /* Local Variables                                                */
  833.     /*----------------------------------------------------------------*/
  834.     /*----------------------------------------------------------------*/
  835.     /* Code Body                                                      */
  836.     /*----------------------------------------------------------------*/
  837.     gui_resize_single_line_input_box(&wgui_date_input_day, width, height);
  838. }
  839. /*****************************************************************************
  840.  * FUNCTION
  841.  *  wgui_move_month_input
  842.  * DESCRIPTION
  843.  *  move month input box to particula position x , y equal to valeu pass as parameter
  844.  * PARAMETERS
  845.  *  x       [IN]        
  846.  *  y       [IN]        
  847.  * RETURNS
  848.  *  void
  849.  *****************************************************************************/
  850. void wgui_move_month_input(S32 x, S32 y)
  851. {   /* move the month input box to particular x,y position */
  852.     /*----------------------------------------------------------------*/
  853.     /* Local Variables                                                */
  854.     /*----------------------------------------------------------------*/
  855.     /*----------------------------------------------------------------*/
  856.     /* Code Body                                                      */
  857.     /*----------------------------------------------------------------*/
  858.     gui_move_single_line_input_box(&wgui_date_input_month, x, y);
  859. }
  860. /*****************************************************************************
  861.  * FUNCTION
  862.  *  wgui_resize_month_input
  863.  * DESCRIPTION
  864.  *  resize month inpuit box
  865.  * PARAMETERS
  866.  *  width       [IN]        
  867.  *  height      [IN]        
  868.  * RETURNS
  869.  *  void
  870.  *****************************************************************************/
  871. void wgui_resize_month_input(S32 width, S32 height)
  872. {   /* resize month input box equal to width and height pass as parameter */
  873.     /*----------------------------------------------------------------*/
  874.     /* Local Variables                                                */
  875.     /*----------------------------------------------------------------*/
  876.     /*----------------------------------------------------------------*/
  877.     /* Code Body                                                      */
  878.     /*----------------------------------------------------------------*/
  879.     gui_resize_single_line_input_box(&wgui_date_input_month, width, height);
  880. }
  881. /*****************************************************************************
  882.  * FUNCTION
  883.  *  wgui_move_year_input
  884.  * DESCRIPTION
  885.  *  move year input box to particula position x , y equal to valeu pass as parameter
  886.  * PARAMETERS
  887.  *  x       [IN]        
  888.  *  y       [IN]        
  889.  * RETURNS
  890.  *  void
  891.  *****************************************************************************/
  892. void wgui_move_year_input(S32 x, S32 y)
  893. {   /* move the year input box to particular x,y position */
  894.     /*----------------------------------------------------------------*/
  895.     /* Local Variables                                                */
  896.     /*----------------------------------------------------------------*/
  897.     /*----------------------------------------------------------------*/
  898.     /* Code Body                                                      */
  899.     /*----------------------------------------------------------------*/
  900.     gui_move_single_line_input_box(&wgui_date_input_year, x, y);
  901. }
  902. /*****************************************************************************
  903.  * FUNCTION
  904.  *  wgui_resize_year_input
  905.  * DESCRIPTION
  906.  *  resize year inpuit box
  907.  * PARAMETERS
  908.  *  width       [IN]        
  909.  *  height      [IN]        
  910.  * RETURNS
  911.  *  void
  912.  *****************************************************************************/
  913. void wgui_resize_year_input(S32 width, S32 height)
  914. {   /* resize year input box equal to width and height pass as parameter */
  915.     /*----------------------------------------------------------------*/
  916.     /* Local Variables                                                */
  917.     /*----------------------------------------------------------------*/
  918.     /*----------------------------------------------------------------*/
  919.     /* Code Body                                                      */
  920.     /*----------------------------------------------------------------*/
  921.     gui_resize_single_line_input_box(&wgui_date_input_year, width, height);
  922. }
  923. /*****************************************************************************
  924.  * FUNCTION
  925.  *  wgui_move_hours_input
  926.  * DESCRIPTION
  927.  *  move hours input box to particula position x , y equal to valeu pass as parameter
  928.  * PARAMETERS
  929.  *  x       [IN]        
  930.  *  y       [IN]        
  931.  * RETURNS
  932.  *  void
  933.  *****************************************************************************/
  934. void wgui_move_hours_input(S32 x, S32 y)
  935. {
  936.     /*----------------------------------------------------------------*/
  937.     /* Local Variables                                                */
  938.     /*----------------------------------------------------------------*/
  939.     /*----------------------------------------------------------------*/
  940.     /* Code Body                                                      */
  941.     /*----------------------------------------------------------------*/
  942.     gui_move_single_line_input_box(&wgui_time_input_hours, x, y);
  943. }
  944. /*****************************************************************************
  945.  * FUNCTION
  946.  *  wgui_resize_hours_input
  947.  * DESCRIPTION
  948.  *  resize hours  inpuit box
  949.  * PARAMETERS
  950.  *  width       [IN]        
  951.  *  height      [IN]        
  952.  * RETURNS
  953.  *  void
  954.  *****************************************************************************/
  955. void wgui_resize_hours_input(S32 width, S32 height)
  956. {
  957.     /*----------------------------------------------------------------*/
  958.     /* Local Variables                                                */
  959.     /*----------------------------------------------------------------*/
  960.     /*----------------------------------------------------------------*/
  961.     /* Code Body                                                      */
  962.     /*----------------------------------------------------------------*/
  963.     gui_resize_single_line_input_box(&wgui_time_input_hours, width, height);
  964. }
  965. /*****************************************************************************
  966.  * FUNCTION
  967.  *  wgui_move_minutes_input
  968.  * DESCRIPTION
  969.  *  move minutes input box to particula position x , y equal to valeu pass as parameter
  970.  * PARAMETERS
  971.  *  x       [IN]        
  972.  *  y       [IN]        
  973.  * RETURNS
  974.  *  void
  975.  *****************************************************************************/
  976. void wgui_move_minutes_input(S32 x, S32 y)
  977. {
  978.     /*----------------------------------------------------------------*/
  979.     /* Local Variables                                                */
  980.     /*----------------------------------------------------------------*/
  981.     /*----------------------------------------------------------------*/
  982.     /* Code Body                                                      */
  983.     /*----------------------------------------------------------------*/
  984.     gui_move_single_line_input_box(&wgui_time_input_minutes, x, y);
  985. }
  986. /*****************************************************************************
  987.  * FUNCTION
  988.  *  wgui_resize_minutes_input
  989.  * DESCRIPTION
  990.  *  resize minutes  inpuit box
  991.  * PARAMETERS
  992.  *  width       [IN]        
  993.  *  height      [IN]        
  994.  * RETURNS
  995.  *  void
  996.  *****************************************************************************/
  997. void wgui_resize_minutes_input(S32 width, S32 height)
  998. {
  999.     /*----------------------------------------------------------------*/
  1000.     /* Local Variables                                                */
  1001.     /*----------------------------------------------------------------*/
  1002.     /*----------------------------------------------------------------*/
  1003.     /* Code Body                                                      */
  1004.     /*----------------------------------------------------------------*/
  1005.     gui_resize_single_line_input_box(&wgui_time_input_minutes, width, height);
  1006. }
  1007. /*****************************************************************************
  1008.  * FUNCTION
  1009.  *  wgui_move_seconds_input
  1010.  * DESCRIPTION
  1011.  *  move seconds input box to particula position x , y equal to valeu pass as parameter
  1012.  * PARAMETERS
  1013.  *  x       [IN]        
  1014.  *  y       [IN]        
  1015.  * RETURNS
  1016.  *  void
  1017.  *****************************************************************************/
  1018. void wgui_move_seconds_input(S32 x, S32 y)
  1019. {
  1020.     /*----------------------------------------------------------------*/
  1021.     /* Local Variables                                                */
  1022.     /*----------------------------------------------------------------*/
  1023.     /*----------------------------------------------------------------*/
  1024.     /* Code Body                                                      */
  1025.     /*----------------------------------------------------------------*/
  1026.     gui_move_single_line_input_box(&wgui_time_input_seconds, x, y);
  1027. }
  1028. /*****************************************************************************
  1029.  * FUNCTION
  1030.  *  wgui_resize_seconds_input
  1031.  * DESCRIPTION
  1032.  *  resize seconds  inpuit box
  1033.  * PARAMETERS
  1034.  *  width       [IN]        
  1035.  *  height      [IN]        
  1036.  * RETURNS
  1037.  *  void
  1038.  *****************************************************************************/
  1039. void wgui_resize_seconds_input(S32 width, S32 height)
  1040. {
  1041.     /*----------------------------------------------------------------*/
  1042.     /* Local Variables                                                */
  1043.     /*----------------------------------------------------------------*/
  1044.     /*----------------------------------------------------------------*/
  1045.     /* Code Body                                                      */
  1046.     /*----------------------------------------------------------------*/
  1047.     gui_resize_single_line_input_box(&wgui_time_input_seconds, width, height);
  1048. }
  1049. /*****************************************************************************
  1050.  * FUNCTION
  1051.  *  wgui_move_AM_PM_input
  1052.  * DESCRIPTION
  1053.  *  move am-pm input box to particula position x , y equal to valeu pass as parameter
  1054.  * PARAMETERS
  1055.  *  x       [IN]        
  1056.  *  y       [IN]        
  1057.  * RETURNS
  1058.  *  void
  1059.  *****************************************************************************/
  1060. void wgui_move_AM_PM_input(S32 x, S32 y)
  1061. {
  1062.     /*----------------------------------------------------------------*/
  1063.     /* Local Variables                                                */
  1064.     /*----------------------------------------------------------------*/
  1065.     /*----------------------------------------------------------------*/
  1066.     /* Code Body                                                      */
  1067.     /*----------------------------------------------------------------*/
  1068.     gui_move_single_line_input_box(&wgui_time_input_AM_PM, x, y);
  1069. }
  1070. /*****************************************************************************
  1071.  * FUNCTION
  1072.  *  wgui_resize_AM_PM_input
  1073.  * DESCRIPTION
  1074.  *  resize am-pm  inpuit box
  1075.  * PARAMETERS
  1076.  *  width       [IN]        
  1077.  *  height      [IN]        
  1078.  * RETURNS
  1079.  *  void
  1080.  *****************************************************************************/
  1081. void wgui_resize_AM_PM_input(S32 width, S32 height)
  1082. {
  1083.     /*----------------------------------------------------------------*/
  1084.     /* Local Variables                                                */
  1085.     /*----------------------------------------------------------------*/
  1086.     /*----------------------------------------------------------------*/
  1087.     /* Code Body                                                      */
  1088.     /*----------------------------------------------------------------*/
  1089.     gui_resize_single_line_input_box(&wgui_time_input_AM_PM, width, height);
  1090. }
  1091. /*****************************************************************************
  1092.  * FUNCTION
  1093.  *  wgui_enable_seconds_input
  1094.  * DESCRIPTION
  1095.  *  enbale second input flag
  1096.  * PARAMETERS
  1097.  *  void
  1098.  * RETURNS
  1099.  *  void
  1100.  *****************************************************************************/
  1101. void wgui_enable_seconds_input(void)
  1102. {
  1103.     /*----------------------------------------------------------------*/
  1104.     /* Local Variables                                                */
  1105.     /*----------------------------------------------------------------*/
  1106.     /*----------------------------------------------------------------*/
  1107.     /* Code Body                                                      */
  1108.     /*----------------------------------------------------------------*/
  1109.     wgui_seconds_input_enabled = 1;
  1110. }
  1111. /*****************************************************************************
  1112.  * FUNCTION
  1113.  *  wgui_disable_seconds_input
  1114.  * DESCRIPTION
  1115.  *  disable second input flag
  1116.  * PARAMETERS
  1117.  *  void
  1118.  * RETURNS
  1119.  *  void
  1120.  *****************************************************************************/
  1121. void wgui_disable_seconds_input(void)
  1122. {
  1123.     /*----------------------------------------------------------------*/
  1124.     /* Local Variables                                                */
  1125.     /*----------------------------------------------------------------*/
  1126.     /*----------------------------------------------------------------*/
  1127.     /* Code Body                                                      */
  1128.     /*----------------------------------------------------------------*/
  1129.     wgui_seconds_input_enabled = 0;
  1130. }
  1131. /*****************************************************************************
  1132.  * FUNCTION
  1133.  *  wgui_enable_AM_PM_input
  1134.  * DESCRIPTION
  1135.  *  enbale am pm input flag
  1136.  * PARAMETERS
  1137.  *  void
  1138.  * RETURNS
  1139.  *  void
  1140.  *****************************************************************************/
  1141. void wgui_enable_AM_PM_input(void)
  1142. {
  1143.     /*----------------------------------------------------------------*/
  1144.     /* Local Variables                                                */
  1145.     /*----------------------------------------------------------------*/
  1146.     /*----------------------------------------------------------------*/
  1147.     /* Code Body                                                      */
  1148.     /*----------------------------------------------------------------*/
  1149.     wgui_AM_PM_input_enabled = 1;
  1150. }
  1151. /*****************************************************************************
  1152.  * FUNCTION
  1153.  *  wgui_disable_AM_PM_input
  1154.  * DESCRIPTION
  1155.  *  disable am pm input flag
  1156.  * PARAMETERS
  1157.  *  void
  1158.  * RETURNS
  1159.  *  void
  1160.  *****************************************************************************/
  1161. void wgui_disable_AM_PM_input(void)
  1162. {
  1163.     /*----------------------------------------------------------------*/
  1164.     /* Local Variables                                                */
  1165.     /*----------------------------------------------------------------*/
  1166.     /*----------------------------------------------------------------*/
  1167.     /* Code Body                                                      */
  1168.     /*----------------------------------------------------------------*/
  1169.     wgui_AM_PM_input_enabled = 0;
  1170. }
  1171. /*****************************************************************************
  1172.  * FUNCTION
  1173.  *  wgui_date_time_input_set_object_focus
  1174.  * DESCRIPTION
  1175.  *  set focus on input box pass as paaremter
  1176.  * PARAMETERS
  1177.  *  b       [IN]        
  1178.  * RETURNS
  1179.  *  void
  1180.  *****************************************************************************/
  1181. void wgui_date_time_input_set_object_focus(single_line_input_box *b)
  1182. {
  1183.     /*----------------------------------------------------------------*/
  1184.     /* Local Variables                                                */
  1185.     /*----------------------------------------------------------------*/
  1186.     /*----------------------------------------------------------------*/
  1187.     /* Code Body                                                      */
  1188.     /*----------------------------------------------------------------*/
  1189.     if (b == NULL)
  1190.     {
  1191.         return;
  1192.     }
  1193.     b->flags &= ~UI_SINGLE_LINE_INPUT_BOX_STATE_NORMAL;
  1194.     b->flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_SELECTED;
  1195.     b->flags &= ~UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
  1196. }
  1197. /*****************************************************************************
  1198.  * FUNCTION
  1199.  *  wgui_date_time_input_remove_object_focus
  1200.  * DESCRIPTION
  1201.  *  remove  focus from input box pass as paaremter
  1202.  * PARAMETERS
  1203.  *  b       [IN]        
  1204.  * RETURNS
  1205.  *  void
  1206.  *****************************************************************************/
  1207. void wgui_date_time_input_remove_object_focus(single_line_input_box *b)
  1208. {
  1209.     /*----------------------------------------------------------------*/
  1210.     /* Local Variables                                                */
  1211.     /*----------------------------------------------------------------*/
  1212.     /*----------------------------------------------------------------*/
  1213.     /* Code Body                                                      */
  1214.     /*----------------------------------------------------------------*/
  1215.     if (b == NULL)
  1216.     {
  1217.         return;
  1218.     }
  1219.     b->flags &= ~UI_SINGLE_LINE_INPUT_BOX_STATE_SELECTED;
  1220.     b->flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_NORMAL;
  1221.     b->flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
  1222. }
  1223. /*****************************************************************************
  1224.  * FUNCTION
  1225.  *  wgui_date_time_input_set_focus
  1226.  * DESCRIPTION
  1227.  *  set focus on input box pass as paaremter
  1228.  * PARAMETERS
  1229.  *  focus       [IN]        
  1230.  * RETURNS
  1231.  *  void
  1232.  *****************************************************************************/
  1233. void wgui_date_time_input_set_focus(U8 focus)
  1234. {
  1235.     /*----------------------------------------------------------------*/
  1236.     /* Local Variables                                                */
  1237.     /*----------------------------------------------------------------*/
  1238.     /*----------------------------------------------------------------*/
  1239.     /* Code Body                                                      */
  1240.     /*----------------------------------------------------------------*/
  1241.     wgui_date_time_input_focus = focus;
  1242.     switch (wgui_date_time_input_focus)
  1243.     {
  1244.         case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
  1245.             wgui_date_time_input_object_focus = NULL;
  1246.             break;
  1247.         case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
  1248.             wgui_date_time_input_object_focus = &wgui_date_input_day;
  1249.             break;
  1250.         case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
  1251.             wgui_date_time_input_object_focus = &wgui_date_input_month;
  1252.             break;
  1253.         case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
  1254.             wgui_date_time_input_object_focus = &wgui_date_input_year;
  1255.             break;
  1256.         case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
  1257.             wgui_date_time_input_object_focus = &wgui_time_input_hours;
  1258.             break;
  1259.         case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
  1260.             wgui_date_time_input_object_focus = &wgui_time_input_minutes;
  1261.             break;
  1262.         case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
  1263.             wgui_date_time_input_object_focus = &wgui_time_input_seconds;
  1264.             break;
  1265.         case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
  1266.             wgui_date_time_input_object_focus = &wgui_time_input_AM_PM;
  1267.             break;
  1268.         default:
  1269.             wgui_date_time_input_object_focus = NULL;
  1270.             break;
  1271.     }
  1272.     wgui_date_time_input_set_object_focus(wgui_date_time_input_object_focus);
  1273. }
  1274. /*****************************************************************************
  1275.  * FUNCTION
  1276.  *  wgui_date_time_input_remove_focus
  1277.  * DESCRIPTION
  1278.  *  remove focus from  input box pass as paaremter
  1279.  * PARAMETERS
  1280.  *  focus       [IN]        
  1281.  * RETURNS
  1282.  *  void
  1283.  *****************************************************************************/
  1284. void wgui_date_time_input_remove_focus(U8 focus)
  1285. {
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Local Variables                                                */
  1288.     /*----------------------------------------------------------------*/
  1289.     single_line_input_box *f = NULL;
  1290.     /*----------------------------------------------------------------*/
  1291.     /* Code Body                                                      */
  1292.     /*----------------------------------------------------------------*/
  1293.     switch (focus)
  1294.     {
  1295.         case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
  1296.             f = NULL;
  1297.             break;
  1298.         case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
  1299.             f = &wgui_date_input_day;
  1300.             break;
  1301.         case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
  1302.             f = &wgui_date_input_month;
  1303.             break;
  1304.         case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
  1305.             f = &wgui_date_input_year;
  1306.             break;
  1307.         case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
  1308.             f = &wgui_time_input_hours;
  1309.             break;
  1310.         case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
  1311.             f = &wgui_time_input_minutes;
  1312.             break;
  1313.         case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
  1314.             f = &wgui_time_input_seconds;
  1315.             break;
  1316.         case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
  1317.             f = &wgui_time_input_AM_PM;
  1318.             break;
  1319.         default:
  1320.             f = NULL;
  1321.             break;
  1322.     }
  1323.     wgui_date_time_input_remove_object_focus(f);
  1324. }
  1325. /*****************************************************************************
  1326.  * FUNCTION
  1327.  *  wgui_date_time_input_set_previous_focus
  1328.  * DESCRIPTION
  1329.  *  set focus to previous position of current input box
  1330.  * PARAMETERS
  1331.  *  void
  1332.  * RETURNS
  1333.  *  void
  1334.  *****************************************************************************/
  1335. void wgui_date_time_input_set_previous_focus(void)
  1336. {
  1337.     /*----------------------------------------------------------------*/
  1338.     /* Local Variables                                                */
  1339.     /*----------------------------------------------------------------*/
  1340.     /*----------------------------------------------------------------*/
  1341.     /* Code Body                                                      */
  1342.     /*----------------------------------------------------------------*/
  1343.     wgui_date_time_input_remove_focus(wgui_date_time_input_focus);
  1344.     switch (wgui_date_time_input_focus)
  1345.     {
  1346.         case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
  1347.             break;
  1348.         case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
  1349.             wgui_date_time_input_set_focus(wgui_day_input_previous_focus);
  1350.             break;
  1351.         case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
  1352.             wgui_date_time_input_set_focus(wgui_month_input_previous_focus);
  1353.             break;
  1354.         case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
  1355.             wgui_date_time_input_set_focus(wgui_year_input_previous_focus);
  1356.             break;
  1357.         case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
  1358.             wgui_date_time_input_set_focus(wgui_hours_input_previous_focus);
  1359.             break;
  1360.         case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
  1361.             wgui_date_time_input_set_focus(wgui_minutes_input_previous_focus);
  1362.             break;
  1363.         case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
  1364.             wgui_date_time_input_set_focus(wgui_seconds_input_previous_focus);
  1365.             break;
  1366.         case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
  1367.             wgui_date_time_input_set_focus(wgui_AM_PM_input_previous_focus);
  1368.             break;
  1369.         default:
  1370.             break;
  1371.     }
  1372. }
  1373. /*****************************************************************************
  1374.  * FUNCTION
  1375.  *  wgui_date_time_input_set_next_focus
  1376.  * DESCRIPTION
  1377.  *  set focus to next  position of current input box
  1378.  * PARAMETERS
  1379.  *  void
  1380.  * RETURNS
  1381.  *  void
  1382.  *****************************************************************************/
  1383. void wgui_date_time_input_set_next_focus(void)
  1384. {
  1385.     /*----------------------------------------------------------------*/
  1386.     /* Local Variables                                                */
  1387.     /*----------------------------------------------------------------*/
  1388.     /*----------------------------------------------------------------*/
  1389.     /* Code Body                                                      */
  1390.     /*----------------------------------------------------------------*/
  1391.     wgui_date_time_input_remove_focus(wgui_date_time_input_focus);
  1392.     switch (wgui_date_time_input_focus)
  1393.     {
  1394.         case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
  1395.             break;
  1396.         case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
  1397.             wgui_date_time_input_set_focus(wgui_day_input_next_focus);
  1398.             break;
  1399.         case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
  1400.             wgui_date_time_input_set_focus(wgui_month_input_next_focus);
  1401.             break;
  1402.         case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
  1403.             wgui_date_time_input_set_focus(wgui_year_input_next_focus);
  1404.             break;
  1405.         case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
  1406.             wgui_date_time_input_set_focus(wgui_hours_input_next_focus);
  1407.             break;
  1408.         case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
  1409.             wgui_date_time_input_set_focus(wgui_minutes_input_next_focus);
  1410.             break;
  1411.         case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
  1412.             wgui_date_time_input_set_focus(wgui_seconds_input_next_focus);
  1413.             break;
  1414.         case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
  1415.             wgui_date_time_input_set_focus(wgui_AM_PM_input_next_focus);
  1416.             break;
  1417.         default:
  1418.             break;
  1419.     }
  1420. }
  1421. /*****************************************************************************
  1422.  * FUNCTION
  1423.  *  wgui_date_time_input_get_previous_focus
  1424.  * DESCRIPTION
  1425.  *  return the previous focus input box
  1426.  * PARAMETERS
  1427.  *  void
  1428.  * RETURNS
  1429.  *  byte:- return the previous  focus input box ..day/month/year/hour/minute/second
  1430.  *****************************************************************************/
  1431. U8 wgui_date_time_input_get_previous_focus(void)
  1432. {
  1433.     /*----------------------------------------------------------------*/
  1434.     /* Local Variables                                                */
  1435.     /*----------------------------------------------------------------*/
  1436.     /*----------------------------------------------------------------*/
  1437.     /* Code Body                                                      */
  1438.     /*----------------------------------------------------------------*/
  1439.     switch (wgui_date_time_input_focus)
  1440.     {
  1441.         case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
  1442.             return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
  1443.         case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
  1444.             return (wgui_day_input_previous_focus);
  1445.         case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
  1446.             return (wgui_month_input_previous_focus);
  1447.         case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
  1448.             return (wgui_year_input_previous_focus);
  1449.         case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
  1450.             return (wgui_hours_input_previous_focus);
  1451.         case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
  1452.             return (wgui_minutes_input_previous_focus);
  1453.         case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
  1454.             return (wgui_seconds_input_previous_focus);
  1455.         case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
  1456.             return (wgui_AM_PM_input_previous_focus);
  1457.         default:
  1458.             return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
  1459.     }
  1460. }
  1461. /*****************************************************************************
  1462.  * FUNCTION
  1463.  *  wgui_date_time_input_get_next_focus
  1464.  * DESCRIPTION
  1465.  *  return the next foucs input box
  1466.  * PARAMETERS
  1467.  *  void
  1468.  * RETURNS
  1469.  *  byte:- return the previous  focus input box ..day/month/year/hour/minute/second
  1470.  *****************************************************************************/
  1471. U8 wgui_date_time_input_get_next_focus(void)
  1472. {
  1473.     /*----------------------------------------------------------------*/
  1474.     /* Local Variables                                                */
  1475.     /*----------------------------------------------------------------*/
  1476.     /*----------------------------------------------------------------*/
  1477.     /* Code Body                                                      */
  1478.     /*----------------------------------------------------------------*/
  1479.     switch (wgui_date_time_input_focus)
  1480.     {
  1481.         case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
  1482.             return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
  1483.         case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
  1484.             return (wgui_day_input_next_focus);
  1485.         case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
  1486.             return (wgui_month_input_next_focus);
  1487.         case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
  1488.             return (wgui_year_input_next_focus);
  1489.         case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
  1490.             return (wgui_hours_input_next_focus);
  1491.         case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
  1492.             return (wgui_minutes_input_next_focus);
  1493.         case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
  1494.             return (wgui_seconds_input_next_focus);
  1495.         case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
  1496.             return (wgui_AM_PM_input_next_focus);
  1497.         default:
  1498.             return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
  1499.     }
  1500. }
  1501. /*****************************************************************************
  1502.  * FUNCTION
  1503.  *  wgui_redraw_date_time_input
  1504.  * DESCRIPTION
  1505.  *  redraw dte/time input box depend on current focus input box
  1506.  * PARAMETERS
  1507.  *  void
  1508.  * RETURNS
  1509.  *  void
  1510.  *****************************************************************************/
  1511. void wgui_redraw_date_time_input(void)
  1512. {
  1513.     /*----------------------------------------------------------------*/
  1514.     /* Local Variables                                                */
  1515.     /*----------------------------------------------------------------*/
  1516.     S32 x1, y1, x2, y2;
  1517.     /*----------------------------------------------------------------*/
  1518.     /* Code Body                                                      */
  1519.     /*----------------------------------------------------------------*/
  1520.     if (wgui_date_time_input_object_focus == NULL)
  1521.     {
  1522.         return;
  1523.     }
  1524.     gdi_layer_lock_frame_buffer();
  1525.     gui_show_single_line_input_box(wgui_date_time_input_object_focus);
  1526.     gdi_layer_unlock_frame_buffer();
  1527.     x1 = wgui_date_time_input_object_focus->x;
  1528.     y1 = wgui_date_time_input_object_focus->y;
  1529.     x2 = x1 + wgui_date_time_input_object_focus->width - 1;
  1530.     y2 = y1 + wgui_date_time_input_object_focus->height - 1;
  1531.     gdi_layer_blt_previous(x1, y1, x2, y2);
  1532. }
  1533. /*****************************************************************************
  1534.  * FUNCTION
  1535.  *  wgui_date_time_direct_input
  1536.  * DESCRIPTION
  1537.  *  input the character enter by user in date tiem input box
  1538.  * PARAMETERS
  1539.  *  c       [IN]        
  1540.  * RETURNS
  1541.  *  void
  1542.  *****************************************************************************/
  1543. void wgui_date_time_direct_input(UI_character_type c)
  1544. {
  1545.     /*----------------------------------------------------------------*/
  1546.     /* Local Variables                                                */
  1547.     /*----------------------------------------------------------------*/
  1548.     /*----------------------------------------------------------------*/
  1549.     /* Code Body                                                      */
  1550.     /*----------------------------------------------------------------*/
  1551.     if (wgui_date_time_input_object_focus == NULL)
  1552.     {
  1553.         return;
  1554.     }
  1555.     if (gui_single_line_input_box_test_last_position_overflow(wgui_date_time_input_object_focus))
  1556.     {
  1557.         if (wgui_date_time_input_get_next_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
  1558.         {
  1559.             wgui_date_time_input_set_next_focus();
  1560.             gui_single_line_input_box_insert_character(wgui_date_time_input_object_focus, c);
  1561.             wgui_show_date_time_input();
  1562.         }
  1563.     }
  1564.     else
  1565.     {
  1566.         gui_single_line_input_box_insert_character(wgui_date_time_input_object_focus, c);
  1567.         wgui_redraw_date_time_input();
  1568.         if (gui_single_line_input_box_test_last_position_overflow(wgui_date_time_input_object_focus))
  1569.         {
  1570.             if (wgui_date_time_input_get_next_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
  1571.             {
  1572.                 wgui_date_time_input_set_next_focus();
  1573.                 wgui_show_date_time_input();
  1574.             }
  1575.         }
  1576.     }
  1577.     wgui_date_time_input_callback();
  1578. }
  1579. /*****************************************************************************
  1580.  * FUNCTION
  1581.  *  wgui_date_time_delete_character
  1582.  * DESCRIPTION
  1583.  *  delete the character from  date time input box - current input box
  1584.  * PARAMETERS
  1585.  *  void
  1586.  * RETURNS
  1587.  *  void
  1588.  *****************************************************************************/
  1589. void wgui_date_time_delete_character(void)
  1590. {
  1591.     /*----------------------------------------------------------------*/
  1592.     /* Local Variables                                                */
  1593.     /*----------------------------------------------------------------*/
  1594.     /*----------------------------------------------------------------*/
  1595.     /* Code Body                                                      */
  1596.     /*----------------------------------------------------------------*/
  1597.     if (wgui_date_time_input_object_focus == NULL)
  1598.     {
  1599.         return;
  1600.     }
  1601.     if (gui_single_line_input_box_test_first_position(wgui_date_time_input_object_focus))
  1602.     {
  1603.         if (wgui_date_time_input_get_previous_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
  1604.         {
  1605.             wgui_date_time_input_set_previous_focus();
  1606.             wgui_show_date_time_input();
  1607.         }
  1608.     }
  1609.     else
  1610.     {
  1611.         gui_single_line_input_box_delete_character(wgui_date_time_input_object_focus);
  1612.         wgui_redraw_date_time_input();
  1613.         if (gui_single_line_input_box_test_first_position(wgui_date_time_input_object_focus))
  1614.         {
  1615.             if (wgui_date_time_input_get_previous_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
  1616.             {
  1617.                 wgui_date_time_input_set_previous_focus();
  1618.                 wgui_show_date_time_input();
  1619.             }
  1620.         }
  1621.     }
  1622.     wgui_date_time_input_callback();
  1623. }
  1624. /*****************************************************************************
  1625.  * FUNCTION
  1626.  *  wgui_date_time_previous_character
  1627.  * DESCRIPTION
  1628.  *  move the cursor to previous caharcter of date /time input box
  1629.  * PARAMETERS
  1630.  *  void
  1631.  * RETURNS
  1632.  *  void
  1633.  *****************************************************************************/
  1634. void wgui_date_time_previous_character(void)
  1635. {
  1636.     /*----------------------------------------------------------------*/
  1637.     /* Local Variables                                                */
  1638.     /*----------------------------------------------------------------*/
  1639.     /*----------------------------------------------------------------*/
  1640.     /* Code Body                                                      */
  1641.     /*----------------------------------------------------------------*/
  1642.     if (wgui_date_time_input_object_focus == NULL)
  1643.     {
  1644.         return;
  1645.     }
  1646.     if (gui_single_line_input_box_test_first_position(wgui_date_time_input_object_focus))
  1647.     {
  1648.         if (wgui_date_time_input_get_previous_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
  1649.         {
  1650.             wgui_date_time_input_set_previous_focus();
  1651.             wgui_show_date_time_input();
  1652.         }
  1653.     }
  1654.     else
  1655.     {
  1656.         gui_single_line_input_box_previous(wgui_date_time_input_object_focus);
  1657.         wgui_redraw_date_time_input();
  1658.     }
  1659. }
  1660. /*****************************************************************************
  1661.  * FUNCTION
  1662.  *  wgui_date_time_next_character
  1663.  * DESCRIPTION
  1664.  *  move the cursor to next caharcter of date /time input box
  1665.  * PARAMETERS
  1666.  *  void
  1667.  * RETURNS
  1668.  *  void
  1669.  *****************************************************************************/
  1670. void wgui_date_time_next_character(void)
  1671. {
  1672.     /*----------------------------------------------------------------*/
  1673.     /* Local Variables                                                */
  1674.     /*----------------------------------------------------------------*/
  1675.     /*----------------------------------------------------------------*/
  1676.     /* Code Body                                                      */
  1677.     /*----------------------------------------------------------------*/
  1678.     if (wgui_date_time_input_object_focus == NULL)
  1679.     {
  1680.         return;
  1681.     }
  1682.     if (gui_single_line_input_box_test_last_position(wgui_date_time_input_object_focus))
  1683.     {
  1684.         if (wgui_date_time_input_get_next_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
  1685.         {
  1686.             wgui_date_time_input_set_next_focus();
  1687.             wgui_show_date_time_input();
  1688.         }
  1689.     }
  1690.     else
  1691.     {
  1692.         gui_single_line_input_box_next(wgui_date_time_input_object_focus);
  1693.         wgui_redraw_date_time_input();
  1694.     }
  1695. }
  1696. /*****************************************************************************
  1697.  * FUNCTION
  1698.  *  wgui_date_time_toggle_insert_mode
  1699.  * DESCRIPTION
  1700.  *  toggle insert mode of date /time input box
  1701.  * PARAMETERS
  1702.  *  void
  1703.  * RETURNS
  1704.  *  void
  1705.  *****************************************************************************/
  1706. void wgui_date_time_toggle_insert_mode(void)
  1707. {
  1708.     /*----------------------------------------------------------------*/
  1709.     /* Local Variables                                                */
  1710.     /*----------------------------------------------------------------*/
  1711.     /*----------------------------------------------------------------*/
  1712.     /* Code Body                                                      */
  1713.     /*----------------------------------------------------------------*/
  1714.     if (wgui_date_time_input_object_focus == NULL)
  1715.     {
  1716.         return;
  1717.     }
  1718.     gui_single_line_input_box_toggle_insert_mode(wgui_date_time_input_object_focus);
  1719.     wgui_redraw_date_time_input();
  1720. }
  1721. /*****************************************************************************
  1722.  * FUNCTION
  1723.  *  wgui_date_time_delete_current_character
  1724.  * DESCRIPTION
  1725.  *  delete current character of date /time input box
  1726.  * PARAMETERS
  1727.  *  void
  1728.  * RETURNS
  1729.  *  void
  1730.  *****************************************************************************/
  1731. void wgui_date_time_delete_current_character(void)
  1732. {
  1733.     /*----------------------------------------------------------------*/
  1734.     /* Local Variables                                                */
  1735.     /*----------------------------------------------------------------*/
  1736.     /*----------------------------------------------------------------*/
  1737.     /* Code Body                                                      */
  1738.     /*----------------------------------------------------------------*/
  1739.     if (wgui_date_time_input_object_focus == NULL)
  1740.     {
  1741.         return;
  1742.     }
  1743.     gui_single_line_input_box_delete_current_character(wgui_date_time_input_object_focus);
  1744.     wgui_redraw_date_time_input();
  1745.     wgui_date_time_input_callback();
  1746. }
  1747. /*****************************************************************************
  1748.  * FUNCTION
  1749.  *  wgui_date_time_delete_all_characters
  1750.  * DESCRIPTION
  1751.  *  delete all characters of date /time input box
  1752.  * PARAMETERS
  1753.  *  void
  1754.  * RETURNS
  1755.  *  void
  1756.  *****************************************************************************/
  1757. void wgui_date_time_delete_all_characters(void)
  1758. {
  1759.     /*----------------------------------------------------------------*/
  1760.     /* Local Variables                                                */
  1761.     /*----------------------------------------------------------------*/
  1762.     /*----------------------------------------------------------------*/
  1763.     /* Code Body                                                      */
  1764.     /*----------------------------------------------------------------*/
  1765.     if (wgui_date_time_input_object_focus == NULL)
  1766.     {
  1767.         return;
  1768.     }
  1769.     gui_single_line_input_box_delete_all(wgui_date_time_input_object_focus);
  1770.     wgui_redraw_date_time_input();
  1771.     wgui_date_time_input_callback();
  1772. }
  1773. /*****************************************************************************
  1774.  * FUNCTION
  1775.  *  wgui_date_time_numeric_keyboard_input_handler
  1776.  * DESCRIPTION
  1777.  *  handle numeric key inoput of date /time input box
  1778.  * PARAMETERS
  1779.  *  keyc        [IN]        
  1780.  * RETURNS
  1781.  *  void
  1782.  *****************************************************************************/
  1783. void wgui_date_time_numeric_keyboard_input_handler(S32 keyc)
  1784. {
  1785.     /*----------------------------------------------------------------*/
  1786.     /* Local Variables                                                */
  1787.     /*----------------------------------------------------------------*/
  1788.     /*----------------------------------------------------------------*/
  1789.     /* Code Body                                                      */
  1790.     /*----------------------------------------------------------------*/
  1791.     if (keyc >= '0' && keyc <= '9')
  1792.     {
  1793.         wgui_date_time_direct_input((U8) keyc);
  1794.     }
  1795.     else if (keyc == 0x08)
  1796.     {
  1797.         wgui_date_time_delete_character();
  1798.     }
  1799.     else if (keyc == 0x1b)
  1800.     {
  1801.         wgui_date_time_delete_all_characters();
  1802.     }
  1803.     else if (keyc == 0x0d);
  1804. }
  1805. /*****************************************************************************
  1806.  * FUNCTION
  1807.  *  wgui_date_time_handle_key_down
  1808.  * DESCRIPTION
  1809.  *  handle key board input of date /time
  1810.  * PARAMETERS
  1811.  *  k           [IN]        
  1812.  *  S32(?)      [IN]        Keyc
  1813.  * RETURNS
  1814.  *  void
  1815.  *****************************************************************************/
  1816. void wgui_date_time_handle_key_down(MMI_key_code_type k)
  1817. {
  1818.     /*----------------------------------------------------------------*/
  1819.     /* Local Variables                                                */
  1820.     /*----------------------------------------------------------------*/
  1821.     /*----------------------------------------------------------------*/
  1822.     /* Code Body                                                      */
  1823.     /*----------------------------------------------------------------*/
  1824.     wgui_date_time_direct_input((UI_character_type) ('0' + k));
  1825. }
  1826. /*****************************************************************************
  1827.  * FUNCTION
  1828.  *  wgui_date_time_key_handler
  1829.  * DESCRIPTION
  1830.  *  handle key board input of date /time
  1831.  * PARAMETERS
  1832.  *  vkey_code       [IN]        
  1833.  *  key_state       [IN]        
  1834.  * RETURNS
  1835.  *  void
  1836.  *****************************************************************************/
  1837. void wgui_date_time_key_handler(S32 vkey_code, S32 key_state)
  1838. {
  1839. #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
  1840.     /*----------------------------------------------------------------*/
  1841.     /* Local Variables                                                */
  1842.     /*----------------------------------------------------------------*/
  1843.     /*----------------------------------------------------------------*/
  1844.     /* Code Body                                                      */
  1845.     /*----------------------------------------------------------------*/
  1846.     if (key_state)
  1847.     {
  1848.         switch (vkey_code)
  1849.         {
  1850.             case 37:
  1851.                 wgui_date_time_previous_character();
  1852.                 break;
  1853.             case 38:    /* up */
  1854.                 break;
  1855.             case 39:
  1856.                 wgui_date_time_next_character();
  1857.                 break;
  1858.             case 40:    /* down */
  1859.                 break;
  1860.             case 36:    /* home */
  1861.                 break;
  1862.             case 35:    /* end */
  1863.                 break;
  1864.             case 33:    /* page up */
  1865.                 break;
  1866.             case 34:    /* page down */
  1867.                 break;
  1868.             case 45:
  1869.                 wgui_date_time_toggle_insert_mode();
  1870.                 break;
  1871.             case 46:
  1872.                 wgui_date_time_delete_current_character();
  1873.                 break;
  1874.         }
  1875.     }
  1876. #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */ 
  1877.     UI_UNUSED_PARAMETER(vkey_code);
  1878.     UI_UNUSED_PARAMETER(key_state);
  1879. #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */ 
  1880. }
  1881. /*****************************************************************************
  1882.  * FUNCTION
  1883.  *  wgui_date_time_input_register_keys
  1884.  * DESCRIPTION
  1885.  *  register date / time input keys
  1886.  * PARAMETERS
  1887.  *  void
  1888.  * RETURNS
  1889.  *  void
  1890.  *****************************************************************************/
  1891. void wgui_date_time_input_register_keys(void)
  1892. {
  1893.     /*----------------------------------------------------------------*/
  1894.     /* Local Variables                                                */
  1895.     /*----------------------------------------------------------------*/
  1896.     /*----------------------------------------------------------------*/
  1897.     /* Code Body                                                      */
  1898.     /*----------------------------------------------------------------*/
  1899.     register_MMI_key_input_handler();
  1900.     register_key_down_handler(wgui_date_time_handle_key_down);
  1901.     register_keyboard_input_handler(wgui_date_time_numeric_keyboard_input_handler);
  1902.     SetKeyHandler(wgui_date_time_previous_character, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1903.     SetKeyHandler(wgui_date_time_next_character, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1904.     register_keyboard_key_handler(wgui_date_time_key_handler);
  1905. }
  1906. /*****************************************************************************
  1907.  * FUNCTION
  1908.  *  wgui_date_time_input_clear_keys
  1909.  * DESCRIPTION
  1910.  *  clear all register keys of adet /time input box
  1911.  * PARAMETERS
  1912.  *  void
  1913.  * RETURNS
  1914.  *  void
  1915.  *****************************************************************************/
  1916. void wgui_date_time_input_clear_keys(void)
  1917. {
  1918.     /*----------------------------------------------------------------*/
  1919.     /* Local Variables                                                */
  1920.     /*----------------------------------------------------------------*/
  1921.     /*----------------------------------------------------------------*/
  1922.     /* Code Body                                                      */
  1923.     /*----------------------------------------------------------------*/
  1924.     clear_MMI_key_input_handler();
  1925.     clear_key_down_handler();
  1926.     clear_keyboard_input_handler();
  1927.     ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1928.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1929.     clear_keyboard_key_handler();
  1930. }
  1931. /*****************************************************************************
  1932.  * FUNCTION
  1933.  *  register_wgui_date_time_input_callback
  1934.  * DESCRIPTION
  1935.  *  register date/time input callback function
  1936.  * PARAMETERS
  1937.  *  f               [IN]        
  1938.  *  function(?)     [IN]        Pointers
  1939.  * RETURNS
  1940.  *  void
  1941.  *****************************************************************************/
  1942. void register_wgui_date_time_input_callback(void (*f) (void))
  1943. {
  1944.     /*----------------------------------------------------------------*/
  1945.     /* Local Variables                                                */
  1946.     /*----------------------------------------------------------------*/
  1947.     /*----------------------------------------------------------------*/
  1948.     /* Code Body                                                      */
  1949.     /*----------------------------------------------------------------*/
  1950.     wgui_date_time_input_callback = f;
  1951. }
  1952. /*****************************************************************************
  1953.  * FUNCTION
  1954.  *  clear_wgui_date_time_input_callback
  1955.  * DESCRIPTION
  1956.  *  clear date time input callback function
  1957.  * PARAMETERS
  1958.  *  void
  1959.  * RETURNS
  1960.  *  void
  1961.  *****************************************************************************/
  1962. void clear_wgui_date_time_input_callback(void)
  1963. {
  1964.     /*----------------------------------------------------------------*/
  1965.     /* Local Variables                                                */
  1966.     /*----------------------------------------------------------------*/
  1967.     /*----------------------------------------------------------------*/
  1968.     /* Code Body                                                      */
  1969.     /*----------------------------------------------------------------*/
  1970.     wgui_date_time_input_callback = UI_dummy_function;
  1971. }
  1972. /*****************************************************************************
  1973.  * FUNCTION
  1974.  *  get_year
  1975.  * DESCRIPTION
  1976.  *  return year of UI_time pass as parameter
  1977.  * PARAMETERS
  1978.  *  t       [IN]        
  1979.  * RETURNS
  1980.  *  void
  1981.  *****************************************************************************/
  1982. /* Date and time display related code  */
  1983. U16 get_year(UI_time *t)
  1984. {
  1985.     /*----------------------------------------------------------------*/
  1986.     /* Local Variables                                                */
  1987.     /*----------------------------------------------------------------*/
  1988.     /*----------------------------------------------------------------*/
  1989.     /* Code Body                                                      */
  1990.     /*----------------------------------------------------------------*/
  1991.     return (t->nYear);
  1992. }
  1993. /*****************************************************************************
  1994.  * FUNCTION
  1995.  *  get_month
  1996.  * DESCRIPTION
  1997.  *  return month of UI_time pass as parameter
  1998.  * PARAMETERS
  1999.  *  t       [IN]        
  2000.  * RETURNS
  2001.  *  void
  2002.  *****************************************************************************/
  2003. U16 get_month(UI_time *t)
  2004. {
  2005.     /*----------------------------------------------------------------*/
  2006.     /* Local Variables                                                */
  2007.     /*----------------------------------------------------------------*/
  2008.     /*----------------------------------------------------------------*/
  2009.     /* Code Body                                                      */
  2010.     /*----------------------------------------------------------------*/
  2011.     return (t->nMonth);
  2012. }
  2013. /*****************************************************************************
  2014.  * FUNCTION
  2015.  *  get_day
  2016.  * DESCRIPTION
  2017.  *  return day of UI_time pass as parameter
  2018.  * PARAMETERS
  2019.  *  t       [IN]        
  2020.  * RETURNS
  2021.  *  void
  2022.  *****************************************************************************/
  2023. U16 get_day(UI_time *t)
  2024. {
  2025.     /*----------------------------------------------------------------*/
  2026.     /* Local Variables                                                */
  2027.     /*----------------------------------------------------------------*/
  2028.     /*----------------------------------------------------------------*/
  2029.     /* Code Body                                                      */
  2030.     /*----------------------------------------------------------------*/
  2031.     return (t->nDay);
  2032. }
  2033. /*****************************************************************************
  2034.  * FUNCTION
  2035.  *  get_hours
  2036.  * DESCRIPTION
  2037.  *  return hours of UI_time pass as parameter
  2038.  * PARAMETERS
  2039.  *  t       [IN]        
  2040.  * RETURNS
  2041.  *  void
  2042.  *****************************************************************************/
  2043. U16 get_hours(UI_time *t)
  2044. {
  2045.     /*----------------------------------------------------------------*/
  2046.     /* Local Variables                                                */
  2047.     /*----------------------------------------------------------------*/
  2048.     /*----------------------------------------------------------------*/
  2049.     /* Code Body                                                      */
  2050.     /*----------------------------------------------------------------*/
  2051.     return (t->nHour);
  2052. }
  2053. /*****************************************************************************
  2054.  * FUNCTION
  2055.  *  get_minutes
  2056.  * DESCRIPTION
  2057.  *  return minutes of UI_time pass as parameter
  2058.  * PARAMETERS
  2059.  *  t       [IN]        
  2060.  * RETURNS
  2061.  *  void
  2062.  *****************************************************************************/
  2063. U16 get_minutes(UI_time *t)
  2064. {
  2065.     /*----------------------------------------------------------------*/
  2066.     /* Local Variables                                                */
  2067.     /*----------------------------------------------------------------*/
  2068.     /*----------------------------------------------------------------*/
  2069.     /* Code Body                                                      */
  2070.     /*----------------------------------------------------------------*/
  2071.     return (t->nMin);
  2072. }
  2073. /*****************************************************************************
  2074.  * FUNCTION
  2075.  *  get_seconds
  2076.  * DESCRIPTION
  2077.  *  return seconds of UI_time pass as parameter
  2078.  * PARAMETERS
  2079.  *  t       [IN]        
  2080.  * RETURNS
  2081.  *  void
  2082.  *****************************************************************************/
  2083. U16 get_seconds(UI_time *t)
  2084. {
  2085.     /*----------------------------------------------------------------*/
  2086.     /* Local Variables                                                */
  2087.     /*----------------------------------------------------------------*/
  2088.     /*----------------------------------------------------------------*/
  2089.     /* Code Body                                                      */
  2090.     /*----------------------------------------------------------------*/
  2091.     return (t->nSec);
  2092. }
  2093. /*****************************************************************************
  2094.  * FUNCTION
  2095.  *  get_dayofweek
  2096.  * DESCRIPTION
  2097.  *  return day of week  of UI_time pass as parameter
  2098.  * PARAMETERS
  2099.  *  t       [IN]        
  2100.  * RETURNS
  2101.  *  void
  2102.  *****************************************************************************/
  2103. U16 get_dayofweek(UI_time *t)
  2104. {
  2105.     /*----------------------------------------------------------------*/
  2106.     /* Local Variables                                                */
  2107.     /*----------------------------------------------------------------*/
  2108.     /*----------------------------------------------------------------*/
  2109.     /* Code Body                                                      */
  2110.     /*----------------------------------------------------------------*/
  2111.     return (t->DayIndex);
  2112. }
  2113. /*****************************************************************************
  2114.  * FUNCTION
  2115.  *  date_string
  2116.  * DESCRIPTION
  2117.  *  get date time string for different requirement
  2118.  * PARAMETERS
  2119.  *  time        [IN]        Date time to convert
  2120.  *  string      [OUT]       Date time string
  2121.  *  flags       [IN]        Date time type
  2122.  * RETURNS
  2123.  *  void
  2124.  *****************************************************************************/
  2125. void date_string(UI_time *time, UI_string_type string, U32 flags)
  2126. {
  2127.     /*----------------------------------------------------------------*/
  2128.     /* Local Variables                                                */
  2129.     /*----------------------------------------------------------------*/
  2130.     U16 day, month, year, day_index;
  2131.     S8 ts[32];
  2132. #ifdef __MMI_SUBLCD__
  2133.     /* MAUI_00169917 START */
  2134.     S8 as[64];
  2135.     U8 Tempbuffer[64];
  2136.     /* MAUI_00169917 END */
  2137.     U8 *day_name = NULL;
  2138. #endif /* __MMI_SUBLCD__ */ 
  2139. #ifdef __MMI_DATE_TIME_IN_DIFF_LANG__
  2140.     S8 ts2[32];
  2141. #endif 
  2142. #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
  2143.     U8 month_str[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
  2144. #else 
  2145.     UI_string_type month_str;
  2146. #endif 
  2147.     /*----------------------------------------------------------------*/
  2148.     /* Code Body                                                      */
  2149.     /*----------------------------------------------------------------*/
  2150.     day_index = get_dayofweek(time);
  2151.     day = get_day(time);
  2152.     month = get_month(time);
  2153.     year = get_year(time);
  2154.     if (month > 12 || month < 1)
  2155.     {
  2156.         month = 1;
  2157.     }
  2158.     switch (flags & DT_FLAGS_TYPE)
  2159.     {
  2160.       /***** MainLCD DataTime *****/
  2161.         case DT_IDLE_SCREEN:
  2162.         case DT_IDLE_SCREEN_ENGLISH_ONLY:
  2163.         case DT_NETWORK_SEARCH:
  2164.         case DT_MO_CALL_SCREEN:
  2165.         case DT_MO_CALLING_SCREEN:
  2166.         case DT_TABBED_CALL_SCREEN:
  2167.         case DT_MT_CALL_SCREEN:
  2168.         case DT_ACTIVE_CALL_SCREEN:
  2169.         case DT_DIGITAL_CLOCK_SC1:
  2170.         case DT_DIGITAL_CLOCK_SC2:
  2171.         case DT_DIGITAL_CLOCK_SC3:
  2172.         case DT_ANALOG_CLOCK_SC:
  2173.         {
  2174.             switch (PhnsetGetDateFormat())  /* Get the current format of date */
  2175.             {
  2176.                 case 0:
  2177.             #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
  2178.                     sprintf((S8*) ts, "%02d-%3s-%04d", day, month_str[month - 1], year);
  2179.                     AnsiiToUnicodeString((S8*) string, ts);
  2180.                     break;
  2181.             #else /* __MMI_DATE_TIME_IN_DIFF_LANG__ */ 
  2182.                     sprintf((S8*) ts, "%02d-", day);
  2183.                     AnsiiToUnicodeString((S8*) string, ts);
  2184.                     if ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY)
  2185.                     {
  2186.                         month_str = get_string_lang((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month), (S8*) "*#0044#");
  2187.                     }
  2188.                     else
  2189.                     {
  2190.                         month_str = get_string((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month));
  2191.                     }
  2192.                     if (month_str)
  2193.                     {
  2194.                         UI_strcat(string, month_str);
  2195.                     }
  2196.                     sprintf((S8*) ts, "-%04d", year);
  2197.                     AnsiiToUnicodeString((S8*) ts2, ts);
  2198.                     UI_strcat(string, (UI_string_type) ts2);
  2199.                     break;
  2200.             #endif /* __MMI_DATE_TIME_IN_DIFF_LANG__ */ 
  2201.                 case 1:
  2202.                     sprintf((S8*) ts, "%02d/%02d/%04d", day, month, year);
  2203.                     AnsiiToUnicodeString((S8*) string, ts);
  2204.                     break;
  2205.                 case 2:
  2206.                     sprintf((S8*) ts, "%02d/%02d/%04d", month, day, year);
  2207.                     AnsiiToUnicodeString((S8*) string, ts);
  2208.                     break;
  2209.                 case 3:
  2210.                     sprintf((S8*) ts, "%04d/%02d/%02d", year, month, day);
  2211.                     AnsiiToUnicodeString((S8*) string, ts);
  2212.                     break;
  2213.                 case 4:
  2214.                     sprintf((S8*) ts, "%04d-%02d-%02d", year, month, day);
  2215.                     AnsiiToUnicodeString((S8*) string, ts);
  2216.                     break;
  2217.                 case 5:
  2218.                 #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
  2219.                     sprintf((S8*) ts, "%3s %02d, %04d", month_str[month - 1], day, year);
  2220.                     AnsiiToUnicodeString((S8*) string, ts);
  2221.                     break;
  2222.                 #else /* __MMI_DATE_TIME_IN_DIFF_LANG__ */ 
  2223.                     sprintf((S8*) ts, " %02d, %04d", day, year);
  2224.                     if ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY)
  2225.                     {
  2226.                         month_str = get_string_lang((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month), (S8*) "*#0044#");
  2227.                     }
  2228.                     else
  2229.                     {
  2230.                         month_str = get_string((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month));
  2231.                     }
  2232.                     if (month_str)
  2233.                     {
  2234.                         UI_strcpy(string, month_str);
  2235.                     }
  2236.                     else
  2237.                     {
  2238.                         UI_strcpy(string, L"");
  2239.                     }
  2240.                     AnsiiToUnicodeString((S8*) ts2, ts);
  2241.                     UI_strcat(string, (UI_string_type) ts2);
  2242.                     break;
  2243.                 #endif /* __MMI_DATE_TIME_IN_DIFF_LANG__ */ 
  2244.             }
  2245.         }
  2246.             break;
  2247.         case DT_IDLE_SCREEN_2:
  2248.         {
  2249.             switch (PhnsetGetDateFormat())
  2250.             {
  2251.                 case 0:
  2252.                 case 1:
  2253.                     sprintf((S8*) ts, "%02d %3s", day, month_str[month - 1]);
  2254.                     AnsiiToUnicodeString((S8*) string, ts);
  2255.                     break;
  2256.                 case 2:
  2257.                 case 3:
  2258.                 case 4:
  2259.                 case 5:
  2260.                     sprintf((S8*) ts, "%3s %02d", month_str[month - 1], day);
  2261.                     AnsiiToUnicodeString((S8*) string, ts);
  2262.                     break;
  2263.             }
  2264.         }
  2265.             break;
  2266.     #ifdef __MMI_SUBLCD__
  2267.       /***** SubLCD DataTime *****/
  2268.         case DT_SUBLCD_IDLE_SCREEN1:
  2269.         case DT_SUBLCD_IDLE_SCREEN2:
  2270.         case DT_SUBLCD_IDLE_SCREEN3:
  2271.         case DT_SUBLCD_IDLE_SCREEN4:
  2272.         {
  2273.             if (IsChineseSet()) /* check if current language is chinese or not */
  2274.             {
  2275.                 switch (day_index)
  2276.                 {
  2277.                     case 0:
  2278.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_SUNDAY);
  2279.                         break;
  2280.                     case 1:
  2281.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_MONDAY);
  2282.                         break;
  2283.                     case 2:
  2284.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_TUESDAY);
  2285.                         break;
  2286.                     case 3:
  2287.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_WEDNESDAY);
  2288.                         break;
  2289.                     case 4:
  2290.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_THURSDAY);
  2291.                         break;
  2292.                     case 5:
  2293.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_FRIDAY);
  2294.                         break;
  2295.                     case 6:
  2296.                         day_name = (PU8) GetString(STR_SUBLCD_CHI_SATURDAY);
  2297.                         break;
  2298.                 }
  2299.             }
  2300.             else
  2301.             {
  2302.                 /* not chinese */
  2303.                 switch (day_index)
  2304.                 {
  2305.                     case 0:
  2306.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_SUNDAY);
  2307.                         break;
  2308.                     case 1:
  2309.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_MONDAY);
  2310.                         break;
  2311.                     case 2:
  2312.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_TUESDAY);
  2313.                         break;
  2314.                     case 3:
  2315.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_WEDNESDAY);
  2316.                         break;
  2317.                     case 4:
  2318.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_THURSDAY);
  2319.                         break;
  2320.                     case 5:
  2321.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_FRIDAY);
  2322.                         break;
  2323.                     case 6:
  2324.                         day_name = (PU8) GetString(STR_SUBLCD_ENG_SATURDAY);
  2325.                         break;
  2326.                 }
  2327.             }   /* end of check chiese */
  2328.             /* MAUI_00169917 START */
  2329.             pfnUnicodeStrcpy((S8*) as, (S8*) day_name);
  2330.             /* MAUI_00169917 END */
  2331.             if ((flags & DT_FLAGS_TYPE) == DT_SUBLCD_IDLE_SCREEN3)
  2332.             {
  2333.                 year %= 100;
  2334.                 switch (PhnsetGetDateFormat())  /* Get the current format of date */
  2335.                 {
  2336.                     case 0:
  2337.                     case 1:
  2338.                         /* MAUI_00169917 START */
  2339.                         sprintf((S8*) ts, "%02d/%02d/%02d", day, month, year);
  2340.                         AnsiiToUnicodeString((S8*) Tempbuffer, ts);
  2341.                         pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
  2342.                         /* MAUI_00169917 END */
  2343.                         break;
  2344.                     case 2:
  2345.                     case 5:
  2346.                         /* MAUI_00169917 START */
  2347.                         sprintf((S8*) ts, "%02d/%02d/%02d", month, day, year);
  2348.                         AnsiiToUnicodeString((S8*) Tempbuffer, ts);
  2349.                         pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
  2350.                         /* MAUI_00169917 END */
  2351.                         break;
  2352.                     case 3:
  2353.                     case 4:
  2354.                         /* MAUI_00169917 START */
  2355.                         sprintf((S8*) ts, "%02d/%02d/%02d", year, month, day);
  2356.                         AnsiiToUnicodeString((S8*) Tempbuffer, ts);
  2357.                         pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
  2358.                         /* MAUI_00169917 END */
  2359.                         break;
  2360.                 }
  2361.             }
  2362.             /* 101804 MTK Calvin added */
  2363.             else if ((flags & DT_FLAGS_TYPE) == DT_SUBLCD_IDLE_SCREEN2)
  2364.             {
  2365.                 year %= 100;
  2366.                 switch (PhnsetGetDateFormat())  /* Get the current format of date */
  2367.                 {
  2368.                     case 0:
  2369.                     case 1:
  2370.                         /* MAUI_00169917 START */
  2371.                         sprintf((S8*) ts, "%02d/%02d", day, month);
  2372.                         AnsiiToUnicodeString((S8*) Tempbuffer, ts);
  2373.                         pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
  2374.                         /* MAUI_00169917 END */
  2375.                         break;
  2376.                     case 2:
  2377.                     case 3:
  2378.                     case 4:
  2379.                     case 5:
  2380.                         /* MAUI_00169917 START */
  2381.                         sprintf((S8*) ts, "%02d/%02d", month, day);
  2382.                         AnsiiToUnicodeString((S8*) Tempbuffer, ts);
  2383.                         pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
  2384.                         /* MAUI_00169917 END */
  2385.                         break;
  2386.                 }
  2387.             }
  2388.             /* MTK Calvin end */
  2389.             else
  2390.             {
  2391.                 /* MAUI_00169917 START */
  2392.                 sprintf((S8*) ts, "%02d/%02d", day, month);
  2393.                 AnsiiToUnicodeString((S8*) Tempbuffer, ts);
  2394.                 pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
  2395.                 /* MAUI_00169917 END */
  2396.             }
  2397.             /* MAUI_00169917 START */
  2398.             pfnUnicodeStrcpy((S8*) string, (S8*) as);
  2399.             /* MAUI_00169917 END */
  2400.             break;
  2401.         }
  2402.             /* break; */
  2403.     #endif /* __MMI_SUBLCD__ */ 
  2404.       /***** FileManager DataTime *****/
  2405.         case DT_FILEMANAGER:
  2406.         {
  2407.             year %= 100;
  2408.             switch (PhnsetGetDateFormat())  /* Get the current format of date */
  2409.             {
  2410.                 case 0:
  2411.                 case 1:
  2412.                     sprintf((S8*) ts, "%02d/%02d/%02d", day, month, year);
  2413.                     break;
  2414.                 case 2:
  2415.                 case 5:
  2416.                     sprintf((S8*) ts, "%02d/%02d/%02d", month, day, year);
  2417.                     break;
  2418.                 case 3:
  2419.                 case 4:
  2420.                     sprintf((S8*) ts, "%02d/%02d/%02d", year, month, day);
  2421.                     break;
  2422.             }   /* end of switch */
  2423.             AnsiiToUnicodeString((S8*) string, ts);
  2424.             break;
  2425.         }
  2426.             /* break; */
  2427.     }
  2428. }
  2429. /*****************************************************************************
  2430.  * FUNCTION
  2431.  *  time_string
  2432.  * DESCRIPTION
  2433.  *  convert time to string accoding to current time format
  2434.  * PARAMETERS
  2435.  *  t           [IN]        Date to convets
  2436.  *  s           [OUT]       String format of time
  2437.  *  flags       [IN]        Date type
  2438.  * RETURNS
  2439.  *  void
  2440.  *****************************************************************************/
  2441. void time_string(UI_time *t, UI_string_type s, U32 flags)
  2442. {
  2443.     /*----------------------------------------------------------------*/
  2444.     /* Local Variables                                                */
  2445.     /*----------------------------------------------------------------*/
  2446.     U16 hours, minutes;
  2447. #ifdef __MMI_DATE_TIME_IN_DIFF_LANG__
  2448.     UI_string_type postfix;
  2449. #endif 
  2450.     S8 ts[32];
  2451.     /*----------------------------------------------------------------*/
  2452.     /* Code Body                                                      */
  2453.     /*----------------------------------------------------------------*/
  2454.     hours = get_hours(t);
  2455.     minutes = get_minutes(t);
  2456.     switch (flags & DT_FLAGS_TYPE)
  2457.     {
  2458.         case DT_IDLE_SCREEN:
  2459.         case DT_IDLE_SCREEN_2:
  2460.         case DT_IDLE_SCREEN_ENGLISH_ONLY:
  2461.         case DT_NETWORK_SEARCH:
  2462.         case DT_MO_CALL_SCREEN:
  2463.         case DT_MO_CALLING_SCREEN:
  2464.         case DT_MT_CALL_SCREEN:
  2465.         case DT_ACTIVE_CALL_SCREEN:
  2466.         case DT_TABBED_CALL_SCREEN:
  2467.         case DT_DIGITAL_CLOCK_SC1:
  2468.         case DT_DIGITAL_CLOCK_SC2:
  2469.         case DT_DIGITAL_CLOCK_SC3:
  2470.         case DT_ANALOG_CLOCK_SC:
  2471.             if (PhnsetGetTimeFormat())  /* get current time format */
  2472.             {
  2473.                 sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2474.                 AnsiiToUnicodeString((S8*) s, ts);
  2475.             }
  2476.             else
  2477.             {
  2478.             #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
  2479.                 if (hours == 12)
  2480.                 {
  2481.                     sprintf((S8*) ts, "%02d:%02d PM", hours, minutes);
  2482.                 }
  2483.                 else if (hours == 0)
  2484.                 {
  2485.                     sprintf((S8*) ts, "%02d:%02d AM", 12, minutes);
  2486.                 }
  2487.                 else if (hours > 12)
  2488.                 {
  2489.                     sprintf((S8*) ts, "%02d:%02d PM", hours - 12, minutes);
  2490.                 }
  2491.                 else
  2492.                 {
  2493.                     sprintf((S8*) ts, "%02d:%02d AM", hours, minutes);
  2494.                 }
  2495.                 AnsiiToUnicodeString((S8*) s, ts);
  2496.             #else /* __MMI_DATE_TIME_IN_DIFF_LANG__ */ 
  2497.                 if (hours == 12)
  2498.                 {
  2499.                     sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2500.                 }
  2501.                 else if (hours == 0)
  2502.                 {
  2503.                     sprintf((S8*) ts, "%02d:%02d", 12, minutes);
  2504.                 }
  2505.                 else if (hours > 12)
  2506.                 {
  2507.                     sprintf((S8*) ts, "%02d:%02d", hours - 12, minutes);
  2508.                 }
  2509.                 else
  2510.                 {
  2511.                     sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2512.                 }
  2513.                 AnsiiToUnicodeString((S8*) s, ts);
  2514.                 if (hours >= 12)
  2515.                 {
  2516.                     postfix = ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY) ?
  2517.                         (UI_string_type) get_string_lang(STR_GUI_TIME_PM, (S8*) "*#0044#") :
  2518.                         (UI_string_type) get_string(STR_GUI_TIME_PM);
  2519.                 }
  2520.                 else
  2521.                 {
  2522.                     postfix = ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY) ?
  2523.                         (UI_string_type) get_string_lang(STR_GUI_TIME_AM, (S8*) "*#0044#") :
  2524.                         (UI_string_type) get_string(STR_GUI_TIME_AM);
  2525.                 }
  2526.                 if (postfix)
  2527.                 {
  2528.                     UI_strcat((UI_string_type) s, postfix);
  2529.                 }
  2530.             #endif /* __MMI_DATE_TIME_IN_DIFF_LANG__ */ 
  2531.             }
  2532.             break;
  2533.         #ifdef __MMI_SUBLCD__
  2534.         case DT_SUBLCD_IDLE_SCREEN1:
  2535.         case DT_SUBLCD_IDLE_SCREEN2:
  2536.         case DT_SUBLCD_IDLE_SCREEN3:
  2537.             if (PhnsetGetTimeFormat())
  2538.             {
  2539.                 sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2540.             }
  2541.             else
  2542.             {
  2543.                 S32 width, height;
  2544.                 if (hours == 12)
  2545.                 {
  2546.                     sprintf((S8*) ts, "%02d:%02d PM", hours, minutes);
  2547.                 }
  2548.                 else if (hours == 0)
  2549.                 {
  2550.                     sprintf((S8*) ts, "%02d:%02d AM", 12, minutes);
  2551.                 }
  2552.                 else if (hours > 12)
  2553.                 {
  2554.                     sprintf((S8*) ts, "%02d:%02d PM", hours - 12, minutes);
  2555.                 }
  2556.                 else
  2557.                 {
  2558.                     sprintf((S8*) ts, "%02d:%02d AM", hours, minutes);
  2559.                 }
  2560.                 gui_measure_string((UI_string_type) ts, &width, &height);
  2561.                 if (width > SUB_LCD_device_width)
  2562.                 {
  2563.                     if (hours == 12)
  2564.                     {
  2565.                         sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2566.                     }
  2567.                     else if (hours == 0)
  2568.                     {
  2569.                         sprintf((S8*) ts, "%02d:%02d", 12, minutes);
  2570.                     }
  2571.                     else if (hours > 12)
  2572.                     {
  2573.                         sprintf((S8*) ts, "%02d:%02d", hours - 12, minutes);
  2574.                     }
  2575.                     else
  2576.                     {
  2577.                         sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2578.                     }
  2579.                 }
  2580.             }
  2581.             AnsiiToUnicodeString((S8*) s, ts);
  2582.             break;
  2583.         case DT_SUBLCD_IDLE_SCREEN4:
  2584.             if (PhnsetGetTimeFormat())
  2585.             {
  2586.                 sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2587.             }
  2588.             else
  2589.             {
  2590.                 if (hours == 12)
  2591.                 {
  2592.                     sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2593.                 }
  2594.                 else if (hours == 0)
  2595.                 {
  2596.                     sprintf((S8*) ts, "%02d:%02d", 12, minutes);
  2597.                 }
  2598.                 else if (hours > 12)
  2599.                 {
  2600.                     sprintf((S8*) ts, "%02d:%02d", hours - 12, minutes);
  2601.                 }
  2602.                 else
  2603.                 {
  2604.                     sprintf((S8*) ts, "%02d:%02d", hours, minutes);
  2605.                 }
  2606.             }
  2607.             AnsiiToUnicodeString((S8*) s, ts);
  2608.             break;
  2609.         #endif /* __MMI_SUBLCD__ */ 
  2610.     }
  2611. }
  2612. /*****************************************************************************
  2613.  * FUNCTION
  2614.  *  duration_string
  2615.  * DESCRIPTION
  2616.  *  
  2617.  * PARAMETERS
  2618.  *  t           [?]         
  2619.  *  s           [IN]        
  2620.  *  flags       [IN]        
  2621.  * RETURNS
  2622.  *  void
  2623.  *****************************************************************************/
  2624. void duration_string(UI_time *t, UI_string_type s, U32 flags)
  2625. {
  2626.     /*----------------------------------------------------------------*/
  2627.     /* Local Variables                                                */
  2628.     /*----------------------------------------------------------------*/
  2629.     U16 hours, minutes, seconds;
  2630.     S8 ts[32];
  2631.     /*----------------------------------------------------------------*/
  2632.     /* Code Body                                                      */
  2633.     /*----------------------------------------------------------------*/
  2634.     hours = get_hours(t);
  2635.     minutes = get_minutes(t);
  2636.     seconds = get_seconds(t);
  2637.     switch (flags & DT_FLAGS_TYPE)
  2638.     {
  2639.         case DT_IDLE_SCREEN:
  2640.         case DT_IDLE_SCREEN_ENGLISH_ONLY:
  2641.         case DT_NETWORK_SEARCH:
  2642.         case DT_MO_CALL_SCREEN:
  2643.         case DT_MO_CALLING_SCREEN:
  2644.         case DT_MT_CALL_SCREEN:
  2645.         case DT_ACTIVE_CALL_SCREEN:
  2646.         case DT_TABBED_CALL_SCREEN:
  2647.     #ifdef __MMI_SUBLCD__
  2648.         case DT_SUBLCD_IDLE_SCREEN1:
  2649.         case DT_SUBLCD_IDLE_SCREEN2:
  2650.     #endif /* __MMI_SUBLCD__ */ 
  2651.             sprintf((S8*) ts, "%02d:%02d:%02d", hours, minutes, seconds);
  2652.             break;
  2653.         case DT_AUDIO_PLAY_DURATION:
  2654.             sprintf((S8*) ts, "%02d:%02d", minutes, seconds);
  2655.             break;
  2656.     }
  2657.     AnsiiToUnicodeString((S8*) s, ts);
  2658. }
  2659. /*****************************************************************************
  2660.  * FUNCTION
  2661.  *  get_time_difference2
  2662.  * DESCRIPTION
  2663.  *  
  2664.  * PARAMETERS
  2665.  *  new_time        [?]     
  2666.  *  ref_time        [?]     
  2667.  *  diff_time       [?]     
  2668.  * RETURNS
  2669.  *  void
  2670.  *****************************************************************************/
  2671. void get_time_difference2(UI_time *new_time, UI_time *ref_time, UI_time *diff_time)
  2672. {
  2673.     /*----------------------------------------------------------------*/
  2674.     /* Local Variables                                                */
  2675.     /*----------------------------------------------------------------*/
  2676.     U8 min_flag = 0, hour_flag = 0;
  2677.     /*----------------------------------------------------------------*/
  2678.     /* Code Body                                                      */
  2679.     /*----------------------------------------------------------------*/
  2680.     if (new_time->nSec >= ref_time->nSec)
  2681.     {
  2682.         diff_time->nSec = new_time->nSec - ref_time->nSec;
  2683.     }
  2684.     else
  2685.     {
  2686.         diff_time->nSec = new_time->nSec + 60 - ref_time->nSec;
  2687.         min_flag = 1;
  2688.     }
  2689.     if (new_time->nMin >= ref_time->nMin + min_flag)
  2690.     {
  2691.         diff_time->nMin = new_time->nMin - ref_time->nMin - min_flag;
  2692.     }
  2693.     else
  2694.     {
  2695.         diff_time->nMin = new_time->nMin + 60 - ref_time->nMin - min_flag;
  2696.         hour_flag = 1;
  2697.     }
  2698.     if (new_time->nHour >= ref_time->nHour + hour_flag)
  2699.     {
  2700.         diff_time->nHour = new_time->nHour - ref_time->nHour - hour_flag;
  2701.     }
  2702.     else
  2703.     {
  2704.         diff_time->nHour = new_time->nHour + 24 - ref_time->nHour - hour_flag;
  2705.         new_time->nDay -= 1;
  2706.     }
  2707.     diff_time->nDay = 0;
  2708.     diff_time->nMonth = 0;
  2709.     diff_time->nYear = 0;
  2710.     diff_time->DayIndex = 0;
  2711. }
  2712. /*****************************************************************************
  2713.  * FUNCTION
  2714.  *  increment_seconds
  2715.  * DESCRIPTION
  2716.  *  increment the seconds by 1
  2717.  * PARAMETERS
  2718.  *  t       [IN]        
  2719.  * RETURNS
  2720.  *  void
  2721.  *****************************************************************************/
  2722. void increment_seconds(UI_time *t)
  2723. {
  2724.     /*----------------------------------------------------------------*/
  2725.     /* Local Variables                                                */
  2726.     /*----------------------------------------------------------------*/
  2727.     UI_time curr_time, diff_time;
  2728.     /*----------------------------------------------------------------*/
  2729.     /* Code Body                                                      */
  2730.     /*----------------------------------------------------------------*/
  2731.     DTGetRTCTime(&curr_time);
  2732.     get_time_difference2(&curr_time, &last_duration_time, &diff_time);
  2733.     IncrementTime(*t, diff_time, t );
  2734.     last_duration_time.nSec = curr_time.nSec;
  2735.     last_duration_time.nMin = curr_time.nMin;
  2736.     last_duration_time.nHour = curr_time.nHour;
  2737.     last_duration_time.nDay = curr_time.nDay;
  2738.     last_duration_time.nMonth = curr_time.nMonth;
  2739.     last_duration_time.DayIndex = curr_time.DayIndex;
  2740. }
  2741. /*****************************************************************************
  2742.  * FUNCTION
  2743.  *  increment_ticks
  2744.  * DESCRIPTION
  2745.  *  
  2746.  * PARAMETERS
  2747.  *  t       [?]     
  2748.  * RETURNS
  2749.  *  void
  2750.  *****************************************************************************/
  2751. void increment_ticks(UI_time *t)
  2752. {
  2753.     /*----------------------------------------------------------------*/
  2754.     /* Local Variables                                                */
  2755.     /*----------------------------------------------------------------*/
  2756.     U32 current_time;
  2757.     U32 secs, mins, hrs;
  2758.     /*----------------------------------------------------------------*/
  2759.     /* Code Body                                                      */
  2760.     /*----------------------------------------------------------------*/
  2761.     kal_get_time(&current_time);
  2762.     secs = (U32) ((current_time - last_duration_ticks + last_duration) * 0.004615 + 0.5);
  2763.     mins = secs / 60;
  2764.     hrs = mins / 60;
  2765.     t->nSec = (U8) (secs - mins * 60);
  2766.     t->nMin = (U8) (mins - hrs * 60);
  2767.     t->nHour = (U8) hrs;
  2768.     t->nYear = t->nMonth = t->nDay = 0;
  2769. }
  2770. FLOAT dt_difference1;
  2771. FLOAT dt_difference2;
  2772. #ifdef __MMI_SUBLCD__
  2773. /*****************************************************************************
  2774.  * FUNCTION
  2775.  *  get_time_difference
  2776.  * DESCRIPTION
  2777.  *  calculate time difference between two times pass as parameter
  2778.  * PARAMETERS
  2779.  *  time_303            [?]         
  2780.  *  city_diff_time      [IN]        
  2781.  * RETURNS
  2782.  *  void
  2783.  *****************************************************************************/
  2784. void get_time_difference(MYTIME *time_303, FLOAT city_diff_time)
  2785. {
  2786.     /*----------------------------------------------------------------*/
  2787.     /* Local Variables                                                */
  2788.     /*----------------------------------------------------------------*/
  2789.     S32 total_time, hour_sublcd1, min_sublcd1;
  2790.     /*----------------------------------------------------------------*/
  2791.     /* Code Body                                                      */
  2792.     /*----------------------------------------------------------------*/
  2793.     total_time = ((time_303->nHour * 60) + time_303->nMin) + ((S32) (city_diff_time * 60));
  2794.     if (total_time < 0)
  2795.     {
  2796.         total_time = 1440 + total_time;
  2797.     }
  2798.     if (total_time > 1440)
  2799.     {
  2800.         total_time = total_time - 1440;
  2801.     }
  2802.     hour_sublcd1 = total_time / 60;
  2803.     min_sublcd1 = total_time % 60;
  2804.     time_303->nHour = (U8) hour_sublcd1;
  2805.     time_303->nMin = (U8) min_sublcd1;
  2806. }
  2807. #endif /* __MMI_SUBLCD__ */ 
  2808. /*****************************************************************************
  2809.  * FUNCTION
  2810.  *  set_time_difference
  2811.  * DESCRIPTION
  2812.  *  set value of output parameter equal to input parameter
  2813.  * PARAMETERS
  2814.  *  t           [OUT]       
  2815.  *  diff        [IN]        
  2816.  * RETURNS
  2817.  *  void
  2818.  *****************************************************************************/
  2819. void set_time_difference(MYTIME *t, MYTIME *diff)
  2820. {
  2821.     /*----------------------------------------------------------------*/
  2822.     /* Local Variables                                                */
  2823.     /*----------------------------------------------------------------*/
  2824.     /*----------------------------------------------------------------*/
  2825.     /* Code Body                                                      */
  2826.     /*----------------------------------------------------------------*/
  2827.     *t = *diff;
  2828. }
  2829. #ifdef __MMI_ANALOG_CLOCK__
  2830. /* Externals for Analog clock */
  2831. void analog_clock_minute_tick(void);
  2832. void analog_clock_screen_saver_update_display(void);
  2833. void show_analog_clock(void);
  2834. /*****************************************************************************
  2835.  * FUNCTION
  2836.  *  dt_update_analog_clock
  2837.  * DESCRIPTION
  2838.  *  update tiem of analog clock
  2839.  * PARAMETERS
  2840.  *  void
  2841.  * RETURNS
  2842.  *  void
  2843.  *****************************************************************************/
  2844. void dt_update_analog_clock(void)
  2845. {
  2846.     /*----------------------------------------------------------------*/
  2847.     /* Local Variables                                                */
  2848.     /*----------------------------------------------------------------*/
  2849.     /*----------------------------------------------------------------*/
  2850.     /* Code Body                                                      */
  2851.     /*----------------------------------------------------------------*/
  2852.     analog_clock_minute_tick();
  2853.     GetDateTime(&main_LCD_dt_object.date.t);
  2854.     main_LCD_dt_object.time.t = main_LCD_dt_object.date.t;
  2855. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  2856.     set_day_display();
  2857. #endif 
  2858. }
  2859. #endif /* __MMI_ANALOG_CLOCK__ */ 
  2860. /*----------------------------------------------------------------------------
  2861. Function:         MMI_main_LCD_dt_hide_function
  2862. Description:      function pointer of main lcd date hide function
  2863. Input Parameters: none
  2864. Output Parameters:   none
  2865. Returns:       none
  2866. ----------------------------------------------------------------------------*/
  2867. void (*MMI_main_LCD_dt_hide_function) (void) = UI_dummy_function;
  2868. /*----------------------------------------------------------------------------
  2869. Function:         MMI_main_LCD_dt_update_function
  2870. Description:      function pointer of main lcd date update  function
  2871. Input Parameters: none
  2872. Output Parameters:   none
  2873. Returns:       none
  2874. ----------------------------------------------------------------------------*/
  2875. void (*MMI_main_LCD_dt_update_function) (void) = UI_dummy_function;
  2876. /*----------------------------------------------------------------------------
  2877. Function:         MMI_main_LCD_dt_display_function
  2878. Description:      function pointer of main lcd date display  function
  2879. Input Parameters: none
  2880. Output Parameters:   none
  2881. Returns:       none
  2882. ----------------------------------------------------------------------------*/
  2883. void (*MMI_main_LCD_dt_display_function) (void) = UI_dummy_function;
  2884. /*----------------------------------------------------------------------------
  2885. Function:         MMI_main_LCD_dt_close_function
  2886. Description:      function pointer of close date display  of main lcd
  2887. Input Parameters: none
  2888. Output Parameters:   none
  2889. Returns:       none
  2890. ----------------------------------------------------------------------------*/
  2891. void (*MMI_main_LCD_dt_close_function) (void) = UI_dummy_function;
  2892. /*----------------------------------------------------------------------------
  2893. Function:         MMI_sub_LCD_dt_hide_function
  2894. Description:      function pointer of date hide function of sub lcd
  2895. Input Parameters: none
  2896. Output Parameters:   none
  2897. Returns:       none
  2898. ----------------------------------------------------------------------------*/
  2899. void (*MMI_sub_LCD_dt_hide_function) (void) = UI_dummy_function;
  2900. /*----------------------------------------------------------------------------
  2901. Function:         MMI_sub_LCD_dt_update_function
  2902. Description:      function pointer of date update  function of sub lcd
  2903. Input Parameters: none
  2904. Output Parameters:   none
  2905. Returns:       none
  2906. ----------------------------------------------------------------------------*/
  2907. void (*MMI_sub_LCD_dt_update_function) (void) = UI_dummy_function;
  2908. /*----------------------------------------------------------------------------
  2909. Function:         MMI_sub_LCD_dt_display_function
  2910. Description:      function pointer of date display  function of sub lcd
  2911. Input Parameters: none
  2912. Output Parameters:   none
  2913. Returns:       none
  2914. ----------------------------------------------------------------------------*/
  2915. void (*MMI_sub_LCD_dt_display_function) (void) = UI_dummy_function;
  2916. /*----------------------------------------------------------------------------
  2917. Function:         MMI_sub_LCD_dt_close_function
  2918. Description:      function pointer of date close display  function of sub lcd
  2919. Input Parameters: none
  2920. Output Parameters:   none
  2921. Returns:       none
  2922. ----------------------------------------------------------------------------*/
  2923. void (*MMI_sub_LCD_dt_close_function) (void) = UI_dummy_function;
  2924. /* PMT HIMANSHU START 20050721 */
  2925. #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
  2926. /*----------------------------------------------------------------------------
  2927. Function:         MMI_main_LCD_dt_day_hide_function
  2928. Description:      day hide funtion pointer of main lcd 
  2929. Input Parameters: function pointer
  2930. Output Parameters:   none
  2931. Returns:       none
  2932. ----------------------------------------------------------------------------*/
  2933. void (*MMI_main_LCD_dt_day_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
  2934. #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */ 
  2935. /* PMT HIMANSHU END 20050721 */
  2936. /* Lisen0522 */
  2937. /*****************************************************************************
  2938.  * FUNCTION
  2939.  *  update_mainlcd_dt_display
  2940.  * DESCRIPTION
  2941.  *  updaet date tiem dispaly on main lcd
  2942.  * PARAMETERS
  2943.  *  void
  2944.  * RETURNS
  2945.  *  void
  2946.  *****************************************************************************/
  2947. void update_mainlcd_dt_display(void)
  2948. {
  2949.     /*----------------------------------------------------------------*/
  2950.     /* Local Variables                                                */
  2951.     /*----------------------------------------------------------------*/
  2952.     /*----------------------------------------------------------------*/
  2953.     /* Code Body                                                      */
  2954.     /*----------------------------------------------------------------*/
  2955.     MMI_main_LCD_dt_hide_function();    /* call current hide function of date time of main lcd */
  2956.     MMI_main_LCD_dt_update_function();  /* call current update function of date time of main lcd */
  2957.     MMI_main_LCD_dt_display_function(); /* call display function of  date time of main lcd */
  2958. }
  2959. /* Lisen0522 */
  2960. /*****************************************************************************
  2961.  * FUNCTION
  2962.  *  update_sublcd_dt_display
  2963.  * DESCRIPTION
  2964.  *  updaet date tiem dispaly on main lcd
  2965.  * PARAMETERS
  2966.  *  void
  2967.  * RETURNS
  2968.  *  void
  2969.  *****************************************************************************/
  2970. void update_sublcd_dt_display(void)
  2971. {
  2972. #ifdef __MMI_SUBLCD__
  2973.     /*----------------------------------------------------------------*/
  2974.     /* Local Variables                                                */
  2975.     /*----------------------------------------------------------------*/
  2976.     /*----------------------------------------------------------------*/
  2977.     /* Code Body                                                      */
  2978.     /*----------------------------------------------------------------*/
  2979.     MMI_sub_LCD_dt_hide_function();     /* call current hide function of date time of sub lcd */
  2980.     MMI_sub_LCD_dt_update_function();   /* call current update function of date time of sub lcd */
  2981.     MMI_sub_LCD_dt_display_function();  /* call display function of  date time of sub lcd */
  2982. #endif /* __MMI_SUBLCD__ */ 
  2983. }
  2984. /*****************************************************************************
  2985.  * FUNCTION
  2986.  *  show_main_LCD_dt_display
  2987.  * DESCRIPTION
  2988.  *  get current tiem and update date time of main lcd
  2989.  * PARAMETERS
  2990.  *  void
  2991.  * RETURNS
  2992.  *  void
  2993.  *****************************************************************************/
  2994. void show_main_LCD_dt_display(void)
  2995. {
  2996.     /*----------------------------------------------------------------*/
  2997.     /* Local Variables                                                */
  2998.     /*----------------------------------------------------------------*/
  2999.     /*----------------------------------------------------------------*/
  3000.     /* Code Body                                                      */
  3001.     /*----------------------------------------------------------------*/
  3002.     MMI_main_LCD_dt_update_function();  /* call update function of date teime of main lcd */
  3003.     MMI_main_LCD_dt_display_function(); /* call display func of date time of main lcd */
  3004. }
  3005. /*****************************************************************************
  3006.  * FUNCTION
  3007.  *  show_sub_LCD_dt_display
  3008.  * DESCRIPTION
  3009.  *  get current tiem and update date time of sub lcd
  3010.  * PARAMETERS
  3011.  *  void
  3012.  * RETURNS
  3013.  *  void
  3014.  *****************************************************************************/
  3015. void show_sub_LCD_dt_display(void)
  3016. {
  3017.     /*----------------------------------------------------------------*/
  3018.     /* Local Variables                                                */
  3019.     /*----------------------------------------------------------------*/
  3020.     /*----------------------------------------------------------------*/
  3021.     /* Code Body                                                      */
  3022.     /*----------------------------------------------------------------*/
  3023.     MMI_sub_LCD_dt_update_function();   /* call update function of date teime of sub lcd */
  3024.     MMI_sub_LCD_dt_display_function();  /* call display func of date time of sub lcd */
  3025. }
  3026. /*****************************************************************************
  3027.  * FUNCTION
  3028.  *  UI_dummy_hide_function
  3029.  * DESCRIPTION
  3030.  *  dummy hide function :- clear the particular area with white color
  3031.  * PARAMETERS
  3032.  *  x1      [IN]        Start x postion
  3033.  *  y1      [IN]        Start y position
  3034.  *  x2      [IN]        End x position
  3035.  *  y2      [IN]        End y position
  3036.  * RETURNS
  3037.  *  void
  3038.  *****************************************************************************/
  3039. void UI_dummy_hide_function(S32 x1, S32 y1, S32 x2, S32 y2)
  3040. {
  3041.     /*----------------------------------------------------------------*/
  3042.     /* Local Variables                                                */
  3043.     /*----------------------------------------------------------------*/
  3044.     // PMT DLT_FIXES - TK 200603225 START   /*background color should be taken from the current MMI theme*/
  3045.     color c = *current_MMI_theme->datetime_bar_background_color;