wgui_datetime.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:498k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2002
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * MMITask.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for datetime screen control.
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * (c) 2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**********************************************************************************
- Filename: wgui_datetime.c
- Author: manju
- Date Created: August-07-2002
- Contains: PixTel UI wrapper routines for Date and Time input / display
- **********************************************************************************/
- #include "Globaldefs.h"
- /* Include: MMI header file */
- #include "MMI_features.h"
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- /* ... Add More MMI header */
- #include "DateTimeType.h"
- #include "L4Dr.h"
- #include "SettingGprots.h"
- #include "wgui_datetime.h"
- #include "gdi_include.h"
- #include "gui_themes.h"
- #include "DateTimeGprot.h"
- #include "wgui_fixed_menus.h"
- #include "wgui_fixed_menuitems.h"
- #include "ScreenSaverDefs.h"
- #include "CallManagementGprot.h"
- #include "wgui_categories_defs.h"
- #include "wgui_categories_CM.h"
- #include "BIDIDEF.h"
- #include "BIDIProt.h"
- #include "UCS2Prot.h"
- #include "MiscFunctions.h"
- #include "wgui_draw_manager.h"
- #include "DebugInitDef.h"
- #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
- #include "wgui_categories_idlescreen.h"
- #endif
- #define DT_FLAGS_TYPE (0x00000fff)
- #ifdef __MMI_SUBLCD__
- typedef enum
- {
- /* Show date before time */
- SUBLCD_DT_DATE_THEN_TIME_TYPE1,
- /* Show time before date */
- SUBLCD_DT_TIME_THEN_DATE_TYPE1,
- SUBLCD_DT_TIME_THEN_DATE_TYPE2
- } SUBLCD_DATE_TIME_DISPLAY_TYPE;
- #endif /* __MMI_SUBLCD__ */
- /* MTK Elvis for R2L characters */
- #ifdef __MMI_BIDI_ALG__
- extern U8 visual_str[];
- #endif
- extern BOOL r2lMMIFlag;
- /* MTK end */
- #ifdef __MMI_AUDIO_PLAYER__
- extern BOOL mmi_audply_is_playing(void);
- #endif
- /* Date and Time input related objects */
- /* Currently only input boxes are used */
- extern void idle_screen_show_network_details(void);
- extern pBOOL IsChineseSet(void);
- #ifdef __MMI_SUBLCD__
- extern S32 Sub_lcd_title_height;
- #endif
- #ifdef __MMI_SUB_WALLPAPER__
- extern GDI_HANDLE sublcd_base_layer;
- #endif
- /* a single input box for day input */
- single_line_input_box wgui_date_input_day;
- /* a single input box for month input */
- single_line_input_box wgui_date_input_month;
- /* a single input box for year input */
- single_line_input_box wgui_date_input_year;
- /* a single input box for hours input */
- single_line_input_box wgui_time_input_hours;
- /* a single input box for minutes input */
- single_line_input_box wgui_time_input_minutes;
- /* a single input box for seconds input */
- single_line_input_box wgui_time_input_seconds;
- /* a single input box for am - pm input */
- single_line_input_box wgui_time_input_AM_PM;
- single_line_input_box *wgui_date_time_input_object_focus = NULL;
- U8 wgui_date_time_input_focus = WGUI_DATE_TIME_INPUT_FOCUS_NONE;
- /* store the position of day input previous focus */
- U8 wgui_day_input_previous_focus;
- /* store the position of day input next focus */
- U8 wgui_day_input_next_focus;
- /* store the position of month input previous focus */
- U8 wgui_month_input_previous_focus;
- /* store the position of month input next focus */
- U8 wgui_month_input_next_focus;
- /* store the position of year input previous focus */
- U8 wgui_year_input_previous_focus;
- /* store the position of month input previous focus */
- U8 wgui_year_input_next_focus;
- /* store the position of month input previous focus */
- U8 wgui_hours_input_previous_focus;
- /* store the position of hours input next focus */
- U8 wgui_hours_input_next_focus;
- /* store the position of minutes input previous focus */
- U8 wgui_minutes_input_previous_focus;
- /* store the position of month input next focus */
- U8 wgui_minutes_input_next_focus;
- /* store the position of seconds input previous focus */
- U8 wgui_seconds_input_previous_focus;
- /* store the position of seconds input next focus */
- U8 wgui_seconds_input_next_focus;
- /* store the position of AM - PM input previous focus */
- U8 wgui_AM_PM_input_previous_focus;
- /* store the position of AM -= Pm input next focus */
- U8 wgui_AM_PM_input_next_focus;
- U8 wgui_seconds_input_enabled = 0;
- U8 wgui_AM_PM_input_enabled = 0;
- U8 wgui_date_input_enabled = 0;
- U8 wgui_time_input_enabled = 0;
- U8 show_date = 0;
- MMI_BOOL main_lcd_update_date_time = MMI_TRUE;
- #ifdef __MMI_SUBLCD__
- MMI_BOOL sub_lcd_update_date_time = MMI_TRUE;
- #endif
- /* MTK Elvis for date boundary setting */
- S32 g_date_year_max = 2030, g_date_year_min = 1970, g_date_month_max = 12, g_date_month_min = 1;
- /* MTK end */
- /* global variable of main lcd date objet */
- UI_date_time_display main_LCD_dt_object;
- #ifdef __MMI_SUBLCD__
- /* global variable of sublcd lcd date objet city 1 */
- UI_date_time_display sub_LCD_dt_object1;
- /* global variable of sublcd lcd date objet city 2 */
- UI_date_time_display sub_LCD_dt_object2;
- SUBLCD_DATE_TIME_DISPLAY_TYPE sublcd_date_time_display_type;
- #endif /* __MMI_SUBLCD__ */
- /* PMT HIMANSHU START 20050721 */
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- extern MMI_ID_TYPE idlescreen_bar_id;//070306 Alpha layer
- U8 g_clock_type = ANALOG; /* default clock for Techno Idlescreen Bar */
- U16 *day_string = NULL; /* pointer storing the address of the MMI_ID_TYPE of day string. */
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- /* PMT HIMANSHU END 20050721 */
- extern U16 GetTotalHoldCallCount(void);
- extern S16 GetTotalActiveCallCount(void);
- extern S32 UI_get_font_height(UI_font_type f);
- extern void CheckCtrExpiry(MYTIME *last_time, MYTIME *curr_time);
- extern MYTIME *GetStartCallTime(void);
- extern MYTIME *GetCurrStartCallTime(void);
- extern U8 PhnsetGetDateFormat(void);
- extern U8 PhnsetGetTimeFormat(void);
- extern UI_string_type UI_strcat(UI_string_type text1, UI_string_type text2);
- extern UI_string_type UI_strcpy(UI_string_type text1, UI_string_type text2);
- extern void (*gui_set_clip) (S32 x1, S32 y1, S32 x2, S32 y2);
- /* Externals for graphics context switching */
- extern bitmap main_LCD_device_bitmap; /* main lcd graphicd context */
- extern bitmap sub_LCD_device_bitmap; /* sub lcd graphic context */
- void UI_set_main_LCD_graphics_context(void); /* set main lcd graphic contrext */
- void UI_set_sub_LCD_graphics_context(void); /* set sub lcd graphic cntext */
- extern bitmap *current_LCD_device_bitmap; /* store current graphic context */
- #ifdef __MMI_SUBLCD__
- extern stFontAttribute MMI_sublcd_font;
- extern S32 SUB_LCD_device_width;
- extern void RedrawSubLCDAnalogClockScreen(void);
- #endif /* __MMI_SUBLCD__ */
- extern S32 ANALOG_CLOCK_DIAL_X;
- extern S32 ANALOG_CLOCK_DIAL_Y;
- /* MTK Tim */
- extern void kal_get_time(U32 *ticks_ptr);
- U32 last_duration_ticks;
- U32 last_duration;
- UI_time last_duration_time;
- /*----------------------------------------------------------------------------
- Function: wgui_date_time_input_callback
- Description: a function pointer store teh address of function
- of date time input callback
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*wgui_date_time_input_callback) (void);
- /* theme scheme of inline date time input box */
- UI_single_line_input_box_theme wgui_date_time_input_theme = { (UI_filled_area *)&MMI_formatted_inputbox_normal_filler,
- (UI_filled_area *)&MMI_formatted_inputbox_disabled_filler,
- (UI_filled_area *)&MMI_formatted_inputbox_selected_filler,
- {0, 0, 0, 100},
- {128, 128, 128, 100},
- {0, 0, 0, 100},
- {255, 255, 255, 100},
- {51, 88, 171, 100},
- {255, 0, 0, 100},
- &UI_DEFAULT_FONT,
- 1,
- UI_SINGLE_LINE_INPUT_BOX_CENTER_Y,
- '*'
- };
- /*****************************************************************************
- * FUNCTION
- * wgui_set_day_input_navigation
- * DESCRIPTION
- * function set thevaleu of previous and next cursor focus
- * of day input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_day_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_day_input_previous_focus = previous_focus;
- wgui_day_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_month_input_navigation
- * DESCRIPTION
- * function set thevaleu of previous and next cursor focus
- * of month input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_month_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_month_input_previous_focus = previous_focus;
- wgui_month_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_year_input_navigation
- * DESCRIPTION
- * function set the valeu of previous and next cursor focus
- * of year input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_year_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_year_input_previous_focus = previous_focus;
- wgui_year_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_hours_input_navigation
- * DESCRIPTION
- * function set the valeu of previous and next cursor focus
- * of hours input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_hours_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_hours_input_previous_focus = previous_focus;
- wgui_hours_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_minutes_input_navigation
- * DESCRIPTION
- * function set the valeu of previous and next cursor focus
- * of minutes input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_minutes_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_minutes_input_previous_focus = previous_focus;
- wgui_minutes_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_seconds_input_navigation
- * DESCRIPTION
- * function set the valeu of previous and next cursor focus
- * of seconds input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_seconds_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_seconds_input_previous_focus = previous_focus;
- wgui_seconds_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_AM_PM_input_navigation
- * DESCRIPTION
- * function set the valeu of previous and next cursor focus
- * of am-pm input single box
- * PARAMETERS
- * previous_focus [IN] Previous cursor position
- * next_focus [IN] Next cursor position
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_AM_PM_input_navigation(U8 previous_focus, U8 next_focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_AM_PM_input_previous_focus = previous_focus;
- wgui_AM_PM_input_next_focus = next_focus;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_show_date_input
- * DESCRIPTION
- * show date input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_date_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* show day single line inputr box */
- gui_show_single_line_input_box(&wgui_date_input_day);
- /* show month single line input box */
- gui_show_single_line_input_box(&wgui_date_input_month);
- /* show year single line input box */
- gui_show_single_line_input_box(&wgui_date_input_year);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_show_time_input
- * DESCRIPTION
- * show time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_time_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* show hours input box */
- gui_show_single_line_input_box(&wgui_time_input_hours);
- /* show minutes input box */
- gui_show_single_line_input_box(&wgui_time_input_minutes);
- if (wgui_seconds_input_enabled) /* if seconds input is enabled */
- { /* show seconds input box */
- gui_show_single_line_input_box(&wgui_time_input_seconds);
- }
- if (wgui_AM_PM_input_enabled) /* if am-pm input enabled */
- { /* show am pm input box */
- gui_show_single_line_input_box(&wgui_time_input_AM_PM);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_show_date_time_input
- * DESCRIPTION
- * show date time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_date_time_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- if (wgui_date_input_enabled) /* if date input box enabled */
- {
- wgui_show_date_input(); /* show date input box -day/month/year */
- }
- if (wgui_time_input_enabled) /* if time input is enabled */
- {
- wgui_show_time_input(); /* show time input box */
- }
- gdi_layer_unlock_frame_buffer();
- gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_create_date_time_inputbox
- * DESCRIPTION
- * create single input box of date or time
- * PARAMETERS
- * b [IN] Single input box
- * buffer [IN] Buffer
- * buffer_length [IN] Total buffer length
- * text_length [IN] Current text length
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_create_date_time_inputbox(single_line_input_box *b, U8 *buffer, S32 buffer_length, S32 text_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* create single iput box and set buffer */
- gui_create_single_line_input_box_set_buffer(
- b,
- 0,
- 0,
- 0,
- 0,
- (UI_string_type) buffer,
- (buffer_length + 1) * 2,
- (text_length + 1) * 2,
- text_length);
- b->flags |= UI_SINGLE_LINE_INPUT_BOX_OVERWRITE_MODE;
- /* set the cursor position to first character */
- gui_single_line_input_box_goto_first_character(b);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_initialize_date_input
- * DESCRIPTION
- * set the day,month,year value and length of date input box
- * PARAMETERS
- * day_buffer [IN] Store valeu of day
- * day_buffer_length [IN] Length of day buffer
- * month_buffer [IN] Store value of minth
- * month_buffer_length [IN] Length of month buffer
- * year_buffer [IN] Store valeu of year
- * year_buffer_length [IN] Length of year buffer
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_initialize_date_input(
- UI_buffer_type day_buffer,
- S32 day_buffer_length,
- UI_buffer_type month_buffer,
- S32 month_buffer_length,
- UI_buffer_type year_buffer,
- S32 year_buffer_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set the theme of date input */
- wgui_date_time_input_theme.normal_filler = current_MMI_theme->formatted_inputbox_normal_filler;
- wgui_date_time_input_theme.disabled_filler = current_MMI_theme->formatted_inputbox_normal_filler;
- wgui_date_time_input_theme.selected_filler = current_MMI_theme->formatted_inputbox_selected_filler;
- /* set the theme of single line input box equal to date time input themem */
- current_single_line_input_box_theme = &wgui_date_time_input_theme;
- l = gui_strlen((UI_string_type) day_buffer);
- /* create day input box and set the buffe of day input box */
- wgui_create_date_time_inputbox(&wgui_date_input_day, day_buffer, day_buffer_length, l);
- l = gui_strlen((UI_string_type) month_buffer);
- /* create month input box and set the buffer of month input box */
- wgui_create_date_time_inputbox(&wgui_date_input_month, month_buffer, month_buffer_length, l);
- l = gui_strlen((UI_string_type) year_buffer);
- /* create year input box and set the buffer of year input box */
- wgui_create_date_time_inputbox(&wgui_date_input_year, year_buffer, year_buffer_length, l);
- current_single_line_input_box_theme = current_UI_theme->single_line_input_box_theme;
- wgui_date_time_input_remove_object_focus(&wgui_date_input_day);
- wgui_date_time_input_remove_object_focus(&wgui_date_input_month);
- wgui_date_time_input_remove_object_focus(&wgui_date_input_year);
- /* set the flag of date input enabled */
- wgui_date_input_enabled = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_initialize_time_input
- * DESCRIPTION
- * set the hour ,minute,second value and length of time input box
- * PARAMETERS
- * hours_buffer [IN] Store valeu of hours
- * hours_buffer_length [IN] Length of hours buffer
- * minutes_buffer [IN] Store value of minute
- * minutes_buffer_length [IN] Length of minute buffer
- * seconds_buffer [IN] Store valeu of seconds
- * seconds_buffer_length [IN] Length of second buffer
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_initialize_time_input(
- UI_buffer_type hours_buffer,
- S32 hours_buffer_length,
- UI_buffer_type minutes_buffer,
- S32 minutes_buffer_length,
- UI_buffer_type seconds_buffer,
- S32 seconds_buffer_length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* set the theme of time input box */
- wgui_date_time_input_theme.normal_filler = current_MMI_theme->formatted_inputbox_normal_filler;
- wgui_date_time_input_theme.disabled_filler = current_MMI_theme->formatted_inputbox_normal_filler;
- wgui_date_time_input_theme.selected_filler = current_MMI_theme->formatted_inputbox_selected_filler;
- current_single_line_input_box_theme = &wgui_date_time_input_theme;
- l = gui_strlen((UI_string_type) hours_buffer);
- /* create hour inputbox and set the buffer of hour input box */
- wgui_create_date_time_inputbox(&wgui_time_input_hours, hours_buffer, hours_buffer_length, l);
- l = gui_strlen((UI_string_type) minutes_buffer);
- /* create minutes inputbox and set the buffer of minutes input box */
- wgui_create_date_time_inputbox(&wgui_time_input_minutes, minutes_buffer, minutes_buffer_length, l);
- l = gui_strlen((UI_string_type) seconds_buffer);
- /* create seconds inputbox and set the buffer of second input box */
- wgui_create_date_time_inputbox(&wgui_time_input_seconds, seconds_buffer, seconds_buffer_length, l);
- current_single_line_input_box_theme = current_UI_theme->single_line_input_box_theme;
- wgui_date_time_input_remove_object_focus(&wgui_time_input_hours);
- wgui_date_time_input_remove_object_focus(&wgui_time_input_minutes);
- wgui_date_time_input_remove_object_focus(&wgui_time_input_seconds);
- wgui_date_time_input_remove_object_focus(&wgui_time_input_AM_PM);
- wgui_time_input_enabled = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_reset_date_input
- * DESCRIPTION
- * set the flag of date input to default valeu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_reset_date_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_input_enabled = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_reset_time_input
- * DESCRIPTION
- * set the flag of time input to default valeu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_reset_time_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_time_input_enabled = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_day_input
- * DESCRIPTION
- * move day input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_day_input(S32 x, S32 y)
- { /* move the day input box to particular x,y position */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_date_input_day, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_day_input
- * DESCRIPTION
- * resize day inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_day_input(S32 width, S32 height)
- { /* resize da input box equal to width and height pass as parameter */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_date_input_day, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_month_input
- * DESCRIPTION
- * move month input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_month_input(S32 x, S32 y)
- { /* move the month input box to particular x,y position */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_date_input_month, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_month_input
- * DESCRIPTION
- * resize month inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_month_input(S32 width, S32 height)
- { /* resize month input box equal to width and height pass as parameter */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_date_input_month, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_year_input
- * DESCRIPTION
- * move year input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_year_input(S32 x, S32 y)
- { /* move the year input box to particular x,y position */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_date_input_year, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_year_input
- * DESCRIPTION
- * resize year inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_year_input(S32 width, S32 height)
- { /* resize year input box equal to width and height pass as parameter */
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_date_input_year, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_hours_input
- * DESCRIPTION
- * move hours input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_hours_input(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_time_input_hours, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_hours_input
- * DESCRIPTION
- * resize hours inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_hours_input(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_time_input_hours, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_minutes_input
- * DESCRIPTION
- * move minutes input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_minutes_input(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_time_input_minutes, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_minutes_input
- * DESCRIPTION
- * resize minutes inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_minutes_input(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_time_input_minutes, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_seconds_input
- * DESCRIPTION
- * move seconds input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_seconds_input(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_time_input_seconds, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_seconds_input
- * DESCRIPTION
- * resize seconds inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_seconds_input(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_time_input_seconds, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_move_AM_PM_input
- * DESCRIPTION
- * move am-pm input box to particula position x , y equal to valeu pass as parameter
- * PARAMETERS
- * x [IN]
- * y [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_move_AM_PM_input(S32 x, S32 y)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_move_single_line_input_box(&wgui_time_input_AM_PM, x, y);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_resize_AM_PM_input
- * DESCRIPTION
- * resize am-pm inpuit box
- * PARAMETERS
- * width [IN]
- * height [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_resize_AM_PM_input(S32 width, S32 height)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_resize_single_line_input_box(&wgui_time_input_AM_PM, width, height);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_enable_seconds_input
- * DESCRIPTION
- * enbale second input flag
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_enable_seconds_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_seconds_input_enabled = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_disable_seconds_input
- * DESCRIPTION
- * disable second input flag
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_disable_seconds_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_seconds_input_enabled = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_enable_AM_PM_input
- * DESCRIPTION
- * enbale am pm input flag
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_enable_AM_PM_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_AM_PM_input_enabled = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_disable_AM_PM_input
- * DESCRIPTION
- * disable am pm input flag
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_disable_AM_PM_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_AM_PM_input_enabled = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_set_object_focus
- * DESCRIPTION
- * set focus on input box pass as paaremter
- * PARAMETERS
- * b [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_set_object_focus(single_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b == NULL)
- {
- return;
- }
- b->flags &= ~UI_SINGLE_LINE_INPUT_BOX_STATE_NORMAL;
- b->flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_SELECTED;
- b->flags &= ~UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_remove_object_focus
- * DESCRIPTION
- * remove focus from input box pass as paaremter
- * PARAMETERS
- * b [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_remove_object_focus(single_line_input_box *b)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (b == NULL)
- {
- return;
- }
- b->flags &= ~UI_SINGLE_LINE_INPUT_BOX_STATE_SELECTED;
- b->flags |= UI_SINGLE_LINE_INPUT_BOX_STATE_NORMAL;
- b->flags |= UI_SINGLE_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_set_focus
- * DESCRIPTION
- * set focus on input box pass as paaremter
- * PARAMETERS
- * focus [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_set_focus(U8 focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_input_focus = focus;
- switch (wgui_date_time_input_focus)
- {
- case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
- wgui_date_time_input_object_focus = NULL;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
- wgui_date_time_input_object_focus = &wgui_date_input_day;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
- wgui_date_time_input_object_focus = &wgui_date_input_month;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
- wgui_date_time_input_object_focus = &wgui_date_input_year;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
- wgui_date_time_input_object_focus = &wgui_time_input_hours;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
- wgui_date_time_input_object_focus = &wgui_time_input_minutes;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
- wgui_date_time_input_object_focus = &wgui_time_input_seconds;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
- wgui_date_time_input_object_focus = &wgui_time_input_AM_PM;
- break;
- default:
- wgui_date_time_input_object_focus = NULL;
- break;
- }
- wgui_date_time_input_set_object_focus(wgui_date_time_input_object_focus);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_remove_focus
- * DESCRIPTION
- * remove focus from input box pass as paaremter
- * PARAMETERS
- * focus [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_remove_focus(U8 focus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- single_line_input_box *f = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (focus)
- {
- case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
- f = NULL;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
- f = &wgui_date_input_day;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
- f = &wgui_date_input_month;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
- f = &wgui_date_input_year;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
- f = &wgui_time_input_hours;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
- f = &wgui_time_input_minutes;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
- f = &wgui_time_input_seconds;
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
- f = &wgui_time_input_AM_PM;
- break;
- default:
- f = NULL;
- break;
- }
- wgui_date_time_input_remove_object_focus(f);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_set_previous_focus
- * DESCRIPTION
- * set focus to previous position of current input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_set_previous_focus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_input_remove_focus(wgui_date_time_input_focus);
- switch (wgui_date_time_input_focus)
- {
- case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
- wgui_date_time_input_set_focus(wgui_day_input_previous_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
- wgui_date_time_input_set_focus(wgui_month_input_previous_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
- wgui_date_time_input_set_focus(wgui_year_input_previous_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
- wgui_date_time_input_set_focus(wgui_hours_input_previous_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
- wgui_date_time_input_set_focus(wgui_minutes_input_previous_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
- wgui_date_time_input_set_focus(wgui_seconds_input_previous_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
- wgui_date_time_input_set_focus(wgui_AM_PM_input_previous_focus);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_set_next_focus
- * DESCRIPTION
- * set focus to next position of current input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_set_next_focus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_input_remove_focus(wgui_date_time_input_focus);
- switch (wgui_date_time_input_focus)
- {
- case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
- wgui_date_time_input_set_focus(wgui_day_input_next_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
- wgui_date_time_input_set_focus(wgui_month_input_next_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
- wgui_date_time_input_set_focus(wgui_year_input_next_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
- wgui_date_time_input_set_focus(wgui_hours_input_next_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
- wgui_date_time_input_set_focus(wgui_minutes_input_next_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
- wgui_date_time_input_set_focus(wgui_seconds_input_next_focus);
- break;
- case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
- wgui_date_time_input_set_focus(wgui_AM_PM_input_next_focus);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_get_previous_focus
- * DESCRIPTION
- * return the previous focus input box
- * PARAMETERS
- * void
- * RETURNS
- * byte:- return the previous focus input box ..day/month/year/hour/minute/second
- *****************************************************************************/
- U8 wgui_date_time_input_get_previous_focus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (wgui_date_time_input_focus)
- {
- case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
- return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
- case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
- return (wgui_day_input_previous_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
- return (wgui_month_input_previous_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
- return (wgui_year_input_previous_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
- return (wgui_hours_input_previous_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
- return (wgui_minutes_input_previous_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
- return (wgui_seconds_input_previous_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
- return (wgui_AM_PM_input_previous_focus);
- default:
- return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_get_next_focus
- * DESCRIPTION
- * return the next foucs input box
- * PARAMETERS
- * void
- * RETURNS
- * byte:- return the previous focus input box ..day/month/year/hour/minute/second
- *****************************************************************************/
- U8 wgui_date_time_input_get_next_focus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (wgui_date_time_input_focus)
- {
- case WGUI_DATE_TIME_INPUT_FOCUS_NONE:
- return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
- case WGUI_DATE_TIME_INPUT_FOCUS_DAY:
- return (wgui_day_input_next_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_MONTH:
- return (wgui_month_input_next_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_YEAR:
- return (wgui_year_input_next_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_HOURS:
- return (wgui_hours_input_next_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_MINUTES:
- return (wgui_minutes_input_next_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_SECONDS:
- return (wgui_seconds_input_next_focus);
- case WGUI_DATE_TIME_INPUT_FOCUS_AM_PM:
- return (wgui_AM_PM_input_next_focus);
- default:
- return (WGUI_DATE_TIME_INPUT_FOCUS_NONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_redraw_date_time_input
- * DESCRIPTION
- * redraw dte/time input box depend on current focus input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_redraw_date_time_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x1, y1, x2, y2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- gdi_layer_lock_frame_buffer();
- gui_show_single_line_input_box(wgui_date_time_input_object_focus);
- gdi_layer_unlock_frame_buffer();
- x1 = wgui_date_time_input_object_focus->x;
- y1 = wgui_date_time_input_object_focus->y;
- x2 = x1 + wgui_date_time_input_object_focus->width - 1;
- y2 = y1 + wgui_date_time_input_object_focus->height - 1;
- gdi_layer_blt_previous(x1, y1, x2, y2);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_direct_input
- * DESCRIPTION
- * input the character enter by user in date tiem input box
- * PARAMETERS
- * c [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_direct_input(UI_character_type c)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- if (gui_single_line_input_box_test_last_position_overflow(wgui_date_time_input_object_focus))
- {
- if (wgui_date_time_input_get_next_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
- {
- wgui_date_time_input_set_next_focus();
- gui_single_line_input_box_insert_character(wgui_date_time_input_object_focus, c);
- wgui_show_date_time_input();
- }
- }
- else
- {
- gui_single_line_input_box_insert_character(wgui_date_time_input_object_focus, c);
- wgui_redraw_date_time_input();
- if (gui_single_line_input_box_test_last_position_overflow(wgui_date_time_input_object_focus))
- {
- if (wgui_date_time_input_get_next_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
- {
- wgui_date_time_input_set_next_focus();
- wgui_show_date_time_input();
- }
- }
- }
- wgui_date_time_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_delete_character
- * DESCRIPTION
- * delete the character from date time input box - current input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_delete_character(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- if (gui_single_line_input_box_test_first_position(wgui_date_time_input_object_focus))
- {
- if (wgui_date_time_input_get_previous_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
- {
- wgui_date_time_input_set_previous_focus();
- wgui_show_date_time_input();
- }
- }
- else
- {
- gui_single_line_input_box_delete_character(wgui_date_time_input_object_focus);
- wgui_redraw_date_time_input();
- if (gui_single_line_input_box_test_first_position(wgui_date_time_input_object_focus))
- {
- if (wgui_date_time_input_get_previous_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
- {
- wgui_date_time_input_set_previous_focus();
- wgui_show_date_time_input();
- }
- }
- }
- wgui_date_time_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_previous_character
- * DESCRIPTION
- * move the cursor to previous caharcter of date /time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_previous_character(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- if (gui_single_line_input_box_test_first_position(wgui_date_time_input_object_focus))
- {
- if (wgui_date_time_input_get_previous_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
- {
- wgui_date_time_input_set_previous_focus();
- wgui_show_date_time_input();
- }
- }
- else
- {
- gui_single_line_input_box_previous(wgui_date_time_input_object_focus);
- wgui_redraw_date_time_input();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_next_character
- * DESCRIPTION
- * move the cursor to next caharcter of date /time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_next_character(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- if (gui_single_line_input_box_test_last_position(wgui_date_time_input_object_focus))
- {
- if (wgui_date_time_input_get_next_focus() != WGUI_DATE_TIME_INPUT_FOCUS_NONE)
- {
- wgui_date_time_input_set_next_focus();
- wgui_show_date_time_input();
- }
- }
- else
- {
- gui_single_line_input_box_next(wgui_date_time_input_object_focus);
- wgui_redraw_date_time_input();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_toggle_insert_mode
- * DESCRIPTION
- * toggle insert mode of date /time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_toggle_insert_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- gui_single_line_input_box_toggle_insert_mode(wgui_date_time_input_object_focus);
- wgui_redraw_date_time_input();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_delete_current_character
- * DESCRIPTION
- * delete current character of date /time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_delete_current_character(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- gui_single_line_input_box_delete_current_character(wgui_date_time_input_object_focus);
- wgui_redraw_date_time_input();
- wgui_date_time_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_delete_all_characters
- * DESCRIPTION
- * delete all characters of date /time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_delete_all_characters(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (wgui_date_time_input_object_focus == NULL)
- {
- return;
- }
- gui_single_line_input_box_delete_all(wgui_date_time_input_object_focus);
- wgui_redraw_date_time_input();
- wgui_date_time_input_callback();
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_numeric_keyboard_input_handler
- * DESCRIPTION
- * handle numeric key inoput of date /time input box
- * PARAMETERS
- * keyc [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_numeric_keyboard_input_handler(S32 keyc)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (keyc >= '0' && keyc <= '9')
- {
- wgui_date_time_direct_input((U8) keyc);
- }
- else if (keyc == 0x08)
- {
- wgui_date_time_delete_character();
- }
- else if (keyc == 0x1b)
- {
- wgui_date_time_delete_all_characters();
- }
- else if (keyc == 0x0d);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_handle_key_down
- * DESCRIPTION
- * handle key board input of date /time
- * PARAMETERS
- * k [IN]
- * S32(?) [IN] Keyc
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_handle_key_down(MMI_key_code_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_direct_input((UI_character_type) ('0' + k));
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_key_handler
- * DESCRIPTION
- * handle key board input of date /time
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_key_handler(S32 vkey_code, S32 key_state)
- {
- #if(MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (key_state)
- {
- switch (vkey_code)
- {
- case 37:
- wgui_date_time_previous_character();
- break;
- case 38: /* up */
- break;
- case 39:
- wgui_date_time_next_character();
- break;
- case 40: /* down */
- break;
- case 36: /* home */
- break;
- case 35: /* end */
- break;
- case 33: /* page up */
- break;
- case 34: /* page down */
- break;
- case 45:
- wgui_date_time_toggle_insert_mode();
- break;
- case 46:
- wgui_date_time_delete_current_character();
- break;
- }
- }
- #else /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- UI_UNUSED_PARAMETER(vkey_code);
- UI_UNUSED_PARAMETER(key_state);
- #endif /* (MMI_BUILD_TYPE == BUILD_TYPE_X86WIN32) */
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_register_keys
- * DESCRIPTION
- * register date / time input keys
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_register_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_MMI_key_input_handler();
- register_key_down_handler(wgui_date_time_handle_key_down);
- register_keyboard_input_handler(wgui_date_time_numeric_keyboard_input_handler);
- SetKeyHandler(wgui_date_time_previous_character, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(wgui_date_time_next_character, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- register_keyboard_key_handler(wgui_date_time_key_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_date_time_input_clear_keys
- * DESCRIPTION
- * clear all register keys of adet /time input box
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_date_time_input_clear_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_MMI_key_input_handler();
- clear_key_down_handler();
- clear_keyboard_input_handler();
- ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- clear_keyboard_key_handler();
- }
- /*****************************************************************************
- * FUNCTION
- * register_wgui_date_time_input_callback
- * DESCRIPTION
- * register date/time input callback function
- * PARAMETERS
- * f [IN]
- * function(?) [IN] Pointers
- * RETURNS
- * void
- *****************************************************************************/
- void register_wgui_date_time_input_callback(void (*f) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_input_callback = f;
- }
- /*****************************************************************************
- * FUNCTION
- * clear_wgui_date_time_input_callback
- * DESCRIPTION
- * clear date time input callback function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void clear_wgui_date_time_input_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_input_callback = UI_dummy_function;
- }
- /*****************************************************************************
- * FUNCTION
- * get_year
- * DESCRIPTION
- * return year of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- /* Date and time display related code */
- U16 get_year(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->nYear);
- }
- /*****************************************************************************
- * FUNCTION
- * get_month
- * DESCRIPTION
- * return month of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 get_month(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->nMonth);
- }
- /*****************************************************************************
- * FUNCTION
- * get_day
- * DESCRIPTION
- * return day of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 get_day(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->nDay);
- }
- /*****************************************************************************
- * FUNCTION
- * get_hours
- * DESCRIPTION
- * return hours of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 get_hours(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->nHour);
- }
- /*****************************************************************************
- * FUNCTION
- * get_minutes
- * DESCRIPTION
- * return minutes of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 get_minutes(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->nMin);
- }
- /*****************************************************************************
- * FUNCTION
- * get_seconds
- * DESCRIPTION
- * return seconds of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 get_seconds(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->nSec);
- }
- /*****************************************************************************
- * FUNCTION
- * get_dayofweek
- * DESCRIPTION
- * return day of week of UI_time pass as parameter
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U16 get_dayofweek(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (t->DayIndex);
- }
- /*****************************************************************************
- * FUNCTION
- * date_string
- * DESCRIPTION
- * get date time string for different requirement
- * PARAMETERS
- * time [IN] Date time to convert
- * string [OUT] Date time string
- * flags [IN] Date time type
- * RETURNS
- * void
- *****************************************************************************/
- void date_string(UI_time *time, UI_string_type string, U32 flags)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 day, month, year, day_index;
- S8 ts[32];
- #ifdef __MMI_SUBLCD__
- /* MAUI_00169917 START */
- S8 as[64];
- U8 Tempbuffer[64];
- /* MAUI_00169917 END */
- U8 *day_name = NULL;
- #endif /* __MMI_SUBLCD__ */
- #ifdef __MMI_DATE_TIME_IN_DIFF_LANG__
- S8 ts2[32];
- #endif
- #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
- U8 month_str[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- #else
- UI_string_type month_str;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- day_index = get_dayofweek(time);
- day = get_day(time);
- month = get_month(time);
- year = get_year(time);
- if (month > 12 || month < 1)
- {
- month = 1;
- }
- switch (flags & DT_FLAGS_TYPE)
- {
- /***** MainLCD DataTime *****/
- case DT_IDLE_SCREEN:
- case DT_IDLE_SCREEN_ENGLISH_ONLY:
- case DT_NETWORK_SEARCH:
- case DT_MO_CALL_SCREEN:
- case DT_MO_CALLING_SCREEN:
- case DT_TABBED_CALL_SCREEN:
- case DT_MT_CALL_SCREEN:
- case DT_ACTIVE_CALL_SCREEN:
- case DT_DIGITAL_CLOCK_SC1:
- case DT_DIGITAL_CLOCK_SC2:
- case DT_DIGITAL_CLOCK_SC3:
- case DT_ANALOG_CLOCK_SC:
- {
- switch (PhnsetGetDateFormat()) /* Get the current format of date */
- {
- case 0:
- #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
- sprintf((S8*) ts, "%02d-%3s-%04d", day, month_str[month - 1], year);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- #else /* __MMI_DATE_TIME_IN_DIFF_LANG__ */
- sprintf((S8*) ts, "%02d-", day);
- AnsiiToUnicodeString((S8*) string, ts);
- if ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY)
- {
- month_str = get_string_lang((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month), (S8*) "*#0044#");
- }
- else
- {
- month_str = get_string((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month));
- }
- if (month_str)
- {
- UI_strcat(string, month_str);
- }
- sprintf((S8*) ts, "-%04d", year);
- AnsiiToUnicodeString((S8*) ts2, ts);
- UI_strcat(string, (UI_string_type) ts2);
- break;
- #endif /* __MMI_DATE_TIME_IN_DIFF_LANG__ */
- case 1:
- sprintf((S8*) ts, "%02d/%02d/%04d", day, month, year);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- case 2:
- sprintf((S8*) ts, "%02d/%02d/%04d", month, day, year);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- case 3:
- sprintf((S8*) ts, "%04d/%02d/%02d", year, month, day);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- case 4:
- sprintf((S8*) ts, "%04d-%02d-%02d", year, month, day);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- case 5:
- #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
- sprintf((S8*) ts, "%3s %02d, %04d", month_str[month - 1], day, year);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- #else /* __MMI_DATE_TIME_IN_DIFF_LANG__ */
- sprintf((S8*) ts, " %02d, %04d", day, year);
- if ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY)
- {
- month_str = get_string_lang((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month), (S8*) "*#0044#");
- }
- else
- {
- month_str = get_string((MMI_ID_TYPE) (STR_GUI_MONTH_BASE + month));
- }
- if (month_str)
- {
- UI_strcpy(string, month_str);
- }
- else
- {
- UI_strcpy(string, L"");
- }
- AnsiiToUnicodeString((S8*) ts2, ts);
- UI_strcat(string, (UI_string_type) ts2);
- break;
- #endif /* __MMI_DATE_TIME_IN_DIFF_LANG__ */
- }
- }
- break;
- case DT_IDLE_SCREEN_2:
- {
- switch (PhnsetGetDateFormat())
- {
- case 0:
- case 1:
- sprintf((S8*) ts, "%02d %3s", day, month_str[month - 1]);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- case 2:
- case 3:
- case 4:
- case 5:
- sprintf((S8*) ts, "%3s %02d", month_str[month - 1], day);
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- }
- }
- break;
- #ifdef __MMI_SUBLCD__
- /***** SubLCD DataTime *****/
- case DT_SUBLCD_IDLE_SCREEN1:
- case DT_SUBLCD_IDLE_SCREEN2:
- case DT_SUBLCD_IDLE_SCREEN3:
- case DT_SUBLCD_IDLE_SCREEN4:
- {
- if (IsChineseSet()) /* check if current language is chinese or not */
- {
- switch (day_index)
- {
- case 0:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_SUNDAY);
- break;
- case 1:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_MONDAY);
- break;
- case 2:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_TUESDAY);
- break;
- case 3:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_WEDNESDAY);
- break;
- case 4:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_THURSDAY);
- break;
- case 5:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_FRIDAY);
- break;
- case 6:
- day_name = (PU8) GetString(STR_SUBLCD_CHI_SATURDAY);
- break;
- }
- }
- else
- {
- /* not chinese */
- switch (day_index)
- {
- case 0:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_SUNDAY);
- break;
- case 1:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_MONDAY);
- break;
- case 2:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_TUESDAY);
- break;
- case 3:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_WEDNESDAY);
- break;
- case 4:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_THURSDAY);
- break;
- case 5:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_FRIDAY);
- break;
- case 6:
- day_name = (PU8) GetString(STR_SUBLCD_ENG_SATURDAY);
- break;
- }
- } /* end of check chiese */
- /* MAUI_00169917 START */
- pfnUnicodeStrcpy((S8*) as, (S8*) day_name);
- /* MAUI_00169917 END */
- if ((flags & DT_FLAGS_TYPE) == DT_SUBLCD_IDLE_SCREEN3)
- {
- year %= 100;
- switch (PhnsetGetDateFormat()) /* Get the current format of date */
- {
- case 0:
- case 1:
- /* MAUI_00169917 START */
- sprintf((S8*) ts, "%02d/%02d/%02d", day, month, year);
- AnsiiToUnicodeString((S8*) Tempbuffer, ts);
- pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
- /* MAUI_00169917 END */
- break;
- case 2:
- case 5:
- /* MAUI_00169917 START */
- sprintf((S8*) ts, "%02d/%02d/%02d", month, day, year);
- AnsiiToUnicodeString((S8*) Tempbuffer, ts);
- pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
- /* MAUI_00169917 END */
- break;
- case 3:
- case 4:
- /* MAUI_00169917 START */
- sprintf((S8*) ts, "%02d/%02d/%02d", year, month, day);
- AnsiiToUnicodeString((S8*) Tempbuffer, ts);
- pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
- /* MAUI_00169917 END */
- break;
- }
- }
- /* 101804 MTK Calvin added */
- else if ((flags & DT_FLAGS_TYPE) == DT_SUBLCD_IDLE_SCREEN2)
- {
- year %= 100;
- switch (PhnsetGetDateFormat()) /* Get the current format of date */
- {
- case 0:
- case 1:
- /* MAUI_00169917 START */
- sprintf((S8*) ts, "%02d/%02d", day, month);
- AnsiiToUnicodeString((S8*) Tempbuffer, ts);
- pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
- /* MAUI_00169917 END */
- break;
- case 2:
- case 3:
- case 4:
- case 5:
- /* MAUI_00169917 START */
- sprintf((S8*) ts, "%02d/%02d", month, day);
- AnsiiToUnicodeString((S8*) Tempbuffer, ts);
- pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
- /* MAUI_00169917 END */
- break;
- }
- }
- /* MTK Calvin end */
- else
- {
- /* MAUI_00169917 START */
- sprintf((S8*) ts, "%02d/%02d", day, month);
- AnsiiToUnicodeString((S8*) Tempbuffer, ts);
- pfnUnicodeStrcat((S8*) as, (S8*) Tempbuffer);
- /* MAUI_00169917 END */
- }
- /* MAUI_00169917 START */
- pfnUnicodeStrcpy((S8*) string, (S8*) as);
- /* MAUI_00169917 END */
- break;
- }
- /* break; */
- #endif /* __MMI_SUBLCD__ */
- /***** FileManager DataTime *****/
- case DT_FILEMANAGER:
- {
- year %= 100;
- switch (PhnsetGetDateFormat()) /* Get the current format of date */
- {
- case 0:
- case 1:
- sprintf((S8*) ts, "%02d/%02d/%02d", day, month, year);
- break;
- case 2:
- case 5:
- sprintf((S8*) ts, "%02d/%02d/%02d", month, day, year);
- break;
- case 3:
- case 4:
- sprintf((S8*) ts, "%02d/%02d/%02d", year, month, day);
- break;
- } /* end of switch */
- AnsiiToUnicodeString((S8*) string, ts);
- break;
- }
- /* break; */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * time_string
- * DESCRIPTION
- * convert time to string accoding to current time format
- * PARAMETERS
- * t [IN] Date to convets
- * s [OUT] String format of time
- * flags [IN] Date type
- * RETURNS
- * void
- *****************************************************************************/
- void time_string(UI_time *t, UI_string_type s, U32 flags)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 hours, minutes;
- #ifdef __MMI_DATE_TIME_IN_DIFF_LANG__
- UI_string_type postfix;
- #endif
- S8 ts[32];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- hours = get_hours(t);
- minutes = get_minutes(t);
- switch (flags & DT_FLAGS_TYPE)
- {
- case DT_IDLE_SCREEN:
- case DT_IDLE_SCREEN_2:
- case DT_IDLE_SCREEN_ENGLISH_ONLY:
- case DT_NETWORK_SEARCH:
- case DT_MO_CALL_SCREEN:
- case DT_MO_CALLING_SCREEN:
- case DT_MT_CALL_SCREEN:
- case DT_ACTIVE_CALL_SCREEN:
- case DT_TABBED_CALL_SCREEN:
- case DT_DIGITAL_CLOCK_SC1:
- case DT_DIGITAL_CLOCK_SC2:
- case DT_DIGITAL_CLOCK_SC3:
- case DT_ANALOG_CLOCK_SC:
- if (PhnsetGetTimeFormat()) /* get current time format */
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- AnsiiToUnicodeString((S8*) s, ts);
- }
- else
- {
- #ifndef __MMI_DATE_TIME_IN_DIFF_LANG__
- if (hours == 12)
- {
- sprintf((S8*) ts, "%02d:%02d PM", hours, minutes);
- }
- else if (hours == 0)
- {
- sprintf((S8*) ts, "%02d:%02d AM", 12, minutes);
- }
- else if (hours > 12)
- {
- sprintf((S8*) ts, "%02d:%02d PM", hours - 12, minutes);
- }
- else
- {
- sprintf((S8*) ts, "%02d:%02d AM", hours, minutes);
- }
- AnsiiToUnicodeString((S8*) s, ts);
- #else /* __MMI_DATE_TIME_IN_DIFF_LANG__ */
- if (hours == 12)
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- else if (hours == 0)
- {
- sprintf((S8*) ts, "%02d:%02d", 12, minutes);
- }
- else if (hours > 12)
- {
- sprintf((S8*) ts, "%02d:%02d", hours - 12, minutes);
- }
- else
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- AnsiiToUnicodeString((S8*) s, ts);
- if (hours >= 12)
- {
- postfix = ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY) ?
- (UI_string_type) get_string_lang(STR_GUI_TIME_PM, (S8*) "*#0044#") :
- (UI_string_type) get_string(STR_GUI_TIME_PM);
- }
- else
- {
- postfix = ((flags & DT_FLAGS_TYPE) == DT_IDLE_SCREEN_ENGLISH_ONLY) ?
- (UI_string_type) get_string_lang(STR_GUI_TIME_AM, (S8*) "*#0044#") :
- (UI_string_type) get_string(STR_GUI_TIME_AM);
- }
- if (postfix)
- {
- UI_strcat((UI_string_type) s, postfix);
- }
- #endif /* __MMI_DATE_TIME_IN_DIFF_LANG__ */
- }
- break;
- #ifdef __MMI_SUBLCD__
- case DT_SUBLCD_IDLE_SCREEN1:
- case DT_SUBLCD_IDLE_SCREEN2:
- case DT_SUBLCD_IDLE_SCREEN3:
- if (PhnsetGetTimeFormat())
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- else
- {
- S32 width, height;
- if (hours == 12)
- {
- sprintf((S8*) ts, "%02d:%02d PM", hours, minutes);
- }
- else if (hours == 0)
- {
- sprintf((S8*) ts, "%02d:%02d AM", 12, minutes);
- }
- else if (hours > 12)
- {
- sprintf((S8*) ts, "%02d:%02d PM", hours - 12, minutes);
- }
- else
- {
- sprintf((S8*) ts, "%02d:%02d AM", hours, minutes);
- }
- gui_measure_string((UI_string_type) ts, &width, &height);
- if (width > SUB_LCD_device_width)
- {
- if (hours == 12)
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- else if (hours == 0)
- {
- sprintf((S8*) ts, "%02d:%02d", 12, minutes);
- }
- else if (hours > 12)
- {
- sprintf((S8*) ts, "%02d:%02d", hours - 12, minutes);
- }
- else
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- }
- }
- AnsiiToUnicodeString((S8*) s, ts);
- break;
- case DT_SUBLCD_IDLE_SCREEN4:
- if (PhnsetGetTimeFormat())
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- else
- {
- if (hours == 12)
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- else if (hours == 0)
- {
- sprintf((S8*) ts, "%02d:%02d", 12, minutes);
- }
- else if (hours > 12)
- {
- sprintf((S8*) ts, "%02d:%02d", hours - 12, minutes);
- }
- else
- {
- sprintf((S8*) ts, "%02d:%02d", hours, minutes);
- }
- }
- AnsiiToUnicodeString((S8*) s, ts);
- break;
- #endif /* __MMI_SUBLCD__ */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * duration_string
- * DESCRIPTION
- *
- * PARAMETERS
- * t [?]
- * s [IN]
- * flags [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void duration_string(UI_time *t, UI_string_type s, U32 flags)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 hours, minutes, seconds;
- S8 ts[32];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- hours = get_hours(t);
- minutes = get_minutes(t);
- seconds = get_seconds(t);
- switch (flags & DT_FLAGS_TYPE)
- {
- case DT_IDLE_SCREEN:
- case DT_IDLE_SCREEN_ENGLISH_ONLY:
- case DT_NETWORK_SEARCH:
- case DT_MO_CALL_SCREEN:
- case DT_MO_CALLING_SCREEN:
- case DT_MT_CALL_SCREEN:
- case DT_ACTIVE_CALL_SCREEN:
- case DT_TABBED_CALL_SCREEN:
- #ifdef __MMI_SUBLCD__
- case DT_SUBLCD_IDLE_SCREEN1:
- case DT_SUBLCD_IDLE_SCREEN2:
- #endif /* __MMI_SUBLCD__ */
- sprintf((S8*) ts, "%02d:%02d:%02d", hours, minutes, seconds);
- break;
- case DT_AUDIO_PLAY_DURATION:
- sprintf((S8*) ts, "%02d:%02d", minutes, seconds);
- break;
- }
- AnsiiToUnicodeString((S8*) s, ts);
- }
- /*****************************************************************************
- * FUNCTION
- * get_time_difference2
- * DESCRIPTION
- *
- * PARAMETERS
- * new_time [?]
- * ref_time [?]
- * diff_time [?]
- * RETURNS
- * void
- *****************************************************************************/
- void get_time_difference2(UI_time *new_time, UI_time *ref_time, UI_time *diff_time)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 min_flag = 0, hour_flag = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (new_time->nSec >= ref_time->nSec)
- {
- diff_time->nSec = new_time->nSec - ref_time->nSec;
- }
- else
- {
- diff_time->nSec = new_time->nSec + 60 - ref_time->nSec;
- min_flag = 1;
- }
- if (new_time->nMin >= ref_time->nMin + min_flag)
- {
- diff_time->nMin = new_time->nMin - ref_time->nMin - min_flag;
- }
- else
- {
- diff_time->nMin = new_time->nMin + 60 - ref_time->nMin - min_flag;
- hour_flag = 1;
- }
- if (new_time->nHour >= ref_time->nHour + hour_flag)
- {
- diff_time->nHour = new_time->nHour - ref_time->nHour - hour_flag;
- }
- else
- {
- diff_time->nHour = new_time->nHour + 24 - ref_time->nHour - hour_flag;
- new_time->nDay -= 1;
- }
- diff_time->nDay = 0;
- diff_time->nMonth = 0;
- diff_time->nYear = 0;
- diff_time->DayIndex = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * increment_seconds
- * DESCRIPTION
- * increment the seconds by 1
- * PARAMETERS
- * t [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void increment_seconds(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_time curr_time, diff_time;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DTGetRTCTime(&curr_time);
- get_time_difference2(&curr_time, &last_duration_time, &diff_time);
- IncrementTime(*t, diff_time, t );
- last_duration_time.nSec = curr_time.nSec;
- last_duration_time.nMin = curr_time.nMin;
- last_duration_time.nHour = curr_time.nHour;
- last_duration_time.nDay = curr_time.nDay;
- last_duration_time.nMonth = curr_time.nMonth;
- last_duration_time.DayIndex = curr_time.DayIndex;
- }
- /*****************************************************************************
- * FUNCTION
- * increment_ticks
- * DESCRIPTION
- *
- * PARAMETERS
- * t [?]
- * RETURNS
- * void
- *****************************************************************************/
- void increment_ticks(UI_time *t)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 current_time;
- U32 secs, mins, hrs;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- kal_get_time(¤t_time);
- secs = (U32) ((current_time - last_duration_ticks + last_duration) * 0.004615 + 0.5);
- mins = secs / 60;
- hrs = mins / 60;
- t->nSec = (U8) (secs - mins * 60);
- t->nMin = (U8) (mins - hrs * 60);
- t->nHour = (U8) hrs;
- t->nYear = t->nMonth = t->nDay = 0;
- }
- FLOAT dt_difference1;
- FLOAT dt_difference2;
- #ifdef __MMI_SUBLCD__
- /*****************************************************************************
- * FUNCTION
- * get_time_difference
- * DESCRIPTION
- * calculate time difference between two times pass as parameter
- * PARAMETERS
- * time_303 [?]
- * city_diff_time [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void get_time_difference(MYTIME *time_303, FLOAT city_diff_time)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 total_time, hour_sublcd1, min_sublcd1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- total_time = ((time_303->nHour * 60) + time_303->nMin) + ((S32) (city_diff_time * 60));
- if (total_time < 0)
- {
- total_time = 1440 + total_time;
- }
- if (total_time > 1440)
- {
- total_time = total_time - 1440;
- }
- hour_sublcd1 = total_time / 60;
- min_sublcd1 = total_time % 60;
- time_303->nHour = (U8) hour_sublcd1;
- time_303->nMin = (U8) min_sublcd1;
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * FUNCTION
- * set_time_difference
- * DESCRIPTION
- * set value of output parameter equal to input parameter
- * PARAMETERS
- * t [OUT]
- * diff [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void set_time_difference(MYTIME *t, MYTIME *diff)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- *t = *diff;
- }
- #ifdef __MMI_ANALOG_CLOCK__
- /* Externals for Analog clock */
- void analog_clock_minute_tick(void);
- void analog_clock_screen_saver_update_display(void);
- void show_analog_clock(void);
- /*****************************************************************************
- * FUNCTION
- * dt_update_analog_clock
- * DESCRIPTION
- * update tiem of analog clock
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void dt_update_analog_clock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- analog_clock_minute_tick();
- GetDateTime(&main_LCD_dt_object.date.t);
- main_LCD_dt_object.time.t = main_LCD_dt_object.date.t;
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- set_day_display();
- #endif
- }
- #endif /* __MMI_ANALOG_CLOCK__ */
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_hide_function
- Description: function pointer of main lcd date hide function
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_hide_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_update_function
- Description: function pointer of main lcd date update function
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_update_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_display_function
- Description: function pointer of main lcd date display function
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_display_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_close_function
- Description: function pointer of close date display of main lcd
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_close_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_hide_function
- Description: function pointer of date hide function of sub lcd
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_hide_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_update_function
- Description: function pointer of date update function of sub lcd
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_update_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_display_function
- Description: function pointer of date display function of sub lcd
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_display_function) (void) = UI_dummy_function;
- /*----------------------------------------------------------------------------
- Function: MMI_sub_LCD_dt_close_function
- Description: function pointer of date close display function of sub lcd
- Input Parameters: none
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_sub_LCD_dt_close_function) (void) = UI_dummy_function;
- /* PMT HIMANSHU START 20050721 */
- #ifdef __MMI_UI_TECHNO_IDLESCREEN_BAR__
- /*----------------------------------------------------------------------------
- Function: MMI_main_LCD_dt_day_hide_function
- Description: day hide funtion pointer of main lcd
- Input Parameters: function pointer
- Output Parameters: none
- Returns: none
- ----------------------------------------------------------------------------*/
- void (*MMI_main_LCD_dt_day_hide_function) (S32 x1, S32 y1, S32 x2, S32 y2) = UI_dummy_hide_function;
- #endif /* __MMI_UI_TECHNO_IDLESCREEN_BAR__ */
- /* PMT HIMANSHU END 20050721 */
- /* Lisen0522 */
- /*****************************************************************************
- * FUNCTION
- * update_mainlcd_dt_display
- * DESCRIPTION
- * updaet date tiem dispaly on main lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void update_mainlcd_dt_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_hide_function(); /* call current hide function of date time of main lcd */
- MMI_main_LCD_dt_update_function(); /* call current update function of date time of main lcd */
- MMI_main_LCD_dt_display_function(); /* call display function of date time of main lcd */
- }
- /* Lisen0522 */
- /*****************************************************************************
- * FUNCTION
- * update_sublcd_dt_display
- * DESCRIPTION
- * updaet date tiem dispaly on main lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void update_sublcd_dt_display(void)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_sub_LCD_dt_hide_function(); /* call current hide function of date time of sub lcd */
- MMI_sub_LCD_dt_update_function(); /* call current update function of date time of sub lcd */
- MMI_sub_LCD_dt_display_function(); /* call display function of date time of sub lcd */
- #endif /* __MMI_SUBLCD__ */
- }
- /*****************************************************************************
- * FUNCTION
- * show_main_LCD_dt_display
- * DESCRIPTION
- * get current tiem and update date time of main lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_main_LCD_dt_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_main_LCD_dt_update_function(); /* call update function of date teime of main lcd */
- MMI_main_LCD_dt_display_function(); /* call display func of date time of main lcd */
- }
- /*****************************************************************************
- * FUNCTION
- * show_sub_LCD_dt_display
- * DESCRIPTION
- * get current tiem and update date time of sub lcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_sub_LCD_dt_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_sub_LCD_dt_update_function(); /* call update function of date teime of sub lcd */
- MMI_sub_LCD_dt_display_function(); /* call display func of date time of sub lcd */
- }
- /*****************************************************************************
- * FUNCTION
- * UI_dummy_hide_function
- * DESCRIPTION
- * dummy hide function :- clear the particular area with white color
- * PARAMETERS
- * x1 [IN] Start x postion
- * y1 [IN] Start y position
- * x2 [IN] End x position
- * y2 [IN] End y position
- * RETURNS
- * void
- *****************************************************************************/
- void UI_dummy_hide_function(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- // PMT DLT_FIXES - TK 200603225 START /*background color should be taken from the current MMI theme*/
- color c = *current_MMI_theme->datetime_bar_background_color;