wgui_categories_demo.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:348k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * wgui_categories_demo.c
- *
- * Project:
- * --------
- * Maui_Software
- *
- * Description:
- * ------------
- * Temporarily unused categories.
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory3Screen
- * DESCRIPTION
- * Redraws the category3 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory3Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- clear_buttonbar();
- draw_title();
- show_fixed_list();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory3Screen
- * DESCRIPTION
- * Redraws the category3 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * number_of_items [IN] Number of items
- * list_of_items [IN] List of text items (Each row has one
- * list_of_icons1 [IN] Icon list (there are 5 icon columns)
- * list_of_icons2 [IN] List for second column of icons
- * list_of_icons3 [IN] List for third column of icons
- * list_of_icons4 [IN] List for fourth column of icons
- * list_of_icons5 [IN] List for fifth column of icons
- * highlighted_item [IN] Item to be highlighted by default (if there is no history)
- * history_buffer [IN] History buffer
- * text(?) [IN] Column) Note: This is an array of
- * strings(?) [IN] And not string IDs.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory3Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items,
- U16 *list_of_icons1,
- U16 *list_of_icons2,
- U16 *list_of_icons3,
- U16 *list_of_icons4,
- U16 *list_of_icons5,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, shortcut_width, text_width;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ADD_SCREEN_STRINGS((3, title, left_softkey, right_softkey));
- ADD_SCREEN_IMAGES((3, title_icon, left_softkey_icon, right_softkey_icon));
- APPEND_SCREEN_IMAGE_LIST(number_of_items, (U16*) list_of_icons1);
- APPEND_SCREEN_IMAGE_LIST(number_of_items, (U16*) list_of_icons2);
- APPEND_SCREEN_IMAGE_LIST(number_of_items, (U16*) list_of_icons3);
- APPEND_SCREEN_IMAGE_LIST(number_of_items, (U16*) list_of_icons4);
- APPEND_SCREEN_IMAGE_LIST(number_of_items, (U16*) list_of_icons5);
- /* ADD_SCREEN_MENUS((1,1000)); */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- /* MTK Leo added, to hide icon on BW_MMI */
- #ifdef __BW_MMI__
- create_fixed_icontext_list_menuitems(1, 0);
- text_width = (UI_device_width - MMI_fixed_list_menu.vbar.width);
- set_fixed_icontext_list_text_coordinates(0, 2, 0, text_width, MMI_MENUITEM_HEIGHT);
- associate_fixed_icontext_list_list();
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- add_fixed_icontext_list_item_text(i, 0, (UI_string_type) list_of_items[i]);
- }
- #else /* __BW_MMI__ */
- create_fixed_icontext_list_menuitems(1, 5);
- text_width = (UI_device_width - MMI_fixed_list_menu.vbar.width - 57);
- set_fixed_icontext_list_text_coordinates(0, 2, 0, text_width, 18);
- set_fixed_icontext_list_icon_coordinates(0, text_width + 0, 0, 9, 18);
- set_fixed_icontext_list_icon_coordinates(1, text_width + 10, 0, 9, 18);
- set_fixed_icontext_list_icon_coordinates(2, text_width + 20, 0, 9, 18);
- set_fixed_icontext_list_icon_coordinates(3, text_width + 30, 0, 9, 18);
- set_fixed_icontext_list_icon_coordinates(4, text_width + 40, 0, 9, 18);
- associate_fixed_icontext_list_list();
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- add_fixed_icontext_list_item_text(i, 0, (UI_string_type) list_of_items[i]);
- add_fixed_icontext_list_item_icon(i, 0, get_image(list_of_icons1[i]));
- add_fixed_icontext_list_item_icon(i, 1, get_image(list_of_icons2[i]));
- add_fixed_icontext_list_item_icon(i, 2, get_image(list_of_icons3[i]));
- add_fixed_icontext_list_item_icon(i, 3, get_image(list_of_icons4[i]));
- add_fixed_icontext_list_item_icon(i, 4, get_image(list_of_icons5[i]));
- }
- #endif /* __BW_MMI__ */
- MMI_current_menu_type = LIST_MENU;
- register_fixed_list_shortcut_handler();
- register_fixed_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, 0);
- register_hide_menu_shortcut(draw_title);
- move_fixed_list(0, MMI_title_height);
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- resize_fixed_list_to_content_height();
- register_fixed_list_highlight_handler(standard_list_highlight_handler);
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- /* MTK Leo added, to set text align on BW_MMI */
- #ifdef __BW_MMI__
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_LEFT_JUSTIFY;
- #else
- MMI_fixed_icontext_list_menuitem.flags |= UI_MENUITEM_RIGHT_JUSTIFY;
- #endif
- /* MTK Leo end */
- h_flag = set_list_menu_category_history(MMI_CATEGORY3_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- resize_fixed_icontext_list_menuitems_to_list_width();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory3Screen;
- RedrawCategoryFunction = RedrawCategory3Screen;
- GetCategoryHistory = GetCategory3History;
- GetCategoryHistorySize = GetCategory3HistorySize;
- RedrawCategory3Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory3Screen
- * DESCRIPTION
- * Exits the category3 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory3Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory3HistorySize
- * DESCRIPTION
- * Gets the size of the history buffer for the category3 screen
- * PARAMETERS
- * void
- * RETURNS
- * size of history buffer in U8s
- *****************************************************************************/
- S32 GetCategory3HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(list_menu_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory3History
- * DESCRIPTION
- * Gets the history buffer for the category3 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory3History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history(MMI_CATEGORY3_ID, history_buffer);
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory4Screen
- * DESCRIPTION
- * Redraws the category4 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory4Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c;
- stFontAttribute f = UI_DEFAULT_FONT;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_screen();
- draw_title();
- gui_set_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
- gui_set_text_clip(0, 0, UI_device_width - 1, UI_device_height - 1);
- c.r = 0;
- c.g = 0;
- c.b = 0;
- c.alpha = 100;
- gui_set_font(&f);
- gui_set_text_color(c);
- show_fixed_list();
- show_softkey_background();
- /* CODE ADDED VANDANA MEHTANI 13 JUNE */
- show_left_softkey();
- /* CODE ENDED VANDANA MEHTANI */
- show_right_softkey();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * Cat4_fixed_list_previous
- * DESCRIPTION
- * move to previous menu item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Cat4_fixed_list_previous(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.highlighted_item > MMI_fixed_list_menu.first_displayed_item)
- {
- MMI_fixed_list_menu.highlighted_item = MMI_fixed_list_menu.first_displayed_item;
- }
- fixed_list_goto_previous_item();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat4_fixed_list_next
- * DESCRIPTION
- * move to next menu item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Cat4_fixed_list_next(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (MMI_fixed_list_menu.highlighted_item < MMI_fixed_list_menu.last_displayed_item)
- {
- MMI_fixed_list_menu.highlighted_item = MMI_fixed_list_menu.last_displayed_item;
- }
- fixed_list_goto_next_item();
- }
- /*****************************************************************************
- * FUNCTION
- * Cat4_fixed_list_key_handler
- * DESCRIPTION
- * handle up and down key of fixed menu list
- * PARAMETERS
- * vkey_code [IN] Key code
- * key_state [IN] Key state
- * RETURNS
- * void
- *****************************************************************************/
- void Cat4_fixed_list_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 38:
- Cat4_fixed_list_previous();
- break;
- case 40:
- Cat4_fixed_list_next();
- 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_Cat4_fixed_list_keys
- * DESCRIPTION
- * set key handlers of fixed menu list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_Cat4_fixed_list_keys(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- register_keyboard_key_handler(Cat4_fixed_list_key_handler);
- SetKeyHandler(Cat4_fixed_list_previous, KEY_UP_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(Cat4_fixed_list_next, KEY_DOWN_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(Cat4_fixed_list_previous, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(Cat4_fixed_list_next, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * Cat4_hide_fixed_list
- * DESCRIPTION
- * hide fixed list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void Cat4_hide_fixed_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = gui_color(255, 255, 255);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_reset_clip();
- gui_fill_rectangle(
- MMI_fixed_list_menu.x,
- MMI_fixed_list_menu.y,
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width - 1,
- MMI_fixed_list_menu.y + MMI_fixed_list_menu.height - 1,
- c);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory4Screen
- * DESCRIPTION
- * Displays the category4 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * number_of_items [IN] Number of items
- * list_of_items [IN]
- * list_of_icons [IN] List of icon items (Each row has one icon item)
- * history_buffer [IN] History buffer
- * STRING(?) [IN] * list_of_text_items, List of text items (Each row has one text item).
- * Note(?) [IN] These are strings and not string IDs.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory4Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items,
- U16 *list_of_icons,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ADD_SCREEN_STRINGS((2, title, right_softkey));
- ADD_SCREEN_IMAGES((2, title_icon, right_softkey_icon));
- APPEND_SCREEN_IMAGE_LIST(number_of_items, (U16*) list_of_icons);
- UI_UNUSED_PARAMETER(history_buffer);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- /* CODE ADDED VANDANA MEHTANI 13 JUNE */
- change_left_softkey(left_softkey, left_softkey_icon);
- /* CODE ENDED VANDANA MEHTANI */
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- /* CODE ADDED VANDANA MEHTANI 13 JUNE */
- register_left_softkey_handler();
- /* CODE ENDED VANDANA MEHTANI */
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- create_fixed_icontext_menuitems();
- resize_fixed_list(MMI_content_width, MMI_content_height + 6);
- associate_fixed_icontext_list();
- for (i = 0; i < number_of_items; i++)
- {
- /* MTK Leo added, not display icon on BW_MMI */
- #ifdef __BW_MMI__
- add_fixed_icontext_item((UI_string_type) list_of_items[i], get_image(0));
- #else
- add_fixed_icontext_item((UI_string_type) list_of_items[i], get_image(list_of_icons[i]));
- #endif
- /* MTK Leo end */
- }
- MMI_disable_title_shortcut_display = 1;
- MMI_current_menu_type = LIST_MENU;
- /* fixed_list_disable_looping(); */
- /* code added vandana m */
- /* register_Cat4_fixed_list_keys(); */
- register_fixed_list_keys();
- /* code ended vandanam */
- move_fixed_list(0, MMI_title_height);
- resize_fixed_list(MMI_content_width, MMI_content_height + 6);
- gui_move_vertical_scrollbar(&MMI_fixed_list_menu.vbar, MMI_fixed_list_menu.vbar.x - 3, MMI_fixed_list_menu.vbar.y);
- register_fixed_list_highlight_handler(standard_list_highlight_handler);
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_BACKGROUND;
- register_hide_fixed_list(Cat4_hide_fixed_list);
- /* MMI_fixed_icontext_menuitem.flags|=UI_MENUITEM_DISABLE_HIGHLIGHT; */
- set_list_menu_category_history(MMI_CATEGORY6_ID, history_buffer);
- set_fixed_icontext_positions(18, 0, 1, 0);
- resize_fixed_list_to_content_height();
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- resize_fixed_icontext_menuitems_to_list_width();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory4Screen;
- RedrawCategoryFunction = RedrawCategory4Screen;
- GetCategoryHistory = GetCategory4History;
- GetCategoryHistorySize = GetCategory4HistorySize;
- RedrawCategory4Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory4Screen
- * DESCRIPTION
- * Exits the category4 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory4Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- reset_fixed_list();
- /* fixed_list_enable_looping(); */
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory4HistorySize
- * DESCRIPTION
- * Gets the size of the history buffer for category4 screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory4HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory4History
- * DESCRIPTION
- * Gets the history buffer for category4 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer where the history data is to be stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory4History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory10Value
- * DESCRIPTION
- * Redraws the category10 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #define MAX_CATEGORY_10_VALUE_STRINGS 10
- UI_string_type MMI_singleline_display_strings[MAX_CATEGORY_10_VALUE_STRINGS];
- S32 Cat10ValueIndex = 0;
- void RedrawCategory10Value(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- stFontAttribute f = UI_DEFAULT_FONT;
- color c = gui_color(255, 255, 255);
- S32 w, y = MMI_fixed_list_menu.y + MMI_fixed_list_menu.height + 16;
- UI_string_type s;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((Cat10ValueIndex < 0) || (Cat10ValueIndex > MMI_fixed_list_menu.n_items - 1))
- {
- Cat10ValueIndex = 0;
- }
- s = MMI_singleline_display_strings[Cat10ValueIndex];
- gui_reset_text_clip();
- w = gui_get_string_width(s);
- gui_set_clip(2, y, UI_device_width - 2, y + 20);
- gui_draw_filled_area(
- 0,
- MMI_title_height,
- UI_device_width - 1,
- MMI_title_height + MMI_content_height - 1,
- MMI_fixed_list_menu.normal_filler);
- /* MTK Elvis for R2L characters */
- if (r2lMMIFlag)
- {
- gui_move_text_cursor((UI_device_width >> 1) - (w >> 1) + w, y);
- }
- else
- {
- gui_move_text_cursor((UI_device_width >> 1) - (w >> 1), y);
- }
- /* MTk end */
- gui_set_font(&f);
- c = gui_color(0, 0, 0);
- gui_set_text_color(c);
- gui_print_text(s);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_BLT_double_buffer(0, y, UI_device_width - 1, y + 20);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory10Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory10Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- clear_screen();
- draw_title();
- gui_reset_clip();
- gui_draw_filled_area(
- 0,
- MMI_title_height,
- UI_device_width - 1,
- MMI_title_height + MMI_content_height - 1,
- MMI_fixed_list_menu.normal_filler);
- gui_show_image(
- MMI_fixed_list_menu.x + MMI_fixed_list_menu.width - 1,
- MMI_fixed_list_menu.y,
- get_image(THEME_0_SCROLL_UP_DOWN_IMAGE_ID));
- show_fixed_list();
- RedrawCategory10Value();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * Cat10_list_highlight_handler
- * DESCRIPTION
- * System Highlight handler
- * PARAMETERS
- * item_index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Cat10_list_highlight_handler(S32 item_index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_menu_shortcut_number = item_index + 1;
- Cat10ValueIndex = item_index;
- MMI_highlighted_item_text = get_item_text(item_index);
- if (!menu_shortcut_handler_display)
- {
- gui_redraw_menu_shortcut();
- }
- RedrawCategory10Value();
- MMI_list_highlight_handler(item_index);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory10Screen
- * DESCRIPTION
- * Displays the category10 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * number_of_items [IN] Number of items
- * list_of_items [IN] List of text items values
- * list_of_strings [IN]
- * highlighted_item [IN]
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory10Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- U16 *list_of_items,
- U8 **list_of_strings,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, j, shortcut_width;
- U8 h_flag;
- S32 item_height = 18;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ADD_SCREEN_STRINGS((3, title, left_softkey, right_softkey));
- APPEND_SCREEN_STRING_LIST(number_of_items, (U16*) list_of_items);
- ADD_SCREEN_IMAGES((3, title_icon, left_softkey_icon, right_softkey_icon));
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- clear_category_screen_key_handlers();
- resize_fixed_list(MMI_content_width - 12, item_height + 8);
- MMI_fixed_list_menu.flags |= UI_LIST_MENU_DISABLE_SCROLLBAR;
- create_fixed_text_menuitems();
- associate_fixed_text_list();
- for (i = 0; i < number_of_items; i++)
- {
- MMI_singleline_display_strings[i] = (UI_string_type) list_of_strings[i];
- add_fixed_text_item(get_string(list_of_items[i]));
- }
- j = gui_strlen(MMI_singleline_display_strings[0]) + 1;
- MMI_current_menu_type = LIST_MENU;
- register_fixed_list_shortcut_handler();
- register_fixed_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, 0);
- register_hide_menu_shortcut(draw_title);
- move_fixed_list(0, MMI_title_height + 20);
- resize_fixed_text_menuitems(0, item_height);
- gui_resize_fixed_list_menu(&MMI_fixed_list_menu, MMI_content_width - 12, MMI_DROPDOWN_MENUITEM_HEIGHT + 4);
- register_fixed_list_highlight_handler(Cat10_list_highlight_handler);
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- h_flag = set_list_menu_category_history(MMI_CATEGORY10_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory10Screen;
- RedrawCategoryFunction = RedrawCategory10Screen;
- GetCategoryHistory = GetCategory10History;
- GetCategoryHistorySize = GetCategory10HistorySize;
- RedrawCategory10Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory10Screen
- * DESCRIPTION
- * Exits the category10 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory10Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory10HistorySize
- * DESCRIPTION
- * Gets the history buffer size for category10 screen
- * PARAMETERS
- * void
- * RETURNS
- * size in U8s of the history buffer
- *****************************************************************************/
- S32 GetCategory10HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(list_menu_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory10History
- * DESCRIPTION
- * Gets the history buffer for category10 screen
- * PARAMETERS
- * history_buffer [IN] Is a pointer to the buffer where the history data
- * is(?) [IN] To be stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory10History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history(MMI_CATEGORY10_ID, history_buffer);
- return (history_buffer);
- }
- #if defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__)
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory17Screen
- * DESCRIPTION
- * Redraws the MO_call screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory17Screen()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- UI_filled_area *bg_filler;
- S32 image_width;
- S32 image_height;
- S32 image_offset_x;
- S32 image_offset_y;
- S32 string_width;
- S32 string_height;
- S32 string_offset_x;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- UI_set_main_LCD_graphics_context();
- gui_hide_animations();
- /* fill with theme background color */
- bg_filler = current_MMI_theme->CM_screen_background_filler;
- gui_reset_clip();
- gui_draw_filled_area(0, 0, UI_device_width - 1, UI_device_height - 1, bg_filler);
- show_status_icons();
- #ifndef __MMI_CM_SCREEN_HIDE_DATE_TIME__
- if (wgui_image_clip_y1 == main_LCD_dt_object.time.y + main_LCD_dt_object.time.height + 2)
- {
- CM_screens_draw_date_time_bar();
- show_main_LCD_dt_display();
- }
- #endif /* __MMI_CM_SCREEN_HIDE_DATE_TIME__ */
- if (Painty1 == 1) /* from id */
- {
- gui_set_clip(wgui_image_clip_x1, wgui_image_clip_y1, wgui_image_clip_x2, wgui_image_clip_y2);
- /* TODO, may apply to Justin's GDI resizer */
- /* currently align at center of clip region */
- gdi_image_get_dimension(_MMI_animated_icon, &image_width, &image_height);
- image_offset_x = (wgui_image_clip_x2 - wgui_image_clip_x1 - image_width) >> 1;
- image_offset_x += wgui_image_clip_x1;
- image_offset_y = (wgui_image_clip_y2 - wgui_image_clip_y1 - image_height) >> 1;
- image_offset_y += wgui_image_clip_y1 - 6;
- gdi_image_draw_animation(image_offset_x, image_offset_y, _MMI_animated_icon, NULL);
- }
- else if (Painty1 == 2) /* from file */
- {
- gui_set_clip(wgui_image_clip_x1, wgui_image_clip_y1, wgui_image_clip_x2, wgui_image_clip_y2);
- gdi_image_get_dimension_file((PS8) _MMI_animated_icon_name, &image_width, &image_height);
- image_offset_x = (wgui_image_clip_x2 - wgui_image_clip_x1 - image_width) >> 1;
- image_offset_x += wgui_image_clip_x1;
- image_offset_y = (wgui_image_clip_y2 - wgui_image_clip_y1 - image_height) >> 1;
- image_offset_y += wgui_image_clip_y1;
- gdi_image_draw_file(image_offset_x, image_offset_y, (PS8) _MMI_animated_icon_name);
- }
- /* wgui_show_transparent_animation(); */
- if (MMI_message_string)
- {
- gui_set_font(current_MMI_theme->title_text_font);
- gui_measure_string(MMI_message_string, &string_width, &string_height);
- if (string_width < UI_device_width)
- {
- string_offset_x = (UI_device_width >> 1) - (string_width >> 1);
- }
- gui_set_text_clip(string_offset_x, CM_y, (UI_device_width - 1), (CM_y + string_height));
- gui_move_text_cursor(string_offset_x, CM_y);
- gui_show_scrolling_text(&CM_scrolling_text);
- }
- show_multiline_inputbox(); /* "Calling..." String */
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory17Screen
- * DESCRIPTION
- * Displays the MO_calling screen
- * PARAMETERS
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * NotificationStringId [IN]
- * NameOrNumber [?]
- * imageId [IN]
- * image_file_pp [IN]
- * history_buffer [IN] History buffer
- * STRING(?) [IN] * Name or Number text, Name or Number text
- * MMI_ID_TYPE(?) [IN] Image to be displayed Picture tag associated eith the name
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory17Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 NotificationStringId,
- U8 *NameOrNumber,
- U16 imageId,
- S8 **image_file_pp,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 y, iwidth, iheight, fh, ty2, h;
- S32 text_width;
- S32 text_height;
- S32 text_offset_x;
- S32 text_offset_y;
- S32 image_offset_x, image_offset_y;
- S32 image_spacing;
- S32 text_spaing;
- S32 str_len;
- UI_string_type str;
- PU8 image_ptr;
- S32 string_width, string_height;
- S32 image_width, image_height;
- S32 sw, sh;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* spacing pixel from boundry */
- image_spacing = 2;
- text_spaing = 2;
- UI_UNUSED_PARAMETER(history_buffer);
- ADD_SCREEN_STRINGS((3, title_id, left_softkey, right_softkey));
- ADD_SCREEN_IMAGES((3, left_softkey_icon, right_softkey_icon, imageId));
- /* lock double buffer */
- gui_lock_double_buffer();
- clear_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_disable_title_shortcut_display = 1;
- set_main_LCD_dt_date_hide_function(CM_screens_hide_date_time_display);
- set_main_LCD_dt_time_hide_function(CM_screens_hide_date_time_display);
- set_dt_display(DT_MT_CALL_SCREEN);
- MMI_title_icon = NULL;
- /* draw title */
- ShowStatusIconsTitle();
- /****************************************************************************
- * String above message string. (Calling...)
- *****************************************************************************/
- str = get_string(NotificationStringId);
- /* gui_measure_image(img,&iwidth,&iheight); */
- create_multiline_inputbox_set_buffer(str, gui_strlen((UI_string_type) str), gui_strlen((UI_string_type) str), 0);
- MMI_multiline_inputbox.flags |=
- UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY;
- MMI_multiline_inputbox.text_font = &MMI_medium_font;
- show_multiline_inputbox_no_draw();
- fh = get_multiline_inputbox_line_height();
- resize_multiline_inputbox(UI_device_width, fh + MULTILINE_INPUTBOX_HEIGHT_PAD);
- y = UI_device_height - MMI_button_bar_height - (fh * 2 + MULTILINE_INPUTBOX_HEIGHT_PAD);
- move_multiline_inputbox(0, y);
- /****************************************************************************
- * Message String
- *****************************************************************************/
- if (NameOrNumber)
- {
- MMI_message_string = (UI_string_type) NameOrNumber;
- }
- else
- {
- MMI_message_string = NULL;
- }
- gui_set_font(&MMI_default_font);
- gui_measure_string(MMI_message_string, &string_width, &string_height);
- text_offset_x = (UI_device_width >> 1) - (string_width >> 1);
- if (text_offset_x < 1)
- {
- text_offset_x = 1;
- }
- text_offset_y = UI_device_height - MMI_button_bar_height - string_height - text_spaing;
- text_width = string_width;
- if (text_width > (UI_device_width - text_spaing * 2))
- {
- text_width = UI_device_width - text_spaing * 2;
- }
- text_height = string_height;
- gui_create_scrolling_text(
- &CM_scrolling_text,
- text_offset_x,
- text_offset_y,
- text_width,
- text_height,
- MMI_message_string,
- CM_scrolling_text_timer_callback,
- CM_draw_scrolling_text_background,
- gui_color(0, 0, 0),
- gui_color(255, 255, 255));
- CM_scrolling_text.flags &= ~UI_SCROLLING_TEXT_BORDERED_TEXT;
- CM_y = text_offset_y;
- /****************************************************************************
- * Image Icon
- *****************************************************************************/
- /* prepare image */
- /*
- * use Painty1 flag to indicate image from file or image form id
- * Panity = 0 -> Nothing
- * Painty = 1 -> From id
- * Painty = 2 -> From file
- */
- Painty1 = 0;
- image_ptr = get_image(imageId);
- gui_measure_image(image_ptr, &image_width, &image_height);
- image_offset_y = MMI_status_bar_height +
- main_LCD_dt_object.date.height + main_LCD_dt_object.time.height + image_spacing;
- image_offset_x = (UI_device_width >> 1) - (image_width >> 1);
- wgui_image_clip_x1 = image_spacing;
- wgui_image_clip_x2 = UI_device_width - 1 - image_spacing;
- wgui_image_clip_y1 = main_LCD_dt_object.time.y + main_LCD_dt_object.time.height + image_spacing;
- wgui_image_clip_y2 = text_offset_y - image_spacing;
- /* it is an error if try to display string from both source */
- MMI_ASSERT((imageId == 0) || (image_file_pp == NULL));
- if (imageId != 0)
- {
- Painty1 = 1;
- _MMI_animated_icon = image_ptr;
- }
- if (image_file_pp != NULL)
- {
- Painty1 = 2;
- /* store file name */
- _MMI_animated_icon_name = (PU8) * image_file_pp;
- }
- gui_unlock_double_buffer();
- RedrawCategoryFunction = RedrawCategory17Screen;
- ExitCategoryFunction = ExitCategory17Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategory17Screen();
- }
- #else /* defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__) */
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory17Screen
- * DESCRIPTION
- * redraw category 17 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory17Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color bc;
- S32 width = 0, x = 0;
- #if(0) /* Now reads color from the theme structure */
- //micha1021 Chicago Feature 6
- #ifdef __MMI_DEFAULT_THEME_3__
- color c={206,206,206,100};
- #endif
- #else /* (0) */
- UI_filled_area *f = current_MMI_theme->CM_screen_background_filler;
- #endif /* (0) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- gui_hide_animations();
- #if(0) /* Now reads color from the theme structure */
- //micha1021 Chicago Feature 6
- #ifdef __MMI_DEFAULT_THEME_3__
- pixtel_UI_reset_clip();
- pixtel_UI_fill_rectangle(0,0,UI_device_width-1,UI_device_height-1,c);
- #else
- clear_screen();
- #endif
- #else /* (0) */
- gui_reset_clip();
- gui_draw_filled_area(0, 0, UI_device_width - 1, UI_device_height - 1, f);
- #endif /* (0) */
- /* MTK Leo add */
- #ifndef __BW_MMI__
- show_status_icons();
- #endif
- /* MTK Leo end */
- UI_set_main_LCD_graphics_context();
- gui_set_clip(wgui_image_clip_x1, wgui_image_clip_y1, wgui_image_clip_x2, wgui_image_clip_y2);
- wgui_show_transparent_animation();
- /* MTK Leo add 1225 */
- if (wgui_image_clip_y1 == main_LCD_dt_object.time.y + main_LCD_dt_object.time.height + 1)
- { /* ref:Showcategory17Screen */
- CM_screens_draw_date_time_bar();
- #ifndef __MMI_CM_SCREEN_HIDE_DATE_TIME__
- show_main_LCD_dt_display();
- show_multiline_inputbox();
- #endif /* __MMI_CM_SCREEN_HIDE_DATE_TIME__ */
- }
- /* MTK Leo end 1225 */
- bc = gui_color(0, 0, 0);
- gui_set_text_color(bc);
- gui_set_font(current_MMI_theme->title_text_font);
- gui_measure_string(MMI_message_string, &width, &CM_text_height);
- if (width < UI_device_width)
- {
- x = (UI_device_width >> 1) - (width >> 1);
- }
- else
- {
- #if(0)
- CM_text_width=width;
- x=CM_text_offset_x=CM_TEXT_SCROLL_X;
- pixtel_UI_start_timer(CATEGORY17_TEXT_SCROLL_WAIT,handle_category17_text_scroll);
- #endif /* (0) */
- }
- /* gui_pop_clip(); */
- gui_set_text_clip(x, CM_y, (UI_device_width - 1), (CM_y + CM_text_height));
- gui_move_text_cursor(x, CM_y);
- #if(0)
- pixtel_UI_print_text(MMI_message_string);
- #else /* (0) */
- gui_show_scrolling_text(&CM_scrolling_text);
- #endif /* (0) */
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory17Screen
- * DESCRIPTION
- * Displays the MO_calling screen
- * PARAMETERS
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * NotificationStringId [IN]
- * NameOrNumber [?]
- * imageId [IN]
- * history_buffer [IN] History buffer
- * STRING(?) [IN] * Name or Number text, Name or Number text
- * MMI_ID_TYPE(?) [IN] Image to be displayed Picture tag associated eith the name
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory17Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 NotificationStringId,
- U8 *NameOrNumber,
- U16 imageId,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 fh, y, iwidth, iheight;
- PU8 img = get_image(imageId);
- UI_string_type str;
- S32 sw, sh;
- S32 tx, ty, tw, th;
- UI_font_type f = MMI_multiline_inputbox.text_font;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ADD_SCREEN_STRINGS((2, left_softkey, right_softkey));
- ADD_SCREEN_IMAGES((2, left_softkey_icon, right_softkey_icon));
- UI_UNUSED_PARAMETER(history_buffer);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- clear_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- ShowStatusIconsTitle();
- set_main_LCD_dt_date_hide_function(CM_screens_hide_date_time_display);
- set_main_LCD_dt_time_hide_function(CM_screens_hide_date_time_display);
- set_dt_display(DT_MO_CALLING_SCREEN);
- show_main_LCD_dt_display();
- str = get_string(NotificationStringId);
- gui_measure_image(img, &iwidth, &iheight);
- create_multiline_inputbox_set_buffer(str, gui_strlen((UI_string_type) str), gui_strlen((UI_string_type) str), 0);
- MMI_multiline_inputbox.flags |=
- UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR | UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY;
- MMI_message_string = (UI_string_type) NameOrNumber;
- MMI_multiline_inputbox.text_font = &MMI_medium_font;
- show_multiline_inputbox_no_draw();
- fh = get_multiline_inputbox_line_height();
- resize_multiline_inputbox(UI_device_width, fh + MULTILINE_INPUTBOX_HEIGHT_PAD);
- y = UI_device_height - MMI_button_bar_height - (fh * 2 + MULTILINE_INPUTBOX_HEIGHT_PAD);
- move_multiline_inputbox(0, y);
- wgui_image_clip_x1 = 0;
- wgui_image_clip_x2 = UI_device_width - 1;
- wgui_image_clip_y1 = MMI_status_bar_height + main_LCD_dt_object.date.height + main_LCD_dt_object.time.height + 1;
- wgui_image_clip_y2 = MMI_multiline_inputbox.y - 1;
- /* MTK Leo add 1225 */
- if (wgui_image_clip_y2 - wgui_image_clip_y1 < iheight)
- { /* There is no enough space to show calling image... */
- wgui_image_clip_y1 = MMI_status_bar_height + 2;
- y = UI_device_height - MMI_button_bar_height - (fh + MULTILINE_INPUTBOX_HEIGHT_PAD);
- move_multiline_inputbox(0, y);
- wgui_image_clip_y2 = MMI_multiline_inputbox.y - 1;
- }
- else
- {
- set_dt_display(DT_MO_CALLING_SCREEN);
- }
- /* MTK Leo end 1225 */
- y = wgui_image_clip_y1 + ((wgui_image_clip_y2 - wgui_image_clip_y1 - iheight) >> 1);
- if (y > MMI_multiline_inputbox.y)
- {
- y = MMI_multiline_inputbox.y - iheight;
- }
- wgui_set_animation_image_y((UI_device_width >> 1), y, img);
- CM_y = UI_device_height - MMI_button_bar_height - fh - 2; /* (MMI_multiline_inputbox.y + MMI_multiline_inputbox.height + 1); */
- gui_set_font(&MMI_default_font);
- gui_measure_string(MMI_message_string, &sw, &sh);
- tx = (UI_device_width >> 1) - (sw >> 1);
- if (tx < 1)
- {
- tx = 1;
- }
- ty = CM_y;
- tw = sw;
- if (tw > (UI_device_width - 2))
- {
- tw = UI_device_width - 2;
- }
- th = sh;
- gui_create_scrolling_text(
- &CM_scrolling_text,
- tx,
- ty,
- tw,
- th,
- MMI_message_string,
- CM_scrolling_text_timer_callback,
- CM_draw_scrolling_text_background,
- gui_color(0, 0, 0),
- gui_color(255, 255, 255));
- CM_scrolling_text.flags &= ~UI_SCROLLING_TEXT_BORDERED_TEXT;
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- RedrawCategoryFunction = RedrawCategory17Screen;
- ExitCategoryFunction = ExitCategory17Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategory17Screen();
- MMI_multiline_inputbox.text_font = f;
- }
- #endif /* defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__) */
- /*****************************************************************************
- * FUNCTION
- * ExitCategory17Screen
- * DESCRIPTION
- * Exits the MO_calling screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory17Screen()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- UI_set_main_LCD_graphics_context();
- gui_cancel_timer(CM_scrolling_text_timer_callback);
- gui_cancel_timer(handle_category17_text_scroll);
- close_main_LCD_dt_display();
- gui_hide_animations();
- close_status_icons();
- reset_softkeys();
- reset_multitaps();
- reset_multiline_inputbox();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory23Screen
- * DESCRIPTION
- * Redraws the SMS inbox category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory23Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- clear_buttonbar();
- show_title_status_icon();
- draw_title();
- show_fixed_list();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory23Screen
- * DESCRIPTION
- * Redraws the SMS inbox category screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * number_of_items [IN] Number of items
- * list_of_items1 [IN] List of text items (Each row has two
- * list_of_items2 [IN] (Array of strings and not string IDs)
- * list_of_icons1 [IN] Icon list
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * text(?) [IN] Columns) Note: This is an array of
- * strings(?) [IN] And not string IDs.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory23Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items1,
- U8 **list_of_items2,
- U16 *list_of_icons1,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, shortcut_width, text_width, icon_position, text_position1;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- /* MTK Leo added, to remove icons on menuitems */
- #ifdef __BW_MMI__
- create_fixed_icontext_list_menuitems(2, 0);
- text_width = UI_device_width - MMI_fixed_list_menu.vbar.width;
- #else /* __BW_MMI__ */
- create_fixed_icontext_list_menuitems(2, 1);
- text_width = UI_device_width - 64 - MMI_fixed_list_menu.vbar.width;
- #endif /* __BW_MMI__ */
- /* MTK Leo end */
- text_position1 = 20 + text_width;
- icon_position = 1;
- /* MTK Leo added, to remove icons on menuitems */
- #ifdef __BW_MMI__
- set_fixed_icontext_list_text_coordinates(0, 0, 0, 10, 18);
- set_fixed_icontext_list_text_coordinates(1, 12, 0, 12 + text_width, 18);
- #else /* __BW_MMI__ */
- set_fixed_icontext_list_text_coordinates(0, 18, 0, text_width, 18);
- set_fixed_icontext_list_text_coordinates(1, text_position1, 0, 36, 18);
- set_fixed_icontext_list_icon_coordinates(0, icon_position, 0, 16, 18);
- #endif /* __BW_MMI__ */
- /* MTK Leo end */
- associate_fixed_icontext_list_list();
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- add_fixed_icontext_list_item_text(i, 0, (UI_string_type) list_of_items1[i]);
- add_fixed_icontext_list_item_text(i, 1, (UI_string_type) list_of_items2[i]);
- add_fixed_icontext_list_item_icon(i, 0, wgui_get_list_menu_icon(i, list_of_icons1[i]));
- }
- MMI_current_menu_type = LIST_MENU;
- register_fixed_list_shortcut_handler();
- register_fixed_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(gui_redraw_menu_shortcut);
- move_fixed_list(0, (MMI_title_y + MMI_title_height));
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- resize_fixed_list_to_content_height();
- register_fixed_list_highlight_handler(standard_list_highlight_handler);
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- h_flag = set_list_menu_category_history(MMI_CATEGORY23_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- resize_fixed_icontext_list_menuitems_to_list_width();
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory23Screen;
- RedrawCategoryFunction = RedrawCategory23Screen;
- GetCategoryHistory = GetCategory23History;
- GetCategoryHistorySize = GetCategory23HistorySize;
- RedrawCategory23Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory23Screen
- * DESCRIPTION
- * Exits the SMS inbox category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory23Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory23HistorySize
- * DESCRIPTION
- * Gets the size of the history buffer for the SMS inbox screen
- * PARAMETERS
- * void
- * RETURNS
- * size of history buffer in U8s
- *****************************************************************************/
- S32 GetCategory23HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(list_menu_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory23History
- * DESCRIPTION
- * Gets the history buffer for the SMS inbox screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory23History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history(MMI_CATEGORY23_ID, history_buffer);
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory24Screen
- * DESCRIPTION
- * Redraws the SMS outbox category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory24Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- clear_buttonbar();
- show_title_status_icon();
- draw_title();
- show_fixed_list();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory24Screen
- * DESCRIPTION
- * Redraws the SMS outbox category screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * number_of_items [IN] Number of items
- * list_of_items1 [IN] List of text items (Each row has one
- * list_of_icons1 [IN] Icon list
- * highlighted_item [IN] Default item to be highlighted (if there is no history)
- * history_buffer [IN] History buffer
- * text(?) [IN] Column) Note: This is an array of
- * strings(?) [IN] And not string IDs.
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory24Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- S32 number_of_items,
- U8 **list_of_items1,
- U16 *list_of_icons1,
- S32 highlighted_item,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 i, shortcut_width, text_width, icon_position;
- U8 h_flag;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- create_fixed_icontext_list_menuitems(1, 1);
- text_width = UI_device_width - 28 - MMI_fixed_list_menu.vbar.width;
- icon_position = 1;
- set_fixed_icontext_list_text_coordinates(0, 18, 0, text_width, 18);
- set_fixed_icontext_list_icon_coordinates(0, icon_position, 0, 16, 18);
- associate_fixed_icontext_list_list();
- for (i = 0; i < number_of_items; i++)
- {
- fixed_icontext_list_item_insert(i);
- add_fixed_icontext_list_item_text(i, 0, (UI_string_type) list_of_items1[i]);
- add_fixed_icontext_list_item_icon(i, 0, wgui_get_list_menu_icon(i, list_of_icons1[i]));
- }
- MMI_current_menu_type = LIST_MENU;
- register_fixed_list_shortcut_handler();
- register_fixed_list_keys();
- shortcut_width = set_menu_item_count(number_of_items) + 7;
- resize_menu_shortcut_handler(shortcut_width, MMI_title_height);
- move_menu_shortcut_handler(UI_device_width - MMI_menu_shortcut_box.width, MMI_title_y);
- register_hide_menu_shortcut(gui_redraw_menu_shortcut);
- move_fixed_list(0, (MMI_title_y + MMI_title_height));
- resize_fixed_list(MMI_content_width, MMI_content_height + 2);
- resize_fixed_list_to_content_height();
- register_fixed_list_highlight_handler(standard_list_highlight_handler);
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- clear_left_softkey();
- clear_right_softkey();
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- h_flag = set_list_menu_category_history(MMI_CATEGORY24_ID, history_buffer);
- if (h_flag)
- {
- fixed_list_goto_item_no_redraw(MMI_fixed_list_menu.highlighted_item);
- }
- else
- {
- fixed_list_goto_item_no_redraw(highlighted_item);
- }
- resize_fixed_icontext_list_menuitems_to_list_width();
- gui_unlock_double_buffer();
- ExitCategoryFunction = ExitCategory24Screen;
- RedrawCategoryFunction = RedrawCategory24Screen;
- GetCategoryHistory = GetCategory24History;
- GetCategoryHistorySize = GetCategory24HistorySize;
- RedrawCategory24Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory24Screen
- * DESCRIPTION
- * Exits the SMS outbox category screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory24Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearHighlightHandler();
- reset_softkeys();
- reset_menu_shortcut_handler();
- reset_fixed_list();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory24HistorySize
- * DESCRIPTION
- * Gets the size of the history buffer for the SMS outbox screen
- * PARAMETERS
- * void
- * RETURNS
- * size of history buffer in U8s
- *****************************************************************************/
- S32 GetCategory24HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (sizeof(list_menu_category_history));
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory24History
- * DESCRIPTION
- * Gets the history buffer for the SMS outbox screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer into which the history data is stored (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory24History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- get_list_menu_category_history(MMI_CATEGORY24_ID, history_buffer);
- return (history_buffer);
- }
- #define USE_NEW_DATE_TIME_IMPLEMENTATION 0
- #if(USE_NEW_DATE_TIME_IMPLEMENTATION)
- date_input wgui_date_input_object;
- #endif
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory25Screen
- * DESCRIPTION
- * Redraws the category25 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory25Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = gui_color(0, 0, 0);
- #if(!USE_NEW_DATE_TIME_IMPLEMENTATION)
- UI_string_type DD_string = get_string(WGUI_CATEGORY_DD_STRING_ID);
- UI_string_type MM_string = get_string(WGUI_CATEGORY_MM_STRING_ID);
- UI_string_type YYYY_string = get_string(WGUI_CATEGORY_YYYY_STRING_ID);
- UI_string_type THH_string = get_string(WGUI_CATEGORY_THH_STRING_ID);
- UI_string_type TMM_string = get_string(WGUI_CATEGORY_TMM_STRING_ID);
- S32 w;
- #else /* (!USE_NEW_DATE_TIME_IMPLEMENTATION) */
- UI_string_type date_format_string = get_string(WGUI_CATEGORY_YYYY_MM_DD_STRING_ID);
- UI_string_type time_format_string = get_string(WGUI_CATEGORY_HH_MM_STRING_ID);
- S32 w, y;
- #endif /* (!USE_NEW_DATE_TIME_IMPLEMENTATION) */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- clear_screen();
- show_title_status_icon();
- draw_title();
- show_multiline_inputbox();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- #if(!USE_NEW_DATE_TIME_IMPLEMENTATION)
- /* Needs to be enhanced */
- gui_reset_text_clip();
- gui_set_text_color(c);
- gui_set_font(wgui_date_input_day.text_font);
- w = (wgui_date_input_day.width >> 1) - (gui_get_string_width(DD_string) >> 1);
- gui_move_text_cursor(wgui_date_input_day.x + w, wgui_date_input_day.y - 14);
- gui_print_text(DD_string);
- w = (wgui_date_input_month.width >> 1) - (gui_get_string_width(MM_string) >> 1);
- gui_move_text_cursor(wgui_date_input_month.x + w, wgui_date_input_month.y - 14);
- gui_print_text(MM_string);
- w = (wgui_date_input_year.width >> 1) - (gui_get_string_width(YYYY_string) >> 1);
- gui_move_text_cursor(wgui_date_input_year.x + w, wgui_date_input_year.y - 14);
- gui_print_text(YYYY_string);
- gui_set_font(wgui_time_input_hours.text_font);
- w = (wgui_time_input_hours.width >> 1) - (gui_get_string_width(THH_string) >> 1);
- gui_move_text_cursor(wgui_time_input_hours.x + w, wgui_time_input_hours.y - 14);
- gui_print_text(THH_string);
- w = (wgui_time_input_minutes.width >> 1) - (gui_get_string_width(TMM_string) >> 1);
- gui_move_text_cursor(wgui_time_input_minutes.x + w, wgui_time_input_minutes.y - 14);
- gui_print_text(TMM_string);
- wgui_show_date_time_input();
- #else /* (!USE_NEW_DATE_TIME_IMPLEMENTATION) */
- y = MMI_multiline_inputbox.y + MMI_multiline_inputbox.height;
- gui_reset_text_clip();
- gui_set_text_color(c);
- gui_set_font(&MMI_default_font);
- w = (UI_device_width >> 1) - (gui_get_string_width(date_format_string) >> 1);
- gui_move_text_cursor(w, y);
- gui_print_text(date_format_string);
- w = (UI_device_width >> 1) - (gui_get_string_width(time_format_string) >> 1);
- y = wgui_date_input_object.y + wgui_date_input_object.height + 2;
- gui_move_text_cursor(w, y);
- gui_print_text(time_format_string);
- date_input_show_background(&wgui_date_input_object);
- show_date_input(&wgui_date_input_object);
- #endif /* (!USE_NEW_DATE_TIME_IMPLEMENTATION) */
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*----------------------------------------------------------------------------
- Function: category25_RSK_function
- Description: a function pointer store the address of RSK key
- Input Parameters: none
- Output Parameters: none
- Returns: void
- ----------------------------------------------------------------------------*/
- void (*category25_RSK_function) (void) = NULL;
- U8 category25_RSK_label_clear = 0;
- /* store the RSK string of category 25 */
- UI_string_type category25_RSK_label_string;
- /* store the RSK icon of category 25 */
- PU8 category25_RSK_label_icon;
- /*****************************************************************************
- * FUNCTION
- * SetCategory25RightSoftkeyFunction
- * DESCRIPTION
- * set teh function pointer of RSK key handler of category25
- * PARAMETERS
- * f [IN]
- * k [IN]
- * a(?) [IN] Function pointer
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory25RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- category25_RSK_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category25_right_softkey_down
- * DESCRIPTION
- * handle category 25 RSK down key
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category25_right_softkey_down(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_delete_character();
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category25_right_softkey_up
- * DESCRIPTION
- * handle category 25 RSK up key
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category25_right_softkey_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l1 = gui_single_line_input_box_get_text_length(&wgui_date_input_day);
- S32 l2 = gui_single_line_input_box_get_text_length(&wgui_date_input_month);
- S32 l3 = gui_single_line_input_box_get_text_length(&wgui_date_input_year);
- S32 l4 = gui_single_line_input_box_get_text_length(&wgui_time_input_hours);
- S32 l5 = gui_single_line_input_box_get_text_length(&wgui_time_input_minutes);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((l1 <= 0) && (l2 <= 0) && (l3 <= 0) && (l4 <= 0) && (l5 <= 0) && (!category25_RSK_label_clear))
- {
- if (category25_RSK_function != NULL)
- {
- category25_RSK_function();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * register_category25_handle_right_softkey_up
- * DESCRIPTION
- * register right soft key function handler of category 25
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_category25_handle_right_softkey_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_right_softkey_function(handle_category25_right_softkey_up, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category25_right_softkey_long_press
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category25_right_softkey_long_press(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category25_input
- * DESCRIPTION
- * handle category25 input
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category25_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l1 = gui_single_line_input_box_get_text_length(&wgui_date_input_day);
- S32 l2 = gui_single_line_input_box_get_text_length(&wgui_date_input_month);
- S32 l3 = gui_single_line_input_box_get_text_length(&wgui_date_input_year);
- S32 l4 = gui_single_line_input_box_get_text_length(&wgui_time_input_hours);
- S32 l5 = gui_single_line_input_box_get_text_length(&wgui_time_input_minutes);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((l1 > 0) || (l2 > 0) || (l3 > 0) || (l4 > 0) || (l5 > 0))
- {
- if (category25_RSK_label_clear == 0)
- {
- /* Hardcoded. Needs to be modified to take IDs */
- set_right_softkey_label((UI_string_type) get_string(WGUI_CATEGORY_CLEAR_STRING_ID));
- set_right_softkey_icon(NULL);
- redraw_right_softkey();
- category25_RSK_label_clear = 1;
- set_right_softkey_function(UI_dummy_function, KEY_EVENT_UP);
- }
- }
- else
- {
- if (category25_RSK_label_clear == 1)
- {
- set_right_softkey_label(category25_RSK_label_string);
- set_right_softkey_icon(category25_RSK_label_icon);
- redraw_right_softkey();
- category25_RSK_label_clear = 0;
- set_right_softkey_function(register_category25_handle_right_softkey_up, KEY_EVENT_UP);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory25Screen
- * DESCRIPTION
- * Displays the category25 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the Left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * message [IN] Message string
- * day_buffer [IN] Buffer to input day
- * month_buffer [IN] Buffer to input month
- * year_buffer [IN] Buffer to input year
- * hours_buffer [IN] Buffer to input hours
- * minutes_buffer [IN] Buffer to input minutes
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory25Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 message,
- U8 *day_buffer,
- U8 *month_buffer,
- U8 *year_buffer,
- U8 *hours_buffer,
- U8 *minutes_buffer,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l, fh, n;
- #if(!USE_NEW_DATE_TIME_IMPLEMENTATION)
- S32 s1, s2, s3, sg, x, y;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ADD_SCREEN_STRINGS((4, title, left_softkey, right_softkey, message));
- ADD_SCREEN_IMAGES((3, title_icon, left_softkey_icon, right_softkey_icon));
- UI_UNUSED_PARAMETER(history_buffer);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_message_string = (UI_string_type) get_string(message);
- l = gui_strlen(MMI_message_string);
- create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
- resize_multiline_inputbox(MMI_multiline_inputbox.width, MMI_content_height);
- MMI_multiline_inputbox.flags |=
- (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
- show_multiline_inputbox_no_draw();
- gui_set_font(MMI_multiline_inputbox.text_font);
- fh = get_multiline_inputbox_line_height();
- n = MMI_multiline_inputbox.n_lines;
- if (n > 2)
- {
- n = 2;
- }
- resize_multiline_inputbox(
- MMI_multiline_inputbox.width,
- (n * fh) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y);
- move_multiline_inputbox(0, (MMI_title_y + MMI_title_height));
- #if(!USE_NEW_DATE_TIME_IMPLEMENTATION)
- wgui_initialize_date_input(day_buffer, 2, month_buffer, 2, year_buffer, 4);
- wgui_initialize_time_input(hours_buffer, 2, minutes_buffer, 2, NULL, 0);
- y = 16 + MMI_multiline_inputbox.y + MMI_multiline_inputbox.height +
- (((MMI_content_height - MMI_multiline_inputbox.height) >> 1) - (16 + 18));
- s1 = 24;
- s2 = 24;
- s3 = 40;
- sg = 4;
- wgui_resize_day_input(s1, 18);
- wgui_resize_month_input(s2, 18);
- wgui_resize_year_input(s3, 18);
- x = (UI_device_width >> 1) - ((s1 + s2 + s3 + sg + sg) >> 1);
- wgui_move_day_input(x, y);
- x += s1 + sg;
- wgui_move_month_input(x, y);
- x += s2 + sg;
- wgui_move_year_input(x, y);
- y += 18 + 16;
- s1 = 24;
- s2 = 24;
- sg = 4;
- wgui_resize_hours_input(s1, 18);
- wgui_resize_minutes_input(s2, 18);
- x = (UI_device_width >> 1) - ((s1 + s2 + sg) >> 1);
- wgui_move_hours_input(x, y);
- x += s1 + sg;
- wgui_move_minutes_input(x, y);
- wgui_set_day_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_NONE, WGUI_DATE_TIME_INPUT_FOCUS_MONTH);
- wgui_set_month_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_DAY, WGUI_DATE_TIME_INPUT_FOCUS_YEAR);
- wgui_set_year_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_MONTH, WGUI_DATE_TIME_INPUT_FOCUS_HOURS);
- wgui_set_hours_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_YEAR, WGUI_DATE_TIME_INPUT_FOCUS_MINUTES);
- wgui_set_minutes_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_HOURS, WGUI_DATE_TIME_INPUT_FOCUS_NONE);
- wgui_date_time_input_set_focus(WGUI_DATE_TIME_INPUT_FOCUS_DAY);
- wgui_date_time_input_register_keys();
- category25_RSK_label_clear = 0;
- set_right_softkey_function(handle_category25_right_softkey_down, KEY_EVENT_DOWN);
- set_right_softkey_function(handle_category25_right_softkey_long_press, KEY_LONG_PRESS);
- register_wgui_date_time_input_callback(handle_category25_input);
- category25_RSK_label_icon = get_image(right_softkey_icon);
- category25_RSK_label_string = get_string(right_softkey);
- handle_category25_input();
- {
- S32 l1 = gui_single_line_input_box_get_text_length(&wgui_date_input_day);
- S32 l2 = gui_single_line_input_box_get_text_length(&wgui_date_input_month);
- S32 l3 = gui_single_line_input_box_get_text_length(&wgui_date_input_year);
- S32 l4 = gui_single_line_input_box_get_text_length(&wgui_time_input_hours);
- S32 l5 = gui_single_line_input_box_get_text_length(&wgui_time_input_minutes);
- if ((l1 <= 0) && (l2 <= 0) && (l3 <= 0) && (l4 <= 0) && (l5 <= 0))
- {
- set_right_softkey_function(handle_category25_right_softkey_up, KEY_EVENT_UP);
- }
- }
- #else /* (!USE_NEW_DATE_TIME_IMPLEMENTATION) */
- create_date_input(
- &wgui_date_input_object,
- 8,
- MMI_multiline_inputbox.y + 22,
- UI_device_width - 16,
- 18,
- DATE_INPUT_TYPE_YYYY_MM_DD,
- day_buffer,
- month_buffer,
- year_buffer);
- /* inline_date_edit_set_history(INLINE_DATE_HISTORY_ID,history_buffer); */
- date_input_set_seperator(&wgui_date_input_object, (UI_character_type) '/');
- set_current_date_input(&wgui_date_input_object);
- date_input_register_keys();
- #endif /* (!USE_NEW_DATE_TIME_IMPLEMENTATION) */
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory25Screen;
- RedrawCategoryFunction = RedrawCategory25Screen;
- GetCategoryHistory = GetCategory25History;
- GetCategoryHistorySize = GetCategory25HistorySize;
- RedrawCategory25Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory25Screen
- * DESCRIPTION
- * Exits the category25 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory25Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_input_clear_keys();
- wgui_reset_date_input();
- wgui_reset_time_input();
- clear_wgui_date_time_input_callback();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory25HistorySize
- * DESCRIPTION
- * Gets the history buffer size for the category25 screen
- * PARAMETERS
- * void
- * RETURNS
- * size of history buffer in U8s
- *****************************************************************************/
- S32 GetCategory25HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (0);
- }
- /*****************************************************************************
- * FUNCTION
- * GetCategory25History
- * DESCRIPTION
- * Gets the history buffer for the category25 screen
- * PARAMETERS
- * history_buffer [IN] Is the buffer to store the history data (pre-allocated)
- * RETURNS
- * pointer to the history buffer
- *****************************************************************************/
- U8 *GetCategory25History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (history_buffer);
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory26Screen
- * DESCRIPTION
- * Redraws the category26 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawCategory26Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = gui_color(0, 0, 0);
- UI_string_type DD_string = get_string(WGUI_CATEGORY_DD_STRING_ID);
- UI_string_type MM_string = get_string(WGUI_CATEGORY_MM_STRING_ID);
- UI_string_type YYYY_string = get_string(WGUI_CATEGORY_YYYY_STRING_ID);
- S32 w;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gui_lock_double_buffer();
- clear_screen();
- show_title_status_icon();
- draw_title();
- show_multiline_inputbox();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- /* Needs to be enhanced */
- gui_reset_text_clip();
- gui_set_text_color(c);
- gui_set_font(wgui_date_input_day.text_font);
- w = (wgui_date_input_day.width >> 1) - (gui_get_string_width(DD_string) >> 1);
- gui_move_text_cursor(wgui_date_input_day.x + w, wgui_date_input_day.y - 14);
- gui_print_text(DD_string);
- w = (wgui_date_input_month.width >> 1) - (gui_get_string_width(MM_string) >> 1);
- gui_move_text_cursor(wgui_date_input_month.x + w, wgui_date_input_month.y - 14);
- gui_print_text(MM_string);
- w = (wgui_date_input_year.width >> 1) - (gui_get_string_width(YYYY_string) >> 1);
- gui_move_text_cursor(wgui_date_input_year.x + w, wgui_date_input_year.y - 14);
- gui_print_text(YYYY_string);
- wgui_show_date_time_input();
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- }
- /*----------------------------------------------------------------------------
- Function: category26_RSK_function
- Description: a function pointer store teh address of function which handles
- category26 RSK
- Input Parameters: none
- Output Parameters: none
- Returns: void
- ----------------------------------------------------------------------------*/
- void (*category26_RSK_function) (void) = NULL;
- U8 category26_RSK_label_clear = 0;
- /* store teh string of category26 RSK */
- UI_string_type category26_RSK_label_string;
- /* store the icon of category 26 RSK */
- PU8 category26_RSK_label_icon;
- /*****************************************************************************
- * FUNCTION
- * SetCategory26RightSoftkeyFunction
- * DESCRIPTION
- * set the function of RSK key of category26
- * PARAMETERS
- * f [IN]
- * k [IN]
- * a(?) [IN] Function pointer
- * RETURNS
- * void
- *****************************************************************************/
- void SetCategory26RightSoftkeyFunction(void (*f) (void), MMI_key_event_type k)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_UNUSED_PARAMETER(k);
- category26_RSK_function = f;
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category26_right_softkey_down
- * DESCRIPTION
- * a function handle the RSK down key of category 26
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category26_right_softkey_down(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- wgui_date_time_delete_character();
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category26_right_softkey_up
- * DESCRIPTION
- * a function handle the RSK up key of category 26
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category26_right_softkey_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l1 = gui_single_line_input_box_get_text_length(&wgui_date_input_day);
- S32 l2 = gui_single_line_input_box_get_text_length(&wgui_date_input_month);
- S32 l3 = gui_single_line_input_box_get_text_length(&wgui_date_input_year);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((l1 <= 0) && (l2 <= 0) && (l3 <= 0) && (!category26_RSK_label_clear))
- {
- if (category26_RSK_function != NULL)
- {
- category26_RSK_function();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * register_category26_handle_right_softkey_up
- * DESCRIPTION
- * register a function whcih handle category26 RSK up key
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void register_category26_handle_right_softkey_up(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_right_softkey_function(handle_category26_right_softkey_up, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category26_right_softkey_long_press
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category26_right_softkey_long_press(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- }
- /*****************************************************************************
- * FUNCTION
- * handle_category26_input
- * DESCRIPTION
- * a function which handle category26 input
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void handle_category26_input(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l1 = gui_single_line_input_box_get_text_length(&wgui_date_input_day);
- S32 l2 = gui_single_line_input_box_get_text_length(&wgui_date_input_month);
- S32 l3 = gui_single_line_input_box_get_text_length(&wgui_date_input_year);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((l1 > 0) || (l2 > 0) || (l3 > 0))
- {
- if (category26_RSK_label_clear == 0)
- {
- set_right_softkey_label((UI_string_type) get_string(WGUI_CATEGORY_CLEAR_STRING_ID));
- set_right_softkey_icon(NULL);
- redraw_right_softkey();
- category26_RSK_label_clear = 1;
- set_right_softkey_function(UI_dummy_function, KEY_EVENT_UP);
- }
- }
- else
- {
- if (category26_RSK_label_clear == 1)
- {
- set_right_softkey_label(category26_RSK_label_string);
- set_right_softkey_icon(category26_RSK_label_icon);
- redraw_right_softkey();
- category26_RSK_label_clear = 0;
- set_right_softkey_function(register_category26_handle_right_softkey_up, KEY_EVENT_UP);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory26Screen
- * DESCRIPTION
- * Displays the category26 screen
- * PARAMETERS
- * title [IN] Title for the screen
- * title_icon [IN] Icon shown with the title
- * left_softkey [IN] Left softkey label
- * left_softkey_icon [IN] Icon for the Left softkey
- * right_softkey [IN] Right softkey label
- * right_softkey_icon [IN] Icon for the right softkey
- * message [IN] Message string
- * day_buffer [IN] Buffer to input day
- * month_buffer [IN] Buffer to input month
- * year_buffer [IN] Buffer to input year
- * history_buffer [IN] History buffer
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory26Screen(
- U16 title,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 message,
- U8 *day_buffer,
- U8 *month_buffer,
- U8 *year_buffer,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 l, s1, s2, s3, sg, x, y, fh;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ADD_SCREEN_STRINGS((4, title, left_softkey, right_softkey, message));
- ADD_SCREEN_IMAGES((3, title_icon, left_softkey_icon, right_softkey_icon));
- UI_UNUSED_PARAMETER(history_buffer);
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_lock_double_buffer();
- #endif
- MMI_menu_shortcut_number = -1;
- clear_category_screen_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- MMI_title_string = (UI_string_type) get_string(title);
- MMI_title_icon = (PU8) get_image(title_icon);
- MMI_message_string = (UI_string_type) get_string(message);
- l = gui_strlen(MMI_message_string);
- create_multiline_inputbox_set_buffer(MMI_message_string, l, l, 0);
- resize_multiline_inputbox(MMI_multiline_inputbox.width, 40);
- MMI_multiline_inputbox.flags |=
- (UI_MULTI_LINE_INPUT_BOX_DISABLE_CURSOR_DRAW | UI_MULTI_LINE_INPUT_BOX_CENTER_JUSTIFY |
- UI_MULTI_LINE_INPUT_BOX_DISABLE_BACKGROUND | UI_MULTI_LINE_INPUT_BOX_DISABLE_SCROLLBAR);
- show_multiline_inputbox_no_draw();
- gui_set_font(MMI_multiline_inputbox.text_font);
- fh = get_multiline_inputbox_line_height();
- resize_multiline_inputbox(
- MMI_multiline_inputbox.width,
- (MMI_multiline_inputbox.n_lines * fh) + MULTILINE_INPUTBOX_HEIGHT_PAD + MMI_multiline_inputbox.text_y);
- /* MTK Leo added, to move inputbox to proper position */
- #ifdef __BW_MMI__
- move_multiline_inputbox((MMI_content_width << 1) - (l << 1), (MMI_title_y + MMI_title_height) + 2);
- #else
- move_multiline_inputbox(0, (MMI_title_y + MMI_title_height));
- #endif
- /* MTK Leo end */
- wgui_reset_time_input();
- wgui_initialize_date_input(day_buffer, 2, month_buffer, 2, year_buffer, 4);
- y = 16 + MMI_multiline_inputbox.y + MMI_multiline_inputbox.height +
- (((MMI_content_height - MMI_multiline_inputbox.height) >> 1) - ((16 + 18) >> 1));
- s1 = 24;
- s2 = 24;
- s3 = 40;
- sg = 4;
- wgui_resize_day_input(s1, 18);
- wgui_resize_month_input(s2, 18);
- wgui_resize_year_input(s3, 18);
- x = (UI_device_width >> 1) - ((s1 + s2 + s3 + sg + sg) >> 1);
- wgui_move_day_input(x, y);
- x += s1 + sg;
- wgui_move_month_input(x, y);
- x += s2 + sg;
- wgui_move_year_input(x, y);
- wgui_set_day_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_NONE, WGUI_DATE_TIME_INPUT_FOCUS_MONTH);
- wgui_set_month_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_DAY, WGUI_DATE_TIME_INPUT_FOCUS_YEAR);
- wgui_set_year_input_navigation(WGUI_DATE_TIME_INPUT_FOCUS_MONTH, WGUI_DATE_TIME_INPUT_FOCUS_NONE);
- wgui_date_time_input_set_focus(WGUI_DATE_TIME_INPUT_FOCUS_DAY);
- wgui_date_time_input_register_keys();
- category26_RSK_label_clear = 0;
- set_right_softkey_function(handle_category26_right_softkey_down, KEY_EVENT_DOWN);
- set_right_softkey_function(handle_category26_right_softkey_long_press, KEY_LONG_PRESS);
- register_wgui_date_time_input_callback(handle_category26_input);
- category26_RSK_label_icon = get_image(right_softkey_icon);
- category26_RSK_label_string = get_string(right_softkey);
- handle_category26_input();
- {
- S32 l1 = gui_single_line_input_box_get_text_length(&wgui_date_input_day);
- S32 l2 = gui_single_line_input_box_get_text_length(&wgui_date_input_month);
- S32 l3 = gui_single_line_input_box_get_text_length(&wgui_date_input_year);
- if ((l1 <= 0) && (l2 <= 0) && (l3 <= 0))
- {
- set_right_softkey_function(handle_category26_right_softkey_up, KEY_EVENT_UP);
- }
- }
- #if(UI_DOUBLE_BUFFER_SUPPORT)
- gui_unlock_double_buffer();
- #endif
- ExitCategoryFunction = ExitCategory26Screen;
- RedrawCategoryFunction = RedrawCategory26Screen;
- GetCategoryHistory = GetCategory26History;
- GetCategoryHistorySize = GetCategory26HistorySize;
- RedrawCategory26Screen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory26Screen
- * DESCRIPTION
- * Exits the category26 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory26Screen(void)
- {
- /*----------------------------------------------------------------*/