wgui_inline_edit.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:887k
源码类别:
MTK
开发平台:
C/C++
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- }
- else
- {
- xx = 1;
- }
- /* MTK end */
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- clear_inline_item_keys = clear_inline_select_menu_keys;
- current_wgui_inline_select_item = i;
- current_wgui_inline_select_text_p = text_p;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- initialize_inline_select_menu_items(
- x + xx,
- y,
- width - xx,
- height,
- i->n_items,
- i->list_of_strings,
- i->highlighted_item,
- current_inline_select_highlight_handler);
- }
- else
- {
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- initialize_inline_select_menu_items(
- x + xx,
- y,
- width - 1 - xx,
- height,
- i->n_items,
- i->list_of_strings,
- i->highlighted_item,
- current_inline_select_highlight_handler);
- }
- else
- {
- initialize_inline_select_menu_items(
- x + xx,
- y,
- width - 1 - MMI_fixed_icontext_menuitem.text_x,
- height,
- i->n_items,
- i->list_of_strings,
- i->highlighted_item,
- current_inline_select_highlight_handler);
- }
- }
- /* MTK end */
- register_inline_select_menu_keys();
- if (current_wgui_inline_select_highlighted_item == NULL)
- {
- current_wgui_inline_select_highlighted_item = i->highlighted_item;
- current_inline_select_highlight_handler(*i->highlighted_item);
- }
- else
- {
- current_wgui_inline_select_highlighted_item = i->highlighted_item;
- }
- show_inline_select_menu();
- complete_inline_item_edit = inline_select_menu_change_complete;
- redraw_current_inline_item = redraw_inline_select;
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_current_inline_item_pen_function = inline_select_pen_handler;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * n_items [IN]
- * list_of_items [IN]
- * highlighted_item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemSelect(InlineItem *item, S32 n_items, U8 **list_of_items, S32 *highlighted_item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_select_items >= MAX_INLINE_SELECT_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_select_items[n_inline_select_items];
- item->flags = INLINE_ITEM_TYPE_SELECT;
- n_inline_select_items++;
- i = (wgui_inline_item_select*) item->item;
- i->flags = 0;
- i->list_of_strings = list_of_items;
- i->n_items = n_items;
- i->item_highlighted = UI_dummy_function_s32;
- if (highlighted_item == NULL)
- {
- i->highlighted_item = NULL;
- item->text_p = list_of_items[0];
- }
- else
- {
- if (*highlighted_item < 0 || *highlighted_item >= n_items)
- {
- MMI_DBG_ASSERT(0);
- *highlighted_item = 0;
- }
- i->highlighted_item = highlighted_item;
- item->text_p = list_of_items[*highlighted_item];
- }
- item->handler = handle_inline_select;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * n_items [IN]
- * list_of_items [IN]
- * highlighted_item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemSelect(InlineItem *item, S32 n_items, U8 **list_of_items, S32 *highlighted_item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_SELECT)
- {
- return;
- }
- i = (wgui_inline_item_select*) item->item;
- i->flags = 0;
- i->list_of_strings = list_of_items;
- i->n_items = n_items;
- i->item_highlighted = UI_dummy_function_s32;
- if (highlighted_item == NULL)
- {
- i->highlighted_item = NULL;
- item->text_p = list_of_items[0];
- }
- else
- {
- if (*highlighted_item < 0 || *highlighted_item >= n_items)
- {
- MMI_DBG_ASSERT(0);
- *highlighted_item = 0;
- }
- i->highlighted_item = highlighted_item;
- item->text_p = list_of_items[*highlighted_item];
- }
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterInlineSelectHighlightHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterInlineSelectHighlightHandler(InlineItem *item, void (*f) (S32 item_index))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- i = (wgui_inline_item_select*) item->item;
- if (f != NULL)
- {
- i->item_highlighted = f;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetInlineSelectHighlightedItem
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- S32 GetInlineSelectHighlightedItem(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (*current_wgui_inline_select_item->highlighted_item);
- }
- /*----------------------------------------------------------------------------
- Inline date edit implementation
- ----------------------------------------------------------------------------*/
- #define MAX_INLINE_DATE_ITEMS 4
- #define MAX_INLINE_DATE_DISPLAY_STRING_SIZE 26 /* 12 chars with null terminator */
- S32 n_inline_date_items = 0;
- wgui_inline_item_date wgui_inline_date_items[MAX_INLINE_DATE_ITEMS];
- U8 wgui_inline_date_display_strings[MAX_INLINE_DATE_ITEMS][MAX_INLINE_DATE_DISPLAY_STRING_SIZE];
- wgui_inline_item_date *current_wgui_inline_date_item;
- U8 **current_wgui_inline_date_text_p;
- U8 wgui_inline_date_edit_day_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_date_edit_month_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_date_edit_year_buffer[5 * ENCODING_LENGTH];
- date_input wgui_inline_date_input;
- /*****************************************************************************
- * FUNCTION
- * handle_inline_date_edit_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_date_edit_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_inline_fixed_list_keys();
- gui_strcpy(
- (UI_string_type) current_wgui_inline_date_item->day_buffer,
- (UI_string_type) wgui_inline_date_edit_day_buffer);
- gui_strcpy(
- (UI_string_type) current_wgui_inline_date_item->month_buffer,
- (UI_string_type) wgui_inline_date_edit_month_buffer);
- gui_strcpy(
- (UI_string_type) current_wgui_inline_date_item->year_buffer,
- (UI_string_type) wgui_inline_date_edit_year_buffer);
- current_wgui_inline_date_item->string_construct_callback(
- *current_wgui_inline_date_text_p,
- current_wgui_inline_date_item->day_buffer,
- current_wgui_inline_date_item->month_buffer,
- current_wgui_inline_date_item->year_buffer);
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
- (UI_string_type) * current_wgui_inline_date_text_p;
- clear_left_softkey();
- clear_right_softkey();
- #if(0)
- set_left_softkey_label(inline_full_screen_edit_saved_LSK_label);
- set_left_softkey_icon(inline_full_screen_edit_saved_LSK_icon);
- set_right_softkey_label(inline_full_screen_edit_saved_RSK_label);
- set_right_softkey_icon(inline_full_screen_edit_saved_RSK_icon);
- #endif /* (0) */
- register_left_softkey_handler();
- register_right_softkey_handler();
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_editor_close_input_box();
- #endif
- wgui_inline_item_handled = 0;
- wgui_text_menuitem_restart_scrolling();
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- complete_inline_item_edit = UI_dummy_function;
- set_current_date_input(NULL);
- clear_date_input_callback();
- #if defined(__MMI_TOUCH_SCREEN__)
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
- //W06.09 Draw Center Softkey when entering new screen
- //But in in-line editor, redrawing is needed when completing in-line item
- #ifdef __MMI_WGUI_CSK_ENABLE__
- redraw_softkey(MMI_CENTER_SOFTKEY);
- #endif
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_date_edit_cancel
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_date_edit_cancel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_inline_fixed_list_keys();
- clear_left_softkey();
- clear_right_softkey();
- #if(0)
- set_left_softkey_label(inline_full_screen_edit_saved_LSK_label);
- set_left_softkey_icon(inline_full_screen_edit_saved_LSK_icon);
- set_right_softkey_label(inline_full_screen_edit_saved_RSK_label);
- set_right_softkey_icon(inline_full_screen_edit_saved_RSK_icon);
- #endif /* (0) */
- register_left_softkey_handler();
- register_right_softkey_handler();
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_editor_close_input_box();
- #endif
- wgui_inline_item_handled = 0;
- wgui_text_menuitem_restart_scrolling();
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- complete_inline_item_edit = UI_dummy_function;
- set_current_date_input(NULL);
- clear_date_input_callback();
- #if defined(__MMI_TOUCH_SCREEN__)
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
- //W06.09 Draw Center Softkey when entering new screen
- //But in in-line editor, redrawing is needed when completing in-line item
- #ifdef __MMI_WGUI_CSK_ENABLE__
- redraw_softkey(MMI_CENTER_SOFTKEY);
- #endif
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- /*****************************************************************************
- * FUNCTION
- * redraw_inline_date_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_inline_date_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- date_input_show_background(&wgui_inline_date_input);
- show_date_input(&wgui_inline_date_input);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_date_edit_handle_down_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_date_edit_handle_down_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle_inline_date_edit_complete();
- inline_fixed_list_goto_next_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_date_edit_handle_up_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_date_edit_handle_up_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle_inline_date_edit_complete();
- inline_fixed_list_goto_previous_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_date_input_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void inline_date_input_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:
- date_input_previous_character();
- break;
- case 38:
- inline_date_edit_handle_up_arrow();
- break;
- case 39:
- date_input_next_character();
- break;
- case 40:
- inline_date_edit_handle_down_arrow();
- break;
- case 36: /* home */
- break;
- case 35: /* end */
- break;
- case 33: /* page up */
- break;
- case 34: /* page down */
- break;
- case 45:
- date_input_toggle_insert_mode();
- break;
- case 46:
- date_input_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
- * handle_inline_date_edit_input
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_date_edit_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_wgui_inline_list_menu_changed();
- }
- /* History implementation for inline date edit */
- typedef struct _inline_date_edit_history
- {
- U16 history_ID;
- S16 current_focus;
- S16 current_position;
- S16 dummy; /* Added for history issue on hardware */
- U32 flags;
- } inline_date_edit_history;
- /*****************************************************************************
- * FUNCTION
- * inline_date_edit_get_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 *inline_date_edit_get_history(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- U16 hID = (U16) (INLINE_DATE_HISTORY_ID | 0x8000);
- inline_date_edit_history *h = (inline_date_edit_history*) history_buffer;
- h->history_ID = hID;
- h->current_focus = (S16) wgui_inline_date_input.current_focus;
- if (wgui_inline_date_input.focus_input_box != NULL)
- {
- h->current_position =
- (S16) (wgui_inline_date_input.focus_input_box->current_text_p -
- wgui_inline_date_input.focus_input_box->text);
- }
- h->flags = wgui_inline_date_input.flags;
- }
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_date_edit_set_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_ID [IN]
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 inline_date_edit_set_history(U16 history_ID, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- inline_date_edit_history *h = (inline_date_edit_history*) history_buffer;
- if (history_valid(h->history_ID, history_ID))
- {
- wgui_inline_date_input.current_focus = h->current_focus;
- date_input_reset_focus(&wgui_inline_date_input);
- date_input_set_focus(&wgui_inline_date_input);
- if (wgui_inline_date_input.focus_input_box != NULL)
- {
- wgui_inline_date_input.focus_input_box->current_text_p =
- wgui_inline_date_input.focus_input_box->text + h->current_position;
- }
- wgui_inline_date_input.flags = h->flags;
- return (1);
- }
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_date_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_date_edit(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_date *i = (wgui_inline_item_date*) item;
- S32 xx;
- U32 dtflags = DATE_INPUT_TYPE_YYYY_MM_DD;
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_handwriting_area_struct stroke_area;
- mmi_pen_handwriting_area_struct ext_stroke;
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(flags);
- wgui_current_inline_item_type = INLINE_ITEM_TYPE_DATE;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- }
- else
- {
- xx = 1;
- }
- /* MTK end */
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- switch (flags & INLINE_ITEM_JUSTIFY_MASK)
- {
- case INLINE_ITEM_RIGHT_JUSTIFY:
- dtflags |= DATE_INPUT_RIGHT_JUSTIFY;
- break;
- case INLINE_ITEM_CENTER_JUSTIFY:
- dtflags |= DATE_INPUT_CENTER_JUSTIFY;
- break;
- }
- complete_inline_item_edit = handle_inline_date_edit_complete;
- current_wgui_inline_date_item = i;
- current_wgui_inline_date_text_p = text_p;
- gui_strcpy((UI_string_type) wgui_inline_date_edit_day_buffer, (UI_string_type) i->day_buffer);
- gui_strcpy((UI_string_type) wgui_inline_date_edit_month_buffer, (UI_string_type) i->month_buffer);
- gui_strcpy((UI_string_type) wgui_inline_date_edit_year_buffer, (UI_string_type) i->year_buffer);
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- create_date_input(
- &wgui_inline_date_input,
- x + xx,
- y,
- width - xx,
- height,
- dtflags,
- wgui_inline_date_edit_day_buffer,
- wgui_inline_date_edit_month_buffer,
- wgui_inline_date_edit_year_buffer);
- }
- else
- {
- /* PMT VIKAS START 20050817 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- /* To reduce the highlighter's width */
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- create_date_input(
- &wgui_inline_date_input,
- x + xx,
- y,
- width - 1 - xx,
- height,
- dtflags,
- wgui_inline_date_edit_day_buffer,
- wgui_inline_date_edit_month_buffer,
- wgui_inline_date_edit_year_buffer);
- }
- else
- {
- create_date_input(
- &wgui_inline_date_input,
- x + xx,
- y,
- width - 1 - MMI_fixed_icontext_menuitem.text_x - 4,
- height,
- dtflags,
- wgui_inline_date_edit_day_buffer,
- wgui_inline_date_edit_month_buffer,
- wgui_inline_date_edit_year_buffer);
- }
- #else /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- create_date_input(
- &wgui_inline_date_input,
- x + xx,
- y,
- width - xx,
- height,
- dtflags,
- wgui_inline_date_edit_day_buffer,
- wgui_inline_date_edit_month_buffer,
- wgui_inline_date_edit_year_buffer);
- }
- else
- {
- create_date_input(
- &wgui_inline_date_input,
- x + xx,
- y,
- width - MMI_fixed_icontext_menuitem.text_x,
- height,
- dtflags,
- wgui_inline_date_edit_day_buffer,
- wgui_inline_date_edit_month_buffer,
- wgui_inline_date_edit_year_buffer);
- }
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- /* PMT VIKAS END 20050817 */
- }
- /* MTK end */
- inline_date_edit_set_history(INLINE_DATE_HISTORY_ID, history_buffer);
- date_input_set_seperator(&wgui_inline_date_input, (UI_character_type) '/');
- date_input_show_background(&wgui_inline_date_input);
- show_date_input(&wgui_inline_date_input);
- set_current_date_input(&wgui_inline_date_input);
- date_input_register_keys();
- register_keyboard_key_handler(inline_date_input_key_handler);
- SetKeyHandler(inline_date_edit_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_date_edit_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_date_edit_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- SetKeyHandler(inline_date_edit_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
- redraw_current_inline_item = redraw_inline_date_edit;
- register_date_input_callback(handle_inline_date_edit_input);
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- ext_stroke.x1 = 0;
- ext_stroke.y1 = 0;
- ext_stroke.x2 = UI_device_width - 1;
- ext_stroke.y2 = UI_device_height - 1;
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* 0 */
- stroke_area.x1 = MMI_content_x;
- stroke_area.x2 = MMI_content_x + MMI_content_width - MMI_fixed_list_menu.vbar.width;
- stroke_area.y1 = MMI_title_y;
- stroke_area.y2 = MMI_title_y + MMI_content_height + MMI_title_height;
- #endif /* 0 */
- mmi_pen_editor_setup_input_box(&stroke_area, &ext_stroke, INPUT_TYPE_NUMERIC, MMI_FALSE, PEN_EDITOR_DATE);
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemDate
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * day_buffer [?]
- * month_buffer [?]
- * year_buffer [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemDate(
- InlineItem *item,
- U8 *day_buffer,
- U8 *month_buffer,
- U8 *year_buffer,
- void (*f) (U8 *string_buffer, U8 *day_buffer, U8 *month_buffer, U8 *year_buffer))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_date *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_date_items >= MAX_INLINE_DATE_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_date_items[n_inline_date_items];
- item->flags = INLINE_ITEM_TYPE_DATE;
- item->text_p = (U8*) wgui_inline_date_display_strings[n_inline_date_items];
- n_inline_date_items++;
- i = (wgui_inline_item_date*) item->item;
- i->day_buffer = day_buffer;
- i->month_buffer = month_buffer;
- i->year_buffer = year_buffer;
- i->flags = INLINE_ITEM_LEFT_JUSTIFY;
- i->string_construct_callback = f;
- i->string_construct_callback(item->text_p, i->day_buffer, i->month_buffer, i->year_buffer);
- item->handler = handle_inline_date_edit;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemDate
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * day_buffer [?]
- * month_buffer [?]
- * year_buffer [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemDate(
- InlineItem *item,
- U8 *day_buffer,
- U8 *month_buffer,
- U8 *year_buffer,
- void (*f) (U8 *string_buffer, U8 *day_buffer, U8 *month_buffer, U8 *year_buffer))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_date *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_DATE)
- {
- return;
- }
- i = (wgui_inline_item_date*) item->item;
- i->day_buffer = day_buffer;
- i->month_buffer = month_buffer;
- i->year_buffer = year_buffer;
- i->flags = 0;
- i->string_construct_callback = f;
- i->string_construct_callback(item->text_p, i->day_buffer, i->month_buffer, i->year_buffer);
- }
- /* Displaying date edit as a menu item in the fixed list menu */
- date_input wgui_inline_date_input_display;
- U8 wgui_inline_date_edit_day_display_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_date_edit_month_display_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_date_edit_year_display_buffer[5 * ENCODING_LENGTH];
- /*****************************************************************************
- * FUNCTION
- * wgui_set_date_time_input_focussed_theme
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_date_time_input_focussed_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c1 = {0, 0, 0, 100};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- date_time_input_theme.disabled_filler = wgui_inline_singleline_inputbox_focussed_theme.disabled_filler;
- date_time_input_theme.normal_filler = wgui_inline_singleline_inputbox_focussed_theme.normal_filler;
- date_time_input_theme.selected_filler = wgui_inline_singleline_inputbox_focussed_theme.selected_filler;
- date_time_input_theme.disabled_text_color = wgui_inline_singleline_inputbox_focussed_theme.disabled_text_color;
- date_time_input_theme.normal_text_color = wgui_inline_singleline_inputbox_focussed_theme.normal_text_color;
- date_time_input_theme.selected_text_color = wgui_inline_singleline_inputbox_focussed_theme.selected_text_color;
- date_time_input_background_filler = *wgui_inline_singleline_inputbox_focussed_theme.normal_filler;
- date_time_input_background_filler.flags &= 0x00000fff;
- date_time_input_background_filler.flags |= UI_FILLED_AREA_SINGLE_BORDER;
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- date_time_input_background_filler.border_color = current_MMI_theme->list_background_filler->border_color;
- #else
- date_time_input_background_filler.border_color = c1;
- #endif
- /* PMT VIKAS END 20050707 */
- date_time_input_theme.cursor_color = *current_MMI_theme->inline_edit_cursor_color;
- date_time_input_theme.selection_text_color = *current_MMI_theme->inline_edit_selected_text_color;
- date_time_input_theme.selection_color = *current_MMI_theme->inline_edit_selector_color;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_set_date_time_input_unfocussed_theme
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_set_date_time_input_unfocussed_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c1 = {0, 0, 0, 100};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- date_time_input_theme.disabled_filler = wgui_inline_singleline_inputbox_unfocussed_theme.disabled_filler;
- /* 20051012 HIMANSHU START COMMON */
- /* changed the date time normal filler in case of default text effect is enabled. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- date_time_input_theme.normal_filler = &temp_inline_edit_normal_filler;
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END COMMON */
- date_time_input_theme.normal_filler = wgui_inline_singleline_inputbox_unfocussed_theme.normal_filler;
- date_time_input_theme.selected_filler = wgui_inline_singleline_inputbox_unfocussed_theme.selected_filler;
- date_time_input_theme.disabled_text_color = wgui_inline_singleline_inputbox_unfocussed_theme.disabled_text_color;
- date_time_input_theme.normal_text_color = wgui_inline_singleline_inputbox_unfocussed_theme.normal_text_color;
- date_time_input_theme.selected_text_color = wgui_inline_singleline_inputbox_unfocussed_theme.selected_text_color;
- date_time_input_background_filler = *wgui_inline_singleline_inputbox_unfocussed_theme.normal_filler;
- date_time_input_background_filler.flags &= 0x00000fff;
- date_time_input_background_filler.flags |= UI_FILLED_AREA_SINGLE_BORDER;
- /* PMT VIKAS START 20050707 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- date_time_input_background_filler.border_color = current_MMI_theme->list_background_filler->border_color;
- #else
- date_time_input_background_filler.border_color = c1;
- #endif
- /* PMT VIKAS END 20050707 */
- time_period_input_background_filler = MMI_inputbox_normal_filler; /* *MMI_fixed_list_menu.normal_filler; */
- date_time_input_theme.cursor_color = *current_MMI_theme->inline_edit_cursor_color;
- date_time_input_theme.selection_text_color = *current_MMI_theme->inline_edit_selected_text_color;
- date_time_input_theme.selection_color = *current_MMI_theme->inline_edit_selector_color;
- }
- /*****************************************************************************
- * FUNCTION
- * wgui_show_inline_date_list_menuitem
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * width [IN]
- * height [IN]
- * item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_inline_date_list_menuitem(S32 x1, S32 y1, S32 width, S32 height, wgui_inline_item *item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_date *i = (wgui_inline_item_date*) item->item;
- S32 xx;
- U32 dtflags = DATE_INPUT_TYPE_YYYY_MM_DD;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (item->flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- switch (item->flags & INLINE_ITEM_JUSTIFY_MASK)
- {
- case INLINE_ITEM_RIGHT_JUSTIFY:
- dtflags |= DATE_INPUT_RIGHT_JUSTIFY;
- break;
- case INLINE_ITEM_CENTER_JUSTIFY:
- dtflags |= DATE_INPUT_CENTER_JUSTIFY;
- break;
- }
- gui_strcpy((UI_string_type) wgui_inline_date_edit_day_display_buffer, (UI_string_type) i->day_buffer);
- gui_strcpy((UI_string_type) wgui_inline_date_edit_month_display_buffer, (UI_string_type) i->month_buffer);
- gui_strcpy((UI_string_type) wgui_inline_date_edit_year_display_buffer, (UI_string_type) i->year_buffer);
- wgui_set_date_time_input_unfocussed_theme();
- create_date_input(
- &wgui_inline_date_input_display,
- x1 + xx,
- y1,
- width - xx,
- height,
- dtflags,
- wgui_inline_date_edit_day_display_buffer,
- wgui_inline_date_edit_month_display_buffer,
- wgui_inline_date_edit_year_display_buffer);
- date_input_set_seperator(&wgui_inline_date_input_display, (UI_character_type) '/');
- /* 20051012 HIMANSHU START INLINE DATE */
- /* show the different background in case of default text effect is enabled
- for the inline item type Date. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- inline_item_default_text_show_background(
- wgui_inline_date_input_display.x,
- wgui_inline_date_input_display.y,
- wgui_inline_date_input_display.x + wgui_inline_date_input_display.width - 1,
- wgui_inline_date_input_display.y + wgui_inline_date_input_display.height - 1);
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DATE */
- date_input_show_background(&wgui_inline_date_input_display);
- date_input_reset_focus(&wgui_inline_date_input_display);
- show_date_input(&wgui_inline_date_input_display);
- wgui_set_date_time_input_focussed_theme();
- redraw_left_softkey();
- redraw_right_softkey();
- gdi_layer_unlock_frame_buffer();
- }
- /*----------------------------------------------------------------------------
- Inline time edit implementation
- ----------------------------------------------------------------------------*/
- #define MAX_INLINE_TIME_ITEMS 4
- #define MAX_INLINE_TIME_DISPLAY_STRING_SIZE 24
- S32 n_inline_time_items = 0;
- wgui_inline_item_time wgui_inline_time_items[MAX_INLINE_TIME_ITEMS];
- U8 wgui_inline_time_display_strings[MAX_INLINE_TIME_ITEMS][MAX_INLINE_TIME_DISPLAY_STRING_SIZE];
- wgui_inline_item_time *current_wgui_inline_time_item;
- U8 **current_wgui_inline_time_text_p;
- U8 wgui_inline_time_edit_hours_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_edit_minutes_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_edit_seconds_buffer[3 * ENCODING_LENGTH];
- U8 *wgui_inline_time_AM_PM_flag;
- time_input wgui_inline_time_input;
- /*****************************************************************************
- * FUNCTION
- * handle_inline_time_edit_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_time_edit_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_inline_fixed_list_keys();
- gui_strcpy(
- (UI_string_type) current_wgui_inline_time_item->hours_buffer,
- (UI_string_type) wgui_inline_time_edit_hours_buffer);
- gui_strcpy(
- (UI_string_type) current_wgui_inline_time_item->minutes_buffer,
- (UI_string_type) wgui_inline_time_edit_minutes_buffer);
- current_wgui_inline_time_item->AM_PM_flag = wgui_inline_time_AM_PM_flag;
- current_wgui_inline_time_item->string_construct_callback(
- *current_wgui_inline_time_text_p,
- current_wgui_inline_time_item->hours_buffer,
- current_wgui_inline_time_item->minutes_buffer,
- current_wgui_inline_time_item->AM_PM_flag);
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
- (UI_string_type) * current_wgui_inline_time_text_p;
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_editor_close_input_box();
- #endif
- wgui_inline_item_handled = 0;
- wgui_text_menuitem_restart_scrolling();
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- complete_inline_item_edit = UI_dummy_function;
- set_current_time_input(NULL);
- clear_time_input_callback();
- #if defined(__MMI_TOUCH_SCREEN__)
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
- //W06.09 Draw Center Softkey when entering new screen
- //But in in-line editor, redrawing is needed when completing in-line item
- #ifdef __MMI_WGUI_CSK_ENABLE__
- redraw_softkey(MMI_CENTER_SOFTKEY);
- #endif
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_time_edit_cancel
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_time_edit_cancel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_inline_fixed_list_keys();
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_editor_close_input_box();
- #endif
- wgui_inline_item_handled = 0;
- wgui_text_menuitem_restart_scrolling();
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- complete_inline_item_edit = UI_dummy_function;
- set_current_time_input(NULL);
- clear_time_input_callback();
- #if defined(__MMI_TOUCH_SCREEN__)
- wgui_setup_virtual_keyboard(GUI_VIRTUAL_KEYBOARD_EMPTY_TRAY);
- //W06.09 Draw Center Softkey when entering new screen
- //But in in-line editor, redrawing is needed when completing in-line item
- #ifdef __MMI_WGUI_CSK_ENABLE__
- redraw_softkey(MMI_CENTER_SOFTKEY);
- #endif
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- /*****************************************************************************
- * FUNCTION
- * redraw_inline_time_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_inline_time_edit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- time_input_show_background(&wgui_inline_time_input);
- show_time_input(&wgui_inline_time_input);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_time_edit_handle_down_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_time_edit_handle_down_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle_inline_time_edit_complete();
- inline_fixed_list_goto_next_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_time_edit_handle_up_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_time_edit_handle_up_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- handle_inline_time_edit_complete();
- inline_fixed_list_goto_previous_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_time_input_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void inline_time_input_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:
- time_input_previous_character();
- break;
- case 38:
- inline_time_edit_handle_up_arrow();
- break;
- case 39:
- time_input_next_character();
- break;
- case 40:
- inline_time_edit_handle_down_arrow();
- break;
- case 36: /* home */
- break;
- case 35: /* end */
- break;
- case 33: /* page up */
- break;
- case 34: /* page down */
- break;
- case 45:
- time_input_toggle_insert_mode();
- break;
- case 46:
- time_input_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
- * handle_inline_time_edit_input
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_time_edit_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_wgui_inline_list_menu_changed();
- }
- /* History implementation for inline time edit */
- typedef struct _inline_time_edit_history
- {
- U16 history_ID;
- S16 current_focus;
- S16 current_position;
- S16 dummy; /* Added for history issue on hardware */
- U32 flags;
- } inline_time_edit_history;
- /*****************************************************************************
- * FUNCTION
- * inline_time_edit_get_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 *inline_time_edit_get_history(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- U16 hID = (U16) (INLINE_TIME_HISTORY_ID | 0x8000);
- inline_time_edit_history *h = (inline_time_edit_history*) history_buffer;
- h->history_ID = hID;
- h->current_focus = (S16) wgui_inline_time_input.current_focus;
- if (wgui_inline_time_input.focus_input_box != NULL)
- {
- h->current_position =
- (S16) (wgui_inline_time_input.focus_input_box->current_text_p -
- wgui_inline_time_input.focus_input_box->text);
- }
- h->flags = wgui_inline_time_input.flags;
- }
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_time_edit_set_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_ID [IN]
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 inline_time_edit_set_history(U16 history_ID, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- inline_time_edit_history *h = (inline_time_edit_history*) history_buffer;
- if (history_valid(h->history_ID, history_ID))
- {
- wgui_inline_time_input.current_focus = h->current_focus;
- time_input_reset_focus(&wgui_inline_time_input);
- time_input_set_focus(&wgui_inline_time_input);
- if (wgui_inline_time_input.focus_input_box != NULL)
- {
- wgui_inline_time_input.focus_input_box->current_text_p =
- wgui_inline_time_input.focus_input_box->text + h->current_position;
- }
- wgui_inline_time_input.flags = h->flags;
- return (1);
- }
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_time_edit
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_time_edit(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_time *i = (wgui_inline_item_time*) item;
- S32 xx;
- U32 dtflags = TIME_INPUT_TYPE_HH_MM;
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_handwriting_area_struct stroke_area;
- mmi_pen_handwriting_area_struct ext_stroke;
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(flags);
- wgui_current_inline_item_type = INLINE_ITEM_TYPE_TIME;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- }
- else
- {
- xx = 1;
- }
- /* MTK end */
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- switch (flags & INLINE_ITEM_JUSTIFY_MASK)
- {
- case INLINE_ITEM_RIGHT_JUSTIFY:
- dtflags |= TIME_INPUT_RIGHT_JUSTIFY;
- break;
- case INLINE_ITEM_CENTER_JUSTIFY:
- dtflags |= TIME_INPUT_CENTER_JUSTIFY;
- break;
- }
- complete_inline_item_edit = handle_inline_time_edit_complete;
- current_wgui_inline_time_item = i;
- current_wgui_inline_time_text_p = text_p;
- gui_strcpy((UI_string_type) wgui_inline_time_edit_hours_buffer, (UI_string_type) i->hours_buffer);
- gui_strcpy((UI_string_type) wgui_inline_time_edit_minutes_buffer, (UI_string_type) i->minutes_buffer);
- wgui_inline_time_AM_PM_flag = i->AM_PM_flag;
- /* MTK Elvis for R2L characters */
- if (!r2lMMIFlag)
- {
- create_time_input(
- &wgui_inline_time_input,
- x + xx,
- y,
- width - xx,
- height,
- dtflags,
- wgui_inline_time_edit_hours_buffer,
- wgui_inline_time_edit_minutes_buffer,
- wgui_inline_time_edit_seconds_buffer);
- }
- else
- {
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- create_time_input(
- &wgui_inline_time_input,
- x + xx,
- y,
- width - xx,
- height,
- dtflags,
- wgui_inline_time_edit_hours_buffer,
- wgui_inline_time_edit_minutes_buffer,
- wgui_inline_time_edit_seconds_buffer);
- }
- else
- {
- create_time_input(
- &wgui_inline_time_input,
- x + xx,
- y,
- width - MMI_fixed_icontext_menuitem.text_x,
- height,
- dtflags,
- wgui_inline_time_edit_hours_buffer,
- wgui_inline_time_edit_minutes_buffer,
- wgui_inline_time_edit_seconds_buffer);
- }
- }
- /* MTK end */
- inline_time_edit_set_history(INLINE_TIME_HISTORY_ID, history_buffer);
- time_input_set_seperator(&wgui_inline_time_input, (UI_character_type) ':');
- time_input_show_background(&wgui_inline_time_input);
- show_time_input(&wgui_inline_time_input);
- set_current_time_input(&wgui_inline_time_input);
- time_input_register_keys();
- register_keyboard_key_handler(inline_time_input_key_handler);
- SetKeyHandler(inline_time_edit_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_time_edit_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_time_edit_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- SetKeyHandler(inline_time_edit_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
- register_time_input_callback(handle_inline_time_edit_input);
- redraw_current_inline_item = redraw_inline_time_edit;
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- ext_stroke.x1 = 0;
- ext_stroke.y1 = 0;
- ext_stroke.x2 = UI_device_width - 1;
- ext_stroke.y2 = UI_device_height - 1;
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #else /* 0 */
- stroke_area.x1 = MMI_content_x;
- stroke_area.x2 = MMI_content_x + MMI_content_width - MMI_fixed_list_menu.vbar.width;
- stroke_area.y1 = MMI_title_y;
- stroke_area.y2 = MMI_title_y + MMI_content_height + MMI_title_height;
- #endif /* 0 */
- mmi_pen_editor_setup_input_box(&stroke_area, &ext_stroke, INPUT_TYPE_NUMERIC, MMI_FALSE, PEN_EDITOR_TIME);
- #endif /* defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__) */
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemTime
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * hours_buffer [?]
- * minutes_buffer [?]
- * AM_PM_flag [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemTime(
- InlineItem *item,
- U8 *hours_buffer,
- U8 *minutes_buffer,
- U8 *AM_PM_flag,
- void (*f) (U8 *string_buffer, U8 *hours_buffer, U8 *minutes_buffer, U8 *AM_PM_flag))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_time *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_time_items >= MAX_INLINE_TIME_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_time_items[n_inline_time_items];
- item->flags = INLINE_ITEM_TYPE_TIME;
- item->text_p = (U8*) wgui_inline_time_display_strings[n_inline_time_items];
- n_inline_time_items++;
- i = (wgui_inline_item_time*) item->item;
- i->hours_buffer = hours_buffer;
- i->minutes_buffer = minutes_buffer;
- i->seconds_buffer = NULL;
- i->AM_PM_flag = AM_PM_flag;
- i->flags = INLINE_ITEM_LEFT_JUSTIFY;
- i->string_construct_callback = f;
- i->string_construct_callback(item->text_p, i->hours_buffer, i->minutes_buffer, i->AM_PM_flag);
- item->handler = handle_inline_time_edit;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemTime
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * hours_buffer [?]
- * minutes_buffer [?]
- * AM_PM_flag [?]
- * f [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemTime(
- InlineItem *item,
- U8 *hours_buffer,
- U8 *minutes_buffer,
- U8 *AM_PM_flag,
- void (*f) (U8 *string_buffer, U8 *hours_buffer, U8 *minutes_buffer, U8 *AM_PM_flag))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_time *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_TIME)
- {
- return;
- }
- i = (wgui_inline_item_time*) item->item;
- i->hours_buffer = hours_buffer;
- i->minutes_buffer = minutes_buffer;
- i->AM_PM_flag = AM_PM_flag;
- i->flags = 0;
- i->string_construct_callback = f;
- i->string_construct_callback(item->text_p, i->hours_buffer, i->minutes_buffer, i->AM_PM_flag);
- }
- /* Displaying time edit as a menu item in the fixed list menu */
- U8 wgui_inline_time_edit_hours_display_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_edit_minutes_display_buffer[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_edit_seconds_display_buffer[3 * ENCODING_LENGTH];
- U8 *wgui_inline_time_AM_PM_display_flag;
- time_input wgui_inline_time_input_display;
- /*****************************************************************************
- * FUNCTION
- * wgui_show_inline_time_list_menuitem
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * width [IN]
- * height [IN]
- * item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_inline_time_list_menuitem(S32 x1, S32 y1, S32 width, S32 height, wgui_inline_item *item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_time *i = (wgui_inline_item_time*) item->item;
- S32 xx;
- U32 dtflags = TIME_INPUT_TYPE_HH_MM;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_lock_frame_buffer();
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (item->flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- switch (item->flags & INLINE_ITEM_JUSTIFY_MASK)
- {
- case INLINE_ITEM_RIGHT_JUSTIFY:
- dtflags |= DATE_INPUT_RIGHT_JUSTIFY;
- break;
- case INLINE_ITEM_CENTER_JUSTIFY:
- dtflags |= DATE_INPUT_CENTER_JUSTIFY;
- break;
- }
- gui_strcpy((UI_string_type) wgui_inline_time_edit_hours_display_buffer, (UI_string_type) i->hours_buffer);
- gui_strcpy((UI_string_type) wgui_inline_time_edit_minutes_display_buffer, (UI_string_type) i->minutes_buffer);
- gui_strcpy((UI_string_type) wgui_inline_time_edit_seconds_display_buffer, (UI_string_type) i->seconds_buffer);
- wgui_inline_time_AM_PM_display_flag = i->AM_PM_flag;
- wgui_set_date_time_input_unfocussed_theme();
- create_time_input(
- &wgui_inline_time_input_display,
- x1 + xx,
- y1,
- width - xx,
- height,
- dtflags,
- wgui_inline_time_edit_hours_display_buffer,
- wgui_inline_time_edit_minutes_display_buffer,
- wgui_inline_time_edit_seconds_display_buffer);
- time_input_set_seperator(&wgui_inline_time_input_display, (UI_character_type) ':');
- /* 20051012 HIMANSHU START INLINE TIME */
- /* show the different background in case of default text effect is enabled
- for the inline item type Time. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- inline_item_default_text_show_background(
- wgui_inline_time_input_display.x,
- wgui_inline_time_input_display.y,
- wgui_inline_time_input_display.x + wgui_inline_time_input_display.width - 1,
- wgui_inline_time_input_display.y + wgui_inline_time_input_display.height - 1);
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE TIME */
- time_input_show_background(&wgui_inline_time_input_display);
- time_input_reset_focus(&wgui_inline_time_input_display);
- show_time_input(&wgui_inline_time_input_display);
- wgui_set_date_time_input_focussed_theme();
- redraw_left_softkey();
- redraw_right_softkey();
- gdi_layer_unlock_frame_buffer();
- }
- /*----------------------------------------------------------------------------
- Inline user defined select strings implementation
- ----------------------------------------------------------------------------*/
- #define MAX_INLINE_USER_DEFINED_SELECT_ITEMS 4
- S32 n_inline_user_defined_select_items = 0;
- wgui_inline_item_user_defined_select wgui_inline_user_defined_select_items[MAX_INLINE_USER_DEFINED_SELECT_ITEMS];
- wgui_inline_item_user_defined_select *current_wgui_inline_user_defined_select_item;
- U8 **current_wgui_inline_user_defined_select_text_p;
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_menu_previous_item
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_user_defined_select_menu_previous_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_wgui_inline_user_defined_select_item->current_text_p =
- current_wgui_inline_user_defined_select_item->previous_item_callback();
- *current_wgui_inline_user_defined_select_text_p = current_wgui_inline_user_defined_select_item->current_text_p;
- MMI_inline_select_items[0].text = (UI_string_type) * current_wgui_inline_user_defined_select_text_p;
- show_inline_user_defined_select_menu();
- set_wgui_inline_list_menu_changed();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_menu_next_item
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_user_defined_select_menu_next_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- current_wgui_inline_user_defined_select_item->current_text_p =
- current_wgui_inline_user_defined_select_item->next_item_callback();
- *current_wgui_inline_user_defined_select_text_p = current_wgui_inline_user_defined_select_item->current_text_p;
- MMI_inline_select_items[0].text = (UI_string_type) * current_wgui_inline_user_defined_select_text_p;
- show_inline_user_defined_select_menu();
- set_wgui_inline_list_menu_changed();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_menu_change_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_user_defined_select_menu_change_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_text_menuitem_reset_scrolling();
- wgui_text_menuitem_reset_scrolling = gui_fixed_icontext_menuitem_stop_scroll;
- wgui_text_menuitem_restart_scrolling = gui_fixed_icontext_menuitem_start_scroll;
- clear_inline_select_menu_keys();
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
- (UI_string_type) * current_wgui_inline_user_defined_select_text_p;
- redraw_current_inline_item = UI_dummy_function;
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_current_inline_item_pen_function = UI_dummy_inline_item_pen_function;
- #endif
- complete_inline_item_edit = UI_dummy_function;
- wgui_inline_item_handled = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_menu_handle_up_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_user_defined_select_menu_handle_up_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_user_defined_select_menu_change_complete();
- inline_fixed_list_goto_previous_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_menu_handle_down_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_user_defined_select_menu_handle_down_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_user_defined_select_menu_change_complete();
- inline_fixed_list_goto_next_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_menu_keyboard_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void inline_user_defined_select_menu_keyboard_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:
- inline_user_defined_select_menu_previous_item();
- break;
- case 38:
- inline_user_defined_select_menu_handle_up_arrow();
- break;
- case 39:
- inline_user_defined_select_menu_next_item();
- break;
- case 40:
- inline_user_defined_select_menu_handle_down_arrow();
- 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
- * register_inline_user_defined_select_menu_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_inline_user_defined_select_menu_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(inline_user_defined_select_menu_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_user_defined_select_menu_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_user_defined_select_menu_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_user_defined_select_menu_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_user_defined_select_menu_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(inline_user_defined_select_menu_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- register_keyboard_key_handler(inline_user_defined_select_menu_keyboard_key_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * redraw_inline_user_defined_select
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_inline_user_defined_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- show_inline_user_defined_select_menu();
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * inline_user_defined_select_pen_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * pen_event [IN]
- * x [IN]
- * y [IN]
- * item_event [?]
- * RETURNS
- *
- *****************************************************************************/
- BOOL inline_user_defined_select_pen_handler(
- mmi_pen_event_type_enum pen_event,
- S16 x,
- S16 y,
- gui_inline_item_pen_enum *item_event)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL ret;
- gui_horizontal_select_pen_enum select_event;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ret = gui_horizontal_select_translate_pen_event(&MMI_inline_select_menu, pen_event, x, y, &select_event);
- if (ret)
- {
- switch (select_event)
- {
- case GUI_HORIZONTAL_SELECT_PEN_NONE:
- /* Do nothing */
- break;
- case GUI_HORIZONTAL_SELECT_PEN_PREV:
- inline_user_defined_select_menu_previous_item();
- break;
- case GUI_HORIZONTAL_SELECT_PEN_NEXT:
- inline_user_defined_select_menu_next_item();
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- *item_event = GUI_INLINE_ITEM_PEN_NONE;
- return ret;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * handle_inline_user_defined_select
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_user_defined_select(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_user_defined_select *i = (wgui_inline_item_user_defined_select*) item;
- S32 xx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(flags);
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- clear_inline_item_keys = clear_inline_select_menu_keys;
- current_wgui_inline_user_defined_select_item = i;
- current_wgui_inline_user_defined_select_text_p = text_p;
- initialize_inline_user_defined_select_menu_items(x + xx, y, width - xx, height, i->current_text_p);
- show_inline_user_defined_select_menu();
- register_inline_user_defined_select_menu_keys();
- redraw_current_inline_item = redraw_inline_user_defined_select;
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_current_inline_item_pen_function = inline_user_defined_select_pen_handler;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * dummy_inline_item_user_defined_select_callback
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- *
- *****************************************************************************/
- U8 *dummy_inline_item_user_defined_select_callback(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemUserDefinedSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * current_item_callback [IN]
- * previous_item_callback [IN]
- * next_item_callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemUserDefinedSelect(
- InlineItem *item,
- U8 *(*current_item_callback) (void),
- U8 *(*previous_item_callback) (void),
- U8 *(*next_item_callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_user_defined_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_user_defined_select_items >= MAX_INLINE_USER_DEFINED_SELECT_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_user_defined_select_items[n_inline_user_defined_select_items];
- item->flags = INLINE_ITEM_TYPE_USER_DEFINED_SELECT;
- n_inline_user_defined_select_items++;
- i = (wgui_inline_item_user_defined_select*) item->item;
- i->flags = 0;
- if (current_item_callback == NULL)
- {
- i->current_item_callback = dummy_inline_item_user_defined_select_callback;
- }
- else
- {
- i->current_item_callback = current_item_callback;
- }
- if (previous_item_callback == NULL)
- {
- i->previous_item_callback = dummy_inline_item_user_defined_select_callback;
- }
- else
- {
- i->previous_item_callback = previous_item_callback;
- }
- if (next_item_callback == NULL)
- {
- i->next_item_callback = dummy_inline_item_user_defined_select_callback;
- }
- else
- {
- i->next_item_callback = next_item_callback;
- }
- i->current_text_p = current_item_callback();
- item->text_p = i->current_text_p;
- item->handler = handle_inline_user_defined_select;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemUserDefinedSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * current_item_callback [IN]
- * previous_item_callback [IN]
- * next_item_callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemUserDefinedSelect(
- InlineItem *item,
- U8 *(*current_item_callback) (void),
- U8 *(*previous_item_callback) (void),
- U8 *(*next_item_callback) (void))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_user_defined_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_USER_DEFINED_SELECT)
- {
- return;
- }
- i = (wgui_inline_item_user_defined_select*) item->item;
- i->flags = 0;
- if (current_item_callback == NULL)
- {
- i->current_item_callback = dummy_inline_item_user_defined_select_callback;
- }
- else
- {
- i->current_item_callback = current_item_callback;
- }
- if (previous_item_callback == NULL)
- {
- i->previous_item_callback = dummy_inline_item_user_defined_select_callback;
- }
- else
- {
- i->previous_item_callback = previous_item_callback;
- }
- if (next_item_callback == NULL)
- {
- i->next_item_callback = dummy_inline_item_user_defined_select_callback;
- }
- else
- {
- i->next_item_callback = next_item_callback;
- }
- i->current_text_p = current_item_callback();
- item->text_p = i->current_text_p;
- }
- /*----------------------------------------------------------------------------
- Inline select Day Of Week implementation
- ----------------------------------------------------------------------------*/
- #define MAX_INLINE_DOW_SELECT_ITEMS 2
- S32 n_inline_DOW_items = 0;
- wgui_inline_item_DOW_select wgui_inline_DOW_select_items[MAX_INLINE_DOW_SELECT_ITEMS];
- wgui_inline_item_DOW_select *current_wgui_inline_DOW_item = NULL;
- U8 *current_wgui_inline_DOW_states = NULL;
- U8 **current_wgui_inline_DOW_text_p = NULL;
- DOW_select MMI_inline_DOW_select;
- S32 current_DOW_select_highlighted_index = -1;
- /*****************************************************************************
- * FUNCTION
- * clear_inline_DOW_select_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void clear_inline_DOW_select_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyHandler(KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- clear_keyboard_key_handler();
- clear_inline_item_keys = UI_dummy_function;
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_change_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_DOW_select_change_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- clear_inline_DOW_select_keys();
- *current_wgui_inline_DOW_text_p = (U8*) "";
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text = (UI_string_type) "";
- for (i = 0; i < 7; i++)
- {
- current_wgui_inline_DOW_states[i] = MMI_inline_DOW_select.states[i];
- }
- redraw_current_inline_item = UI_dummy_function;
- complete_inline_item_edit = UI_dummy_function;
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_current_inline_item_pen_function = UI_dummy_inline_item_pen_function;
- #endif
- clear_left_softkey();
- clear_right_softkey();
- wgui_inline_item_handled = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_handle_up_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_DOW_select_handle_up_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_DOW_select_change_complete();
- inline_fixed_list_goto_previous_item();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_handle_down_arrow
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_DOW_select_handle_down_arrow(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- inline_DOW_select_change_complete();
- inline_fixed_list_goto_next_item();
- }
- /*****************************************************************************
- * FUNCTION
- * show_inline_DOW_select
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void show_inline_DOW_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 20051012 HIMANSHU START INLINE DOW */
- /* don't call the function to show background from here, call it from the
- function, which is calling this function, in case of default text effect
- is enabled. */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (!(IsInlineItemDefaultTextEnable()))
- #endif
- /* 20051012 HIMANSHU END INLINE DOW */
- show_DOW_select_background(&MMI_inline_DOW_select);
- show_DOW_select(&MMI_inline_DOW_select);
- /* PMT VIKAS START 20050407 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- /* PMT VIKAS START 20051202 */
- {
- gui_draw_horizontal_line(
- MMI_inline_DOW_select.x,
- MMI_inline_DOW_select.x + MMI_inline_DOW_select.width - 1,
- MMI_inline_DOW_select.y + MMI_inline_DOW_select.height - 1,
- current_MMI_theme->list_background_filler->border_color);
- gui_draw_vertical_line(
- MMI_inline_DOW_select.y,
- MMI_inline_DOW_select.y + MMI_inline_DOW_select.height - 1,
- MMI_inline_DOW_select.x + MMI_inline_DOW_select.width - 1 - 2,
- current_MMI_theme->list_background_filler->border_color);
- gui_draw_vertical_line(
- MMI_inline_DOW_select.y,
- MMI_inline_DOW_select.y + MMI_inline_DOW_select.height - 1,
- MMI_fixed_list_menu.vbar.x,
- current_MMI_theme->list_background_filler->border_color);
- }
- /* PMT VIKAS END 20051202 */
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- //PMT VIKAS END 20050707
- // chnage by Leo, code revise. BLT_DOW_select(&MMI_inline_DOW_select);
- gdi_layer_blt_previous(
- MMI_inline_DOW_select.x,
- MMI_inline_DOW_select.y,
- MMI_inline_DOW_select.x + MMI_inline_DOW_select.width - 1,
- MMI_inline_DOW_select.y + MMI_inline_DOW_select.height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * set_inline_DOW_select_list_menu_theme
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void set_inline_DOW_select_list_menu_theme(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_DOW_select_list_menu_theme(&MMI_inline_DOW_select);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_DOW_select_LSK_display
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_DOW_select_LSK_display(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_inline_DOW_select.states[MMI_inline_DOW_select.highlighted_cell])
- {
- set_left_softkey_label(get_string(WGUI_CATEGORY_OFF_STRING_ID));
- }
- else
- {
- set_left_softkey_label(get_string(WGUI_CATEGORY_ON_STRING_ID));
- }
- redraw_left_softkey();
- }
- /*****************************************************************************
- * FUNCTION
- * handle_inline_DOW_select_LSK_up
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_DOW_select_LSK_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DOW_select_toggle_item(&MMI_inline_DOW_select);
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- show_DOW_select_background(&MMI_inline_DOW_select);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- handle_inline_DOW_select_LSK_display();
- set_wgui_inline_list_menu_changed();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_previous_item
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_DOW_select_previous_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DOW_select_previous(&MMI_inline_DOW_select);
- current_DOW_select_highlighted_index = MMI_inline_DOW_select.highlighted_cell;
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- show_DOW_select_background(&MMI_inline_DOW_select);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- handle_inline_DOW_select_LSK_display();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_next_item
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void inline_DOW_select_next_item(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DOW_select_next(&MMI_inline_DOW_select);
- current_DOW_select_highlighted_index = MMI_inline_DOW_select.highlighted_cell;
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- show_DOW_select_background(&MMI_inline_DOW_select);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- handle_inline_DOW_select_LSK_display();
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_keyboard_key_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * vkey_code [IN]
- * key_state [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void inline_DOW_select_keyboard_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:
- inline_DOW_select_previous_item();
- break;
- case 38:
- inline_DOW_select_handle_up_arrow();
- break;
- case 39:
- inline_DOW_select_next_item();
- break;
- case 40:
- inline_DOW_select_handle_down_arrow();
- 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
- * register_inline_DOW_select_keys
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_inline_DOW_select_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetKeyHandler(inline_DOW_select_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_DOW_select_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_DOW_select_handle_up_arrow, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_DOW_select_handle_down_arrow, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(inline_DOW_select_handle_up_arrow, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(inline_DOW_select_handle_down_arrow, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- register_keyboard_key_handler(inline_DOW_select_keyboard_key_handler);
- }
- /*****************************************************************************
- * FUNCTION
- * redraw_inline_DOW_select
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void redraw_inline_DOW_select(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- show_DOW_select_background(&MMI_inline_DOW_select);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- }
- /* History implementation for inline DOW select */
- typedef struct _inline_DOW_select_history
- {
- U16 history_ID;
- S16 highlight_index;
- U32 flags;
- } inline_DOW_select_history;
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_get_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 *inline_DOW_select_get_history(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- U16 hID = (U16) (INLINE_DOW_SELECT_HISTORY_ID | 0x8000);
- inline_DOW_select_history *h = (inline_DOW_select_history*) history_buffer;
- h->history_ID = hID;
- h->highlight_index = (S16) MMI_inline_DOW_select.highlighted_cell;
- h->flags = MMI_inline_DOW_select.flags;
- }
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_set_history
- * DESCRIPTION
- *
- * PARAMETERS
- * history_ID [IN]
- * history_buffer [?]
- * RETURNS
- *
- *****************************************************************************/
- U8 inline_DOW_select_set_history(U16 history_ID, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (history_buffer != NULL)
- {
- inline_DOW_select_history *h = (inline_DOW_select_history*) history_buffer;
- if (history_valid(h->history_ID, history_ID))
- {
- MMI_inline_DOW_select.flags = h->flags;
- MMI_inline_DOW_select.highlighted_cell = (U8) h->highlight_index;
- return (1);
- }
- }
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * initialize_inline_DOW_select
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * list_of_states [?]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void initialize_inline_DOW_select(S32 x, S32 y, S32 width, S32 height, U8 *list_of_states, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- create_DOW_select(&MMI_inline_DOW_select, x, y, width, height);
- for (i = 0; i < 7; i++)
- {
- MMI_inline_DOW_select.states[i] = list_of_states[i];
- }
- current_wgui_inline_DOW_states = list_of_states;
- inline_DOW_select_set_history(INLINE_DOW_SELECT_HISTORY_ID, history_buffer);
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * inline_DOW_select_pen_handler
- * DESCRIPTION
- *
- * PARAMETERS
- * pen_event [IN]
- * x [IN]
- * y [IN]
- * item_event [?]
- * RETURNS
- *
- *****************************************************************************/
- BOOL inline_DOW_select_pen_handler(
- mmi_pen_event_type_enum pen_event,
- S16 x,
- S16 y,
- gui_inline_item_pen_enum *item_event)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- BOOL ret;
- DOW_pen_event_enum DOW_event;
- gui_pen_event_param_struct DOW_param;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ret = DOW_translate_pen_event(&MMI_inline_DOW_select, pen_event, x, y, &DOW_event, &DOW_param);
- if (ret)
- {
- switch (DOW_event)
- {
- case DOW_PEN_CHANGE_HIGHLIGHT_AND_TOGGLE_I:
- DOW_select_highlight_item(&MMI_inline_DOW_select, DOW_param._u.i);
- /* FALLTHROUGH no break */
- case DOW_PEN_TOGGLE_CURRENT_ITEM:
- DOW_select_toggle_item(&MMI_inline_DOW_select);
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- show_DOW_select_background(&MMI_inline_DOW_select);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- handle_inline_DOW_select_LSK_display();
- set_wgui_inline_list_menu_changed();
- break;
- case DOW_PEN_NONE:
- /* Do nothing */
- break;
- default:
- MMI_ASSERT(0);
- }
- }
- *item_event = GUI_INLINE_ITEM_PEN_NONE;
- return ret;
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * handle_inline_DOW_select
- * DESCRIPTION
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * width [IN]
- * height [IN]
- * key_code [IN]
- * key_event [IN]
- * text_p [IN]
- * item [?]
- * flags [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_DOW_select(
- S32 x,
- S32 y,
- S32 width,
- S32 height,
- S32 key_code,
- S32 key_event,
- U8 **text_p,
- void *item,
- U32 flags,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_DOW_select *i = (wgui_inline_item_DOW_select*) item;
- S32 xx;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(key_event);
- UI_UNUSED_PARAMETER(key_code);
- UI_UNUSED_PARAMETER(flags);
- wgui_current_inline_item_type = INLINE_ITEM_TYPE_DOW_SELECT;
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- clear_inline_item_keys = clear_inline_DOW_select_keys;
- current_wgui_inline_DOW_item = i;
- current_wgui_inline_DOW_text_p = text_p;
- /* PMT VIKAS START 20050817 */
- #ifdef __MMI_UI_DALMATIAN_FIXEDLIST__
- if (line_draw)
- {
- initialize_inline_DOW_select(x + xx, y + 1, width - xx - 1, height - 2, i->list_of_states, history_buffer);
- }
- else
- #endif /* __MMI_UI_DALMATIAN_FIXEDLIST__ */
- //PMT VIKAS END 20050817
- //20051012 HIMANSHU START INLINE DOW
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- initialize_inline_DOW_select(x, y, width, height, i->list_of_states, history_buffer);
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- initialize_inline_DOW_select(x + xx, y, width - xx, height, i->list_of_states, history_buffer);
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- show_DOW_select_background(&MMI_inline_DOW_select);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- register_inline_DOW_select_keys();
- complete_inline_item_edit = inline_DOW_select_change_complete;
- redraw_current_inline_item = redraw_inline_DOW_select;
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_current_inline_item_pen_function = inline_DOW_select_pen_handler;
- #endif
- handle_inline_DOW_select_LSK_display();
- }
- /*****************************************************************************
- * FUNCTION
- * SetInlineItemDOWSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * item_index [IN]
- * list_of_states [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SetInlineItemDOWSelect(InlineItem *item, S32 item_index, U8 *list_of_states)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_DOW_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (n_inline_DOW_items >= MAX_INLINE_DOW_SELECT_ITEMS)
- {
- return;
- }
- item->item = (void*)&wgui_inline_DOW_select_items[n_inline_DOW_items];
- item->flags = INLINE_ITEM_TYPE_DOW_SELECT;
- n_inline_DOW_items++;
- i = (wgui_inline_item_DOW_select*) item->item;
- i->flags = 0;
- i->list_of_states = list_of_states;
- item->handler = handle_inline_DOW_select;
- MMI_fixed_icontext_menuitems[item_index].flags |= UI_MENUITEM_INLINE_EDIT_OBJECT;
- }
- /*****************************************************************************
- * FUNCTION
- * ReConfigureInlineItemDOWSelect
- * DESCRIPTION
- *
- * PARAMETERS
- * item [?]
- * item_index [IN]
- * list_of_states [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ReConfigureInlineItemDOWSelect(InlineItem *item, S32 item_index, U8 *list_of_states)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- wgui_inline_item_DOW_select *i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((item->flags & 0xff) != INLINE_ITEM_TYPE_DOW_SELECT)
- {
- return;
- }
- i = (wgui_inline_item_DOW_select*) item->item;
- i->flags = 0;
- i->list_of_states = list_of_states;
- }
- /* Displaying DOW select as a menu item in the fixed list menu */
- /*****************************************************************************
- * FUNCTION
- * wgui_show_DOW_list_menuitem
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * width [IN]
- * height [IN]
- * item [?]
- * RETURNS
- * void
- *****************************************************************************/
- void wgui_show_DOW_list_menuitem(S32 x1, S32 y1, S32 width, S32 height, wgui_inline_item *item)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 xx;
- wgui_inline_item_DOW_select *i = (wgui_inline_item_DOW_select*) item->item;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_icontext_menuitem.text_x == 2)
- {
- xx = -1;
- }
- else
- {
- xx = MMI_fixed_icontext_menuitem.text_x;
- }
- if (i->flags & INLINE_ITEM_LEFT_ALIGN)
- {
- xx = -1;
- }
- gdi_layer_lock_frame_buffer();
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- initialize_inline_DOW_select(x1, y1, width, height, i->list_of_states, NULL);
- }
- else
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- initialize_inline_DOW_select(x1 + xx, y1, width - xx, height, i->list_of_states, NULL);
- set_inline_DOW_select_list_menu_theme();
- /* 20051012 HIMANSHU START INLINE DOW */
- #ifdef __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__
- if (IsInlineItemDefaultTextEnable())
- {
- inline_item_default_text_show_background((x1 - 1), y1, (x1 - 1) + (width - 1), y1 + height - 1);
- }
- #endif /* __MMI_UI_INLINE_EDIT_DEFAULT_TEXT_EFFECT__ */
- /* 20051012 HIMANSHU END INLINE DOW */
- show_inline_DOW_select();
- redraw_left_softkey();
- redraw_right_softkey();
- gdi_layer_unlock_frame_buffer();
- }
- /*----------------------------------------------------------------------------
- Inline time period edit implementation
- ----------------------------------------------------------------------------*/
- #define MAX_INLINE_TIME_PERIOD_ITEMS 2
- #define MAX_INLINE_TIME_PERIOD_DISPLAY_STRING_SIZE 32
- S32 n_inline_time_period_items = 0;
- wgui_inline_item_time_period wgui_inline_time_period_items[MAX_INLINE_TIME_PERIOD_ITEMS];
- U8 wgui_inline_time_period_display_strings[MAX_INLINE_TIME_PERIOD_ITEMS][MAX_INLINE_TIME_PERIOD_DISPLAY_STRING_SIZE];
- wgui_inline_item_time_period *current_wgui_inline_time_period_item;
- U8 **current_wgui_inline_time_period_text_p;
- U8 wgui_inline_time_period_edit_hours_buffer1[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_period_edit_minutes_buffer1[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_period_edit_hours_buffer2[3 * ENCODING_LENGTH];
- U8 wgui_inline_time_period_edit_minutes_buffer2[3 * ENCODING_LENGTH];
- U8 *wgui_inline_time_period_AM_PM_flag1;
- U8 *wgui_inline_time_period_AM_PM_flag2;
- time_period_input wgui_inline_time_period_input;
- /*****************************************************************************
- * FUNCTION
- * handle_inline_time_period_edit_complete
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_inline_time_period_edit_complete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_inline_fixed_list_keys();
- gui_strcpy(
- (UI_string_type) current_wgui_inline_time_period_item->hours_buffer1,
- (UI_string_type) wgui_inline_time_period_edit_hours_buffer1);
- gui_strcpy(
- (UI_string_type) current_wgui_inline_time_period_item->minutes_buffer1,
- (UI_string_type) wgui_inline_time_period_edit_minutes_buffer1);
- gui_strcpy(
- (UI_string_type) current_wgui_inline_time_period_item->hours_buffer2,
- (UI_string_type) wgui_inline_time_period_edit_hours_buffer2);
- gui_strcpy(
- (UI_string_type) current_wgui_inline_time_period_item->minutes_buffer2,
- (UI_string_type) wgui_inline_time_period_edit_minutes_buffer2);
- current_wgui_inline_time_period_item->AM_PM_flag1 = wgui_inline_time_period_AM_PM_flag1;
- current_wgui_inline_time_period_item->AM_PM_flag2 = wgui_inline_time_period_AM_PM_flag2;
- current_wgui_inline_time_period_item->string_construct_callback(
- *current_wgui_inline_time_period_text_p,
- current_wgui_inline_time_period_item->hours_buffer1,
- current_wgui_inline_time_period_item-> minutes_buffer1,
- current_wgui_inline_time_period_item->AM_PM_flag1,
- current_wgui_inline_time_period_item->hours_buffer2,
- current_wgui_inline_time_period_item-> minutes_buffer2,
- current_wgui_inline_time_period_item->AM_PM_flag2);
- MMI_fixed_icontext_menuitems[wgui_inline_item_highlighted_index].item_text =
- (UI_string_type) * current_wgui_inline_time_period_text_p;
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- #if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
- mmi_pen_editor_close_input_box();
- #endif
- wgui_inline_item_handled = 0;
- wgui_text_menuitem_restart_scrolling();
- inline_edit_current_highlight_handler(wgui_inline_item_highlighted_index);
- redraw_current_inline_item = UI_dummy_function;
- complete_inline_item_edit = UI_dummy_function;
- set_current_time_period_input(NULL);