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

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*****************************************************************************
  36.  *
  37.  * Filename:
  38.  * ---------
  39.  * wgui_tab.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  * MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  * This file is intended for tab control upper layer wrappers and instance handling.
  48.  *
  49.  * Note: wgui_tab_bars.c is another implementation of tab control. 
  50.  * wgui_tab.c will deprecate wgui_tab_bars.c in the future.
  51.  *
  52.  * Author:
  53.  * -------
  54.  * -------
  55.  *
  56.  *============================================================================
  57.  *             HISTORY
  58.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  59.  *------------------------------------------------------------------------------
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  *------------------------------------------------------------------------------
  75.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  76.  *============================================================================
  77.  ****************************************************************************/
  78. /*  Include: MMI header file */
  79. #include "MMI_features.h"
  80. #include "gui_config.h"//051106 tab mainmenu
  81. #ifdef __MMI_UI_TAB_PANE__
  82. #include "wgui_categories.h"
  83. #include "gui_data_types.h"
  84. #include "CustThemesRes.h"
  85. #include "gui_tab.h"
  86. #include "wgui_tab.h"
  87. #include "HistoryGProt.h"
  88. extern S32 UI_device_width;
  89. #include "wgui_categories_defs.h"
  90. #include "gdi_include.h"
  91. #ifdef __MMI_TOUCH_SCREEN__
  92. #include "wgui_touch_screen.h" /* for touch screen apis */
  93. #endif
  94. /*  Include: PS header file */
  95. /***************************************************************************** 
  96. * Define
  97. *****************************************************************************/
  98. /***************************************************************************** 
  99. * Typedef 
  100. *****************************************************************************/
  101. /***************************************************************************** 
  102. * Local Variable
  103. *****************************************************************************/
  104. struct_tab_control MMI_tab_control;
  105. struct_tab_icon_data MMI_tab_icon_data;
  106. struct_tab_text_data MMI_tab_text_data;
  107. /* struct_tab_icontext_data     MMI_tab_icontext_data; */
  108. struct_tab_items MMI_tab_items[MAX_TAB_ITEMS];
  109. S32 MMI_tab_height = MMI_TAB_HEIGHT;
  110. void (*tab_pane_modify_data_ptr) (void);
  111. void (*MMI_tab_pane_callback) (void);
  112. void (*MMI_set_tab_pane_data_callback) (void);
  113. void (*MMI_reset_tab_pane_data_callback) (void);
  114. S32 MMI_enable_tab_pane_display = 0;
  115. FuncPtr backup_entry_func_ptr;
  116. FuncPtr backup_exit_func_ptr;
  117. U8 *(*backup_category_func_ptr) (U8 *buffer);
  118. S32 enable_function_execution = 1;
  119. S32 allow_history_saving = 1;
  120. S32 disable_tab_pane_register = 0;
  121. S32 set_list_history = 0;
  122. /*----------------------------------------------------------------------------
  123. Function    :  MMI_tab_highlight_handler
  124. Description    :  Function pointer store the address of function which get
  125.                executed when any item in tab get high lighted
  126. Input Parameters: S32 item _index :- store the current index of item highlighted
  127. Output Parameters:   none
  128. Returns:       void
  129. ----------------------------------------------------------------------------*/
  130. void (*MMI_tab_highlight_handler) (S32 item_index);
  131. /***************************************************************************** 
  132. * Local Function
  133. *****************************************************************************/
  134. /***************************************************************************** 
  135. * Global Variable
  136. *****************************************************************************/
  137. /***************************************************************************** 
  138. * Global Function
  139. *****************************************************************************/
  140. /*****************************************************************************
  141.  * FUNCTION
  142.  *  create_two_icon_tab_pane
  143.  * DESCRIPTION
  144.  *  creates two icon tab pane
  145.  * PARAMETERS
  146.  *  void
  147.  *  a(?)        [IN/OUT]        
  148.  *  b(?)        [IN]            
  149.  * RETURNS
  150.  *  void
  151.  *****************************************************************************/
  152. void create_two_icon_tab_pane(void)
  153. {
  154.     /*----------------------------------------------------------------*/
  155.     /* Local Variables                                                */
  156.     /*----------------------------------------------------------------*/
  157.     /*----------------------------------------------------------------*/
  158.     /* Code Body                                                      */
  159.     /*----------------------------------------------------------------*/
  160.     gui_create_tab_pane(
  161.         &MMI_tab_control,
  162.         TAB_CONTROL_WITH_TWO_ICON,
  163.         0,
  164.         MMI_title_y + MMI_title_height,
  165.         UI_device_width,
  166.         MMI_tab_height);
  167.     enable_function_execution = 1;
  168. }
  169. /*****************************************************************************
  170.  * FUNCTION
  171.  *  create_two_text_tab_pane
  172.  * DESCRIPTION
  173.  *  creates two text tab pane
  174.  * PARAMETERS
  175.  *  void
  176.  *  a(?)        [IN/OUT]        
  177.  *  b(?)        [IN]            
  178.  * RETURNS
  179.  *  void
  180.  *****************************************************************************/
  181. void create_two_text_tab_pane(void)
  182. {
  183.     /*----------------------------------------------------------------*/
  184.     /* Local Variables                                                */
  185.     /*----------------------------------------------------------------*/
  186.     /*----------------------------------------------------------------*/
  187.     /* Code Body                                                      */
  188.     /*----------------------------------------------------------------*/
  189.     gui_create_tab_pane(
  190.         &MMI_tab_control,
  191.         TAB_CONTROL_WITH_TWO_TEXT,
  192.         0,
  193.         MMI_title_y + MMI_title_height,
  194.         UI_device_width,
  195.         MMI_tab_height);
  196.     enable_function_execution = 1;
  197. }
  198. /*****************************************************************************
  199.  * FUNCTION
  200.  *  create_four_icon_tab_pane
  201.  * DESCRIPTION
  202.  *  creates four icon tab pane
  203.  * PARAMETERS
  204.  *  void
  205.  *  a(?)        [IN/OUT]        
  206.  *  b(?)        [IN]            
  207.  * RETURNS
  208.  *  void
  209.  *****************************************************************************/
  210. void create_four_icon_tab_pane(void)
  211. {
  212.     /*----------------------------------------------------------------*/
  213.     /* Local Variables                                                */
  214.     /*----------------------------------------------------------------*/
  215.     /*----------------------------------------------------------------*/
  216.     /* Code Body                                                      */
  217.     /*----------------------------------------------------------------*/
  218.     gui_create_tab_pane(
  219.         &MMI_tab_control,
  220.         TAB_CONTROL_WITH_FOUR_ICON,
  221.         0,
  222.         MMI_title_y + MMI_title_height,
  223.         UI_device_width,
  224.         MMI_tab_height);
  225.     enable_function_execution = 1;
  226. }
  227. /*
  228.  * void create_four_icontext_tab_pane(void)
  229.  * {
  230.  * gui_create_tab_pane(&MMI_tab_control,TAB_CONTROL_WITH_FOUR_ICONTEXT,
  231.  * 0,MMI_title_height,UI_device_width,MMI_tab_height);
  232.  * enable_function_execution=1;
  233.  * }
  234.  */
  235. /*****************************************************************************
  236.  * FUNCTION
  237.  *  create_three_icon_tab_pane
  238.  * DESCRIPTION
  239.  *  creates three icon tab pane
  240.  * PARAMETERS
  241.  *  void
  242.  *  a(?)        [IN/OUT]        
  243.  *  b(?)        [IN]            
  244.  * RETURNS
  245.  *  void
  246.  *****************************************************************************/
  247. void create_three_icon_tab_pane(void)
  248. {
  249.     /*----------------------------------------------------------------*/
  250.     /* Local Variables                                                */
  251.     /*----------------------------------------------------------------*/
  252.     /*----------------------------------------------------------------*/
  253.     /* Code Body                                                      */
  254.     /*----------------------------------------------------------------*/
  255.     gui_create_tab_pane(
  256.         &MMI_tab_control,
  257.         TAB_CONTROL_WITH_THREE_ICON,
  258.         0,
  259.         MMI_title_y + MMI_title_height,
  260.         UI_device_width,
  261.         MMI_tab_height);
  262.     enable_function_execution = 1;
  263. }
  264. /*****************************************************************************
  265.  * FUNCTION
  266.  *  create_one_icon_tab_pane
  267.  * DESCRIPTION
  268.  *  creates one icon tab pane
  269.  * PARAMETERS
  270.  *  void
  271.  *  a(?)        [IN/OUT]        
  272.  *  b(?)        [IN]            
  273.  * RETURNS
  274.  *  void
  275.  *****************************************************************************/
  276. void create_one_icon_tab_pane(void)
  277. {
  278.     /*----------------------------------------------------------------*/
  279.     /* Local Variables                                                */
  280.     /*----------------------------------------------------------------*/
  281.     /*----------------------------------------------------------------*/
  282.     /* Code Body                                                      */
  283.     /*----------------------------------------------------------------*/
  284.     gui_create_tab_pane(
  285.         &MMI_tab_control,
  286.         TAB_CONTROL_WITH_ONE_ICON,
  287.         0,
  288.         MMI_title_y + MMI_title_height,
  289.         UI_device_width,
  290.         MMI_tab_height);
  291.     enable_function_execution = 1;
  292. }
  293. /*****************************************************************************
  294.  * FUNCTION
  295.  *  move_tab_pane
  296.  * DESCRIPTION
  297.  *  moves tab pane
  298.  * PARAMETERS
  299.  *  x           [IN]            
  300.  *  y           [IN]            
  301.  *  a(?)        [IN/OUT]        
  302.  *  b(?)        [IN]            
  303.  * RETURNS
  304.  *  void
  305.  *****************************************************************************/
  306. void move_tab_pane(S32 x, S32 y)
  307. {
  308.     /*----------------------------------------------------------------*/
  309.     /* Local Variables                                                */
  310.     /*----------------------------------------------------------------*/
  311.     /*----------------------------------------------------------------*/
  312.     /* Code Body                                                      */
  313.     /*----------------------------------------------------------------*/
  314.     gui_move_tab_pane(&MMI_tab_control, x, y);
  315. }
  316. /*****************************************************************************
  317.  * FUNCTION
  318.  *  resize_tab_pane
  319.  * DESCRIPTION
  320.  *  resizes tab pane
  321.  * PARAMETERS
  322.  *  height      [IN]            
  323.  *  width       [IN]            
  324.  *  a(?)        [IN/OUT]        
  325.  *  b(?)        [IN]            
  326.  * RETURNS
  327.  *  void
  328.  *****************************************************************************/
  329. void resize_tab_pane(S32 height, S32 width)
  330. {
  331.     /*----------------------------------------------------------------*/
  332.     /* Local Variables                                                */
  333.     /*----------------------------------------------------------------*/
  334.     /*----------------------------------------------------------------*/
  335.     /* Code Body                                                      */
  336.     /*----------------------------------------------------------------*/
  337.     gui_resize_tab_pane(&MMI_tab_control, height, width);
  338. }
  339. /*****************************************************************************
  340.  * FUNCTION
  341.  *  set_two_tab_pane_theme_data
  342.  * DESCRIPTION
  343.  *  sets theme data for two icon tab pane
  344.  * PARAMETERS
  345.  *  void
  346.  *  a(?)        [IN/OUT]        
  347.  *  b(?)        [IN]            
  348.  * RETURNS
  349.  *  void
  350.  *****************************************************************************/
  351. void set_two_tab_pane_theme_data(void)
  352. {
  353.     /*----------------------------------------------------------------*/
  354.     /* Local Variables                                                */
  355.     /*----------------------------------------------------------------*/
  356.     /*----------------------------------------------------------------*/
  357.     /* Code Body                                                      */
  358.     /*----------------------------------------------------------------*/
  359.     gui_associate_tab_pane_type_data(&MMI_tab_control, &MMI_tab_icon_data);
  360.     MMI_tab_icon_data.highlight_image = get_image(TAB_PANE_ICON_HIGHLIGHT);
  361.     MMI_tab_icon_data.un_highlight_image = get_image(TAB_PANE_ICON_UN_HIGHLIGHT);
  362. }
  363. /*****************************************************************************
  364.  * FUNCTION
  365.  *  set_two_icon_tab_pane
  366.  * DESCRIPTION
  367.  *  sets two icon tab pane
  368.  * PARAMETERS
  369.  *  void
  370.  *  a(?)        [IN/OUT]        
  371.  *  b(?)        [IN]            
  372.  * RETURNS
  373.  *  void
  374.  *****************************************************************************/
  375. void set_two_icon_tab_pane(void)
  376. {
  377.     /*----------------------------------------------------------------*/
  378.     /* Local Variables                                                */
  379.     /*----------------------------------------------------------------*/
  380.     /*----------------------------------------------------------------*/
  381.     /* Code Body                                                      */
  382.     /*----------------------------------------------------------------*/
  383.     gui_register_set_tab_pane_callback(
  384.         &MMI_tab_control,
  385.         MMI_tab_pane_callback,
  386.         MMI_set_tab_pane_data_callback,
  387.         MMI_reset_tab_pane_data_callback);
  388.     if (MMI_set_tab_pane_data_callback)
  389.     {
  390.         (*MMI_set_tab_pane_data_callback) ();
  391.     }
  392.     (*MMI_tab_pane_callback) ();
  393.     set_two_tab_pane_theme_data();
  394. }
  395. /*****************************************************************************
  396.  * FUNCTION
  397.  *  set_two_text_tab_pane_theme_data
  398.  * DESCRIPTION
  399.  *  sets theme for two text tab pane
  400.  * PARAMETERS
  401.  *  void
  402.  *  a(?)        [IN/OUT]        
  403.  *  b(?)        [IN]            
  404.  * RETURNS
  405.  *  void
  406.  *****************************************************************************/
  407. void set_two_text_tab_pane_theme_data(void)
  408. {
  409.     /*----------------------------------------------------------------*/
  410.     /* Local Variables                                                */
  411.     /*----------------------------------------------------------------*/
  412.     /*----------------------------------------------------------------*/
  413.     /* Code Body                                                      */
  414.     /*----------------------------------------------------------------*/
  415.     gui_associate_tab_pane_type_data(&MMI_tab_control, &MMI_tab_text_data);
  416.     MMI_tab_text_data.highlight_image = get_image(TAB_PANE_TEXT_HIGHLIGHT);
  417.     MMI_tab_text_data.un_highlight_image = get_image(TAB_PANE_TEXT_UN_HIGHLIGHT);
  418.     MMI_tab_text_data.font = &MMI_small_font;
  419.     MMI_tab_text_data.highlight_text_color = gui_color(2, 29, 80);
  420.     MMI_tab_text_data.un_highlight_text_color = gui_color(95, 26, 2);
  421. }
  422. /*****************************************************************************
  423.  * FUNCTION
  424.  *  set_two_text_tab_pane
  425.  * DESCRIPTION
  426.  *  sets two text tab pane
  427.  * PARAMETERS
  428.  *  void
  429.  *  a(?)        [IN/OUT]        
  430.  *  b(?)        [IN]            
  431.  * RETURNS
  432.  *  void
  433.  *****************************************************************************/
  434. void set_two_text_tab_pane(void)
  435. {
  436.     /*----------------------------------------------------------------*/
  437.     /* Local Variables                                                */
  438.     /*----------------------------------------------------------------*/
  439.     /*----------------------------------------------------------------*/
  440.     /* Code Body                                                      */
  441.     /*----------------------------------------------------------------*/
  442.     gui_register_set_tab_pane_callback(
  443.         &MMI_tab_control,
  444.         MMI_tab_pane_callback,
  445.         MMI_set_tab_pane_data_callback,
  446.         MMI_reset_tab_pane_data_callback);
  447.     if (MMI_set_tab_pane_data_callback)
  448.     {
  449.         (*MMI_set_tab_pane_data_callback) ();
  450.     }
  451.     (*MMI_tab_pane_callback) ();
  452.     set_two_text_tab_pane_theme_data();
  453. }
  454. /*****************************************************************************
  455.  * FUNCTION
  456.  *  set_four_icon_pane_theme_data
  457.  * DESCRIPTION
  458.  *  sets theme for four icon tab pane
  459.  * PARAMETERS
  460.  *  void
  461.  *  a(?)        [IN/OUT]        
  462.  *  b(?)        [IN]            
  463.  * RETURNS
  464.  *  void
  465.  *****************************************************************************/
  466. void set_four_icon_pane_theme_data(void)
  467. {
  468.     /*----------------------------------------------------------------*/
  469.     /* Local Variables                                                */
  470.     /*----------------------------------------------------------------*/
  471.     /*----------------------------------------------------------------*/
  472.     /* Code Body                                                      */
  473.     /*----------------------------------------------------------------*/
  474.     gui_associate_tab_pane_type_data(&MMI_tab_control, &MMI_tab_icon_data);
  475.     MMI_tab_icon_data.highlight_image = get_image(TAB_PANE_ICON_HIGHLIGHT);
  476.     MMI_tab_icon_data.un_highlight_image = get_image(TAB_PANE_ICON_UN_HIGHLIGHT);
  477. }
  478. /*****************************************************************************
  479.  * FUNCTION
  480.  *  set_four_icon_tab_pane
  481.  * DESCRIPTION
  482.  *  sets four icon tab pane
  483.  * PARAMETERS
  484.  *  void
  485.  *  a(?)        [IN/OUT]        
  486.  *  b(?)        [IN]            
  487.  * RETURNS
  488.  *  void
  489.  *****************************************************************************/
  490. void set_four_icon_tab_pane(void)
  491. {
  492.     /*----------------------------------------------------------------*/
  493.     /* Local Variables                                                */
  494.     /*----------------------------------------------------------------*/
  495.     /*----------------------------------------------------------------*/
  496.     /* Code Body                                                      */
  497.     /*----------------------------------------------------------------*/
  498.     gui_register_set_tab_pane_callback(
  499.         &MMI_tab_control,
  500.         MMI_tab_pane_callback,
  501.         MMI_set_tab_pane_data_callback,
  502.         MMI_reset_tab_pane_data_callback);
  503.     if (MMI_set_tab_pane_data_callback)
  504.     {
  505.         (*MMI_set_tab_pane_data_callback) ();
  506.     }
  507.     (*MMI_tab_pane_callback) ();
  508.     set_four_icon_pane_theme_data();
  509. }
  510. /*
  511.  * void set_four_icontext_pane_theme_data(void)
  512.  * {
  513.  * gui_associate_tab_pane_type_data(&MMI_tab_control,
  514.  * &MMI_tab_text_data);
  515.  * }
  516.  * 
  517.  * 
  518.  * void set_four_icontext_tab_pane(void)
  519.  * {
  520.  * gui_register_set_tab_pane_callback(&MMI_tab_control, MMI_tab_pane_callback,
  521.  * MMI_set_tab_pane_data_callback,
  522.  * MMI_reset_tab_pane_data_callback);
  523.  * (*MMI_set_tab_pane_data_callback)();
  524.  * (*MMI_tab_pane_callback)();
  525.  * set_four_icon_pane_theme_data();
  526.  * }
  527.  */
  528. /*****************************************************************************
  529.  * FUNCTION
  530.  *  set_three_icon_pane_theme_data
  531.  * DESCRIPTION
  532.  *  sets theme data three icon tab pane
  533.  * PARAMETERS
  534.  *  void
  535.  *  a(?)        [IN/OUT]        
  536.  *  b(?)        [IN]            
  537.  * RETURNS
  538.  *  void
  539.  *****************************************************************************/
  540. void set_three_icon_pane_theme_data(void)
  541. {
  542.     /*----------------------------------------------------------------*/
  543.     /* Local Variables                                                */
  544.     /*----------------------------------------------------------------*/
  545.     /*----------------------------------------------------------------*/
  546.     /* Code Body                                                      */
  547.     /*----------------------------------------------------------------*/
  548.     gui_associate_tab_pane_type_data(&MMI_tab_control, &MMI_tab_icon_data);
  549.     MMI_tab_icon_data.highlight_image = get_image(TAB_PANE_ICON_HIGHLIGHT);
  550.     MMI_tab_icon_data.un_highlight_image = get_image(TAB_PANE_ICON_UN_HIGHLIGHT);
  551. }
  552. /*****************************************************************************
  553.  * FUNCTION
  554.  *  set_three_icon_tab_pane
  555.  * DESCRIPTION
  556.  *  sets three icon tab pane
  557.  * PARAMETERS
  558.  *  void
  559.  *  a(?)        [IN/OUT]        
  560.  *  b(?)        [IN]            
  561.  * RETURNS
  562.  *  void
  563.  *****************************************************************************/
  564. void set_three_icon_tab_pane(void)
  565. {
  566.     /*----------------------------------------------------------------*/
  567.     /* Local Variables                                                */
  568.     /*----------------------------------------------------------------*/
  569.     /*----------------------------------------------------------------*/
  570.     /* Code Body                                                      */
  571.     /*----------------------------------------------------------------*/
  572.     gui_register_set_tab_pane_callback(
  573.         &MMI_tab_control,
  574.         MMI_tab_pane_callback,
  575.         MMI_set_tab_pane_data_callback,
  576.         MMI_reset_tab_pane_data_callback);
  577.     if (MMI_set_tab_pane_data_callback)
  578.     {
  579.         (*MMI_set_tab_pane_data_callback) ();
  580.     }
  581.     (*MMI_tab_pane_callback) ();
  582.     set_three_icon_pane_theme_data();
  583. }
  584. /*****************************************************************************
  585.  * FUNCTION
  586.  *  set_one_icon_pane_theme_data
  587.  * DESCRIPTION
  588.  *  sets theme data one icon tab pane
  589.  * PARAMETERS
  590.  *  void
  591.  *  a(?)        [IN/OUT]        
  592.  *  b(?)        [IN]            
  593.  * RETURNS
  594.  *  void
  595.  *****************************************************************************/
  596. void set_one_icon_pane_theme_data(void)
  597. {
  598.     /*----------------------------------------------------------------*/
  599.     /* Local Variables                                                */
  600.     /*----------------------------------------------------------------*/
  601.     /*----------------------------------------------------------------*/
  602.     /* Code Body                                                      */
  603.     /*----------------------------------------------------------------*/
  604.     gui_associate_tab_pane_type_data(&MMI_tab_control, &MMI_tab_icon_data);
  605.     MMI_tab_icon_data.highlight_image = get_image(TAB_PANE_ICON_HIGHLIGHT);
  606.     MMI_tab_icon_data.un_highlight_image = get_image(TAB_PANE_ICON_UN_HIGHLIGHT);
  607. }
  608. /*****************************************************************************
  609.  * FUNCTION
  610.  *  set_one_icon_tab_pane
  611.  * DESCRIPTION
  612.  *  sets one icon tab pane
  613.  * PARAMETERS
  614.  *  void
  615.  *  a(?)        [IN/OUT]        
  616.  *  b(?)        [IN]            
  617.  * RETURNS
  618.  *  void
  619.  *****************************************************************************/
  620. void set_one_icon_tab_pane(void)
  621. {
  622.     /*----------------------------------------------------------------*/
  623.     /* Local Variables                                                */
  624.     /*----------------------------------------------------------------*/
  625.     /*----------------------------------------------------------------*/
  626.     /* Code Body                                                      */
  627.     /*----------------------------------------------------------------*/
  628.     gui_register_set_tab_pane_callback(
  629.         &MMI_tab_control,
  630.         MMI_tab_pane_callback,
  631.         MMI_set_tab_pane_data_callback,
  632.         MMI_reset_tab_pane_data_callback);
  633.     if (MMI_set_tab_pane_data_callback)
  634.     {
  635.         (*MMI_set_tab_pane_data_callback) ();
  636.     }
  637.     (*MMI_tab_pane_callback) ();
  638.     set_one_icon_pane_theme_data();
  639. }
  640. /*****************************************************************************
  641.  * FUNCTION
  642.  *  register_set_tab_pane_callback
  643.  * DESCRIPTION
  644.  *  register call backs for tab pane
  645.  * PARAMETERS
  646.  *  callback                [IN]            
  647.  *  set_data_callback       [IN]            
  648.  *  reset_data_callback     [IN]            
  649.  *  a(?)                    [IN/OUT]        
  650.  *  b(?)                    [IN]            
  651.  * RETURNS
  652.  *  void
  653.  *****************************************************************************/
  654. void register_set_tab_pane_callback(
  655.         void (*callback) (void),
  656.         void (*set_data_callback) (void),
  657.         void (*reset_data_callback) (void))
  658. {
  659.     /*----------------------------------------------------------------*/
  660.     /* Local Variables                                                */
  661.     /*----------------------------------------------------------------*/
  662.     /*----------------------------------------------------------------*/
  663.     /* Code Body                                                      */
  664.     /*----------------------------------------------------------------*/
  665.     MMI_tab_pane_callback = callback;
  666.     MMI_set_tab_pane_data_callback = set_data_callback;
  667.     MMI_reset_tab_pane_data_callback = reset_data_callback;
  668. }
  669. /*****************************************************************************
  670.  * FUNCTION
  671.  *  set_tab_pane
  672.  * DESCRIPTION
  673.  *  set function for tab pane
  674.  * PARAMETERS
  675.  *  number_of_items     [IN]            
  676.  *  list_of_items       [?]             
  677.  *  list_of_icons       [?]             
  678.  *  default_item        [IN]            
  679.  *  a(?)                [IN/OUT]        
  680.  *  b(?)                [IN]            
  681.  * RETURNS
  682.  *  void
  683.  *****************************************************************************/
  684. void set_tab_pane(S32 number_of_items, U16 *list_of_items, U16 *list_of_icons, S32 default_item)
  685. {
  686.     /*----------------------------------------------------------------*/
  687.     /* Local Variables                                                */
  688.     /*----------------------------------------------------------------*/
  689.     S32 i;
  690.     /*----------------------------------------------------------------*/
  691.     /* Code Body                                                      */
  692.     /*----------------------------------------------------------------*/
  693.     gui_associate_tab_pane_item_data(&MMI_tab_control, (struct_tab_items*) & MMI_tab_items);
  694.     for (i = 0; i < number_of_items; i++)
  695.     {
  696.         add_item_tab_pane(get_string(list_of_items[i]), get_image(list_of_icons[i]));
  697.     }
  698.     goto_tab_pane_item(default_item);
  699.     save_current_parent_id();
  700. }
  701. /*****************************************************************************
  702.  * FUNCTION
  703.  *  add_item_tab_pane
  704.  * DESCRIPTION
  705.  *  add item to tab pane
  706.  * PARAMETERS
  707.  *  text        [IN]            
  708.  *  icon        [IN]            
  709.  *  a(?)        [IN/OUT]        
  710.  *  b(?)        [IN]            
  711.  * RETURNS
  712.  *  void
  713.  *****************************************************************************/
  714. void add_item_tab_pane(UI_string_type text, PU8 icon)
  715. {
  716.     /*----------------------------------------------------------------*/
  717.     /* Local Variables                                                */
  718.     /*----------------------------------------------------------------*/
  719.     /*----------------------------------------------------------------*/
  720.     /* Code Body                                                      */
  721.     /*----------------------------------------------------------------*/
  722.     if (MMI_tab_control.n_items == MAX_TAB_ITEMS)
  723.     {
  724.         return;
  725.     }
  726.     gui_add_item_tab_pane(&MMI_tab_control, text, icon);
  727. }
  728. /*****************************************************************************
  729.  * FUNCTION
  730.  *  goto_tab_pane_item
  731.  * DESCRIPTION
  732.  *  go to a item in tab pane
  733.  * PARAMETERS
  734.  *  index       [IN]            
  735.  *  a(?)        [IN/OUT]        
  736.  *  b(?)        [IN]            
  737.  * RETURNS
  738.  *  void
  739.  *****************************************************************************/
  740. void goto_tab_pane_item(S32 index)
  741. {
  742.     /*----------------------------------------------------------------*/
  743.     /* Local Variables                                                */
  744.     /*----------------------------------------------------------------*/
  745.     /*----------------------------------------------------------------*/
  746.     /* Code Body                                                      */
  747.     /*----------------------------------------------------------------*/
  748.     gui_go_to_item(&MMI_tab_control, index);
  749. }
  750. /*****************************************************************************
  751.  * FUNCTION
  752.  *  tab_pane_goto_previous_item
  753.  * DESCRIPTION
  754.  *  go to a previous item in tab pane
  755.  * PARAMETERS
  756.  *  void
  757.  *  a(?)        [IN/OUT]        
  758.  *  b(?)        [IN]            
  759.  * RETURNS
  760.  *  void
  761.  *****************************************************************************/
  762. void tab_pane_goto_previous_item(void)
  763. {
  764.     /*----------------------------------------------------------------*/
  765.     /* Local Variables                                                */
  766.     /*----------------------------------------------------------------*/
  767.     /*----------------------------------------------------------------*/
  768.     /* Code Body                                                      */
  769.     /*----------------------------------------------------------------*/
  770.     if (MMI_tab_control.highlighted_item == 0 && !(MMI_tab_control.flags & UI_TAB_CONTROL_CYCLIC))
  771.     {
  772.         return;
  773.     }
  774.     set_list_history = 1;
  775.     if (enable_function_execution)
  776.     {
  777.         enable_tab_pane_display();
  778.         /* MMI_tab_control.highlighted_item--;
  779.            goto_tab_pane_item(MMI_tab_control.highlighted_item); */
  780.         allow_history_saving = 0;
  781.         gui_tab_pane_prev_item(&MMI_tab_control);
  782.         disable_history_saving();
  783.         SetParentHandler((S16) MMI_tab_control.parent_id);
  784.         tab_pane_goto_current_highlighted_item();
  785.         enable_history_saving();
  786.         register_tab_pane_keys();
  787.         disable_tab_pane_display();
  788.     }
  789.     else
  790.     {
  791.         gui_tab_pane_prev_item(&MMI_tab_control);
  792.         tab_pane_goto_current_highlighted_item();
  793.         register_tab_pane_keys();
  794.     #if(UI_DOUBLE_BUFFER_SUPPORT)
  795.         gui_lock_double_buffer();
  796.     #endif 
  797.         show_tab_pane();
  798.     #if(UI_DOUBLE_BUFFER_SUPPORT)
  799.         gui_unlock_double_buffer();
  800.         gui_BLT_double_buffer(
  801.             MMI_tab_control.x,
  802.             MMI_tab_control.y,
  803.             MMI_tab_control.x + MMI_tab_control.width - 1,
  804.             MMI_tab_control.y + MMI_tab_control.height - 1);
  805.     #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
  806.     }
  807.     set_list_history = 0;
  808. }
  809. /*****************************************************************************
  810.  * FUNCTION
  811.  *  tab_pane_goto_next_item
  812.  * DESCRIPTION
  813.  *  go to a next item in tab pane
  814.  * PARAMETERS
  815.  *  void
  816.  *  a(?)        [IN/OUT]        
  817.  *  b(?)        [IN]            
  818.  * RETURNS
  819.  *  void
  820.  *****************************************************************************/
  821. void tab_pane_goto_next_item(void)
  822. {
  823.     /*----------------------------------------------------------------*/
  824.     /* Local Variables                                                */
  825.     /*----------------------------------------------------------------*/
  826.     /*----------------------------------------------------------------*/
  827.     /* Code Body                                                      */
  828.     /*----------------------------------------------------------------*/
  829.     if (MMI_tab_control.highlighted_item == MMI_tab_control.n_items - 1 &&
  830.         !(MMI_tab_control.flags & UI_TAB_CONTROL_CYCLIC))
  831.     {
  832.         return;
  833.     }
  834.     set_list_history = 1;
  835.     if (enable_function_execution)
  836.     {
  837.         enable_tab_pane_display();
  838.         /* MMI_tab_control.highlighted_item++;
  839.            goto_tab_pane_item(MMI_tab_control.highlighted_item); */
  840.         allow_history_saving = 0;
  841.         gui_tab_pane_next_item(&MMI_tab_control);
  842.         disable_history_saving();
  843.         SetParentHandler((S16) MMI_tab_control.parent_id);
  844.         tab_pane_goto_current_highlighted_item();
  845.         enable_history_saving();
  846.         register_tab_pane_keys();
  847.         disable_tab_pane_display();
  848.     }
  849.     else
  850.     {
  851.         gui_tab_pane_next_item(&MMI_tab_control);
  852.         tab_pane_goto_current_highlighted_item();
  853.         register_tab_pane_keys();
  854.     #if(UI_DOUBLE_BUFFER_SUPPORT)
  855.         gui_lock_double_buffer();
  856.     #endif 
  857.         show_tab_pane();
  858.     #if(UI_DOUBLE_BUFFER_SUPPORT)
  859.         gui_unlock_double_buffer();
  860.         gui_BLT_double_buffer(
  861.             MMI_tab_control.x,
  862.             MMI_tab_control.y,
  863.             MMI_tab_control.x + MMI_tab_control.width - 1,
  864.             MMI_tab_control.y + MMI_tab_control.height - 1);
  865.     #endif /* (UI_DOUBLE_BUFFER_SUPPORT) */ 
  866.     }
  867.     set_list_history = 0;
  868. }
  869. /*****************************************************************************
  870.  * FUNCTION
  871.  *  tab_pane_goto_current_highlighted_item
  872.  * DESCRIPTION
  873.  *  go to a curent hightlighted item in tab pane
  874.  * PARAMETERS
  875.  *  void
  876.  *  a(?)        [IN/OUT]        
  877.  *  b(?)        [IN]            
  878.  * RETURNS
  879.  *  void
  880.  *****************************************************************************/
  881. void tab_pane_goto_current_highlighted_item(void)
  882. {
  883.     /*----------------------------------------------------------------*/
  884.     /* Local Variables                                                */
  885.     /*----------------------------------------------------------------*/
  886.     /*----------------------------------------------------------------*/
  887.     /* Code Body                                                      */
  888.     /*----------------------------------------------------------------*/
  889.     /* PMT VIKAS START 20051209 */
  890. #if(TITLE_TRANSITION_STYLE_NON_BLOCKING)
  891. #ifdef TITLE_TRANSITION_WITH_PREVIOUS_TITLE_MOVEMENT
  892.     set_prev_menu_shortcut(MMI_menu_shortcut_number);
  893. #else 
  894.     set_previous_title_shortcut(MMI_menu_shortcut_number);
  895. #endif 
  896. #endif /* (TITLE_TRANSITION_STYLE_NON_BLOCKING) */ 
  897.     /* PMT VIKAS END 20051209 */
  898.     if (enable_function_execution)
  899.     {
  900.         gdi_layer_lock_frame_buffer();
  901.         tab_pane_hightlight_function(MMI_tab_control.highlighted_item);
  902.         gdi_layer_unlock_frame_buffer();
  903.         SetCurrExitFuncPtr(backup_exit_func_ptr);
  904.         if (backup_category_func_ptr)
  905.         {
  906.             GetCategoryHistory = backup_category_func_ptr;
  907.         }
  908.         execute_left_softkey_function(KEY_EVENT_UP);
  909.         backup_current_entry_function();
  910.         backup_current_category_function();
  911.     }
  912.     else
  913.     {
  914.         tab_pane_hightlight_function(MMI_tab_control.highlighted_item);
  915.     }
  916. }
  917. /*****************************************************************************
  918.  * FUNCTION
  919.  *  set_tab_pane_hightlight_function
  920.  * DESCRIPTION
  921.  *  sets tab pane hightlight function
  922.  * PARAMETERS
  923.  *  f           [IN]            
  924.  *  a(?)        [IN/OUT]        
  925.  *  b(?)        [IN]            
  926.  * RETURNS
  927.  *  void
  928.  *****************************************************************************/
  929. void set_tab_pane_hightlight_function(void (*f) (S32 item_index))
  930. {
  931.     /*----------------------------------------------------------------*/
  932.     /* Local Variables                                                */
  933.     /*----------------------------------------------------------------*/
  934.     /*----------------------------------------------------------------*/
  935.     /* Code Body                                                      */
  936.     /*----------------------------------------------------------------*/
  937.     gui_set_tab_pane_hightlight_fucntion(&MMI_tab_control, f);
  938. }
  939. /*****************************************************************************
  940.  * FUNCTION
  941.  *  tab_pane_hightlight_function
  942.  * DESCRIPTION
  943.  *  highligth function for tab pane
  944.  * PARAMETERS
  945.  *  index       [IN]            
  946.  *  a(?)        [IN/OUT]        
  947.  *  b(?)        [IN]            
  948.  * RETURNS
  949.  *  void
  950.  *****************************************************************************/
  951. void tab_pane_hightlight_function(S32 index)
  952. {
  953.     /*----------------------------------------------------------------*/
  954.     /* Local Variables                                                */
  955.     /*----------------------------------------------------------------*/
  956.     /*----------------------------------------------------------------*/
  957.     /* Code Body                                                      */
  958.     /*----------------------------------------------------------------*/
  959.     gui_highlight_function(&MMI_tab_control, index);
  960. }
  961. /*****************************************************************************
  962.  * FUNCTION
  963.  *  disable_tab_pane_keys
  964.  * DESCRIPTION
  965.  *  disable tab pane keys registeration. this is required when entry gunction is not directly called
  966.  * PARAMETERS
  967.  *  void
  968.  *  a(?)        [IN/OUT]        
  969.  *  b(?)        [IN]            
  970.  * RETURNS
  971.  *  void
  972.  *****************************************************************************/
  973. void disable_tab_pane_keys(void)
  974. {
  975.     /*----------------------------------------------------------------*/
  976.     /* Local Variables                                                */
  977.     /*----------------------------------------------------------------*/
  978.     /*----------------------------------------------------------------*/
  979.     /* Code Body                                                      */
  980.     /*----------------------------------------------------------------*/
  981.     disable_tab_pane_register = 1;
  982. }
  983. #ifdef __MMI_TOUCH_SCREEN__
  984. /*****************************************************************************
  985.  * FUNCTION
  986.  * tab_pane_pen_down_hdlr
  987.  * DESCRIPTION
  988.  *  Pen down event handler for tab pane
  989.  * PARAMETERS
  990.  *  pos     [IN]
  991.  * RETURNS
  992.  *  
  993.  *****************************************************************************/
  994. MMI_BOOL tab_pane_pen_down_hdlr(mmi_pen_point_struct pos)
  995. {
  996.     /*----------------------------------------------------------------*/
  997.     /* Local Variables                                                */
  998.     /*----------------------------------------------------------------*/
  999.     S32 highlight_item;
  1000.     MMI_BOOL ret;    
  1001.     gui_tab_pane_event tab_pane_event;
  1002.     /*----------------------------------------------------------------*/
  1003.     /* Code Body                                                      */
  1004.     /*----------------------------------------------------------------*/
  1005.     ret = gui_tab_pane_translate_pen_event(
  1006.             &MMI_tab_control, 
  1007.             MMI_PEN_EVENT_DOWN, 
  1008.             pos.x, 
  1009.             pos.y, 
  1010.             &tab_pane_event, 
  1011.             &highlight_item);
  1012.     return ret;
  1013. }
  1014. /*****************************************************************************
  1015.  * FUNCTION
  1016.  * tab_pane_pen_up_hdlr
  1017.  * DESCRIPTION
  1018.  *   pen up event handler for tab pane
  1019.  * PARAMETERS
  1020.  *  pos     [IN]
  1021.  * RETURNS
  1022.  *  
  1023.  *****************************************************************************/
  1024. MMI_BOOL tab_pane_pen_up_hdlr(mmi_pen_point_struct pos)
  1025. {
  1026.     /*----------------------------------------------------------------*/
  1027.     /* Local Variables                                                */
  1028.     /*----------------------------------------------------------------*/
  1029.     S32 highlight_item;
  1030.     gui_tab_pane_event tab_pane_event;
  1031.     /*----------------------------------------------------------------*/
  1032.     /* Code Body                                                      */
  1033.     /*----------------------------------------------------------------*/
  1034.     gui_tab_pane_translate_pen_event(
  1035.         &MMI_tab_control, 
  1036.         MMI_PEN_EVENT_UP, 
  1037.         pos.x, 
  1038.         pos.y, 
  1039.         &tab_pane_event, 
  1040.         &highlight_item);
  1041.     switch (tab_pane_event)
  1042.     {
  1043.         case GUI_TAB_PEN_ASYNC_PANE_SELECT:
  1044.             if (MMI_tab_control.highlighted_item != highlight_item)
  1045.             {
  1046.                 set_list_history=1;
  1047.                 MMI_tab_control.goto_function(&MMI_tab_control, highlight_item);
  1048.                 enable_tab_pane_display();
  1049.                 allow_history_saving=0;
  1050.                 disable_history_saving();
  1051.                 SetParentHandler((s16)MMI_tab_control.parent_id);
  1052.                 tab_pane_goto_current_highlighted_item();
  1053.                 enable_history_saving();
  1054.                 register_tab_pane_keys();
  1055.                 disable_tab_pane_display();
  1056.                 set_list_history=0;
  1057.             }
  1058.             break;
  1059.         default:
  1060.             break;
  1061.     }
  1062.     return MMI_TRUE;
  1063. }
  1064. #endif /* __MMI_TOUCH_SCREEN__ */
  1065. /*****************************************************************************
  1066.  * FUNCTION
  1067.  *  register_tab_pane_keys
  1068.  * DESCRIPTION
  1069.  *  registers tab pane keys
  1070.  * PARAMETERS
  1071.  *  void
  1072.  *  a(?)        [IN/OUT]        
  1073.  *  b(?)        [IN]            
  1074.  * RETURNS
  1075.  *  void
  1076.  *****************************************************************************/
  1077. void register_tab_pane_keys(void)
  1078. {
  1079.     /*----------------------------------------------------------------*/
  1080.     /* Local Variables                                                */
  1081.     /*----------------------------------------------------------------*/
  1082.     /*----------------------------------------------------------------*/
  1083.     /* Code Body                                                      */
  1084.     /*----------------------------------------------------------------*/
  1085.     if (!disable_tab_pane_register)
  1086.     {
  1087.         SetKeyHandler(tab_pane_goto_previous_item, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1088.         SetKeyHandler(tab_pane_goto_next_item, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1089.         SetKeyHandler(NULL, KEY_LEFT_ARROW, KEY_EVENT_UP);
  1090.         SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1091.     }
  1092.     disable_tab_pane_register = 0;
  1093. #ifdef __MMI_TOUCH_SCREEN__
  1094.     wgui_register_category_screen_control_area_pen_handlers(tab_pane_pen_down_hdlr, MMI_PEN_EVENT_DOWN);
  1095.     wgui_register_category_screen_control_area_pen_handlers(tab_pane_pen_up_hdlr, MMI_PEN_EVENT_UP);
  1096. #endif
  1097. }
  1098. /*****************************************************************************
  1099.  * FUNCTION
  1100.  *  register_tab_pane_hilite_handler
  1101.  * DESCRIPTION
  1102.  *  registers tab pane highlight handler
  1103.  * PARAMETERS
  1104.  *  f           [IN]            
  1105.  *  a(?)        [IN/OUT]        
  1106.  *  b(?)        [IN]            
  1107.  * RETURNS
  1108.  *  void
  1109.  *****************************************************************************/
  1110. void register_tab_pane_hilite_handler(void (*f) (S32 item_index))
  1111. {
  1112.     /*----------------------------------------------------------------*/
  1113.     /* Local Variables                                                */
  1114.     /*----------------------------------------------------------------*/
  1115.     /*----------------------------------------------------------------*/
  1116.     /* Code Body                                                      */
  1117.     /*----------------------------------------------------------------*/
  1118.     MMI_tab_highlight_handler = f;
  1119. }
  1120. /*****************************************************************************
  1121.  * FUNCTION
  1122.  *  standard_tab_pane_highlight_function
  1123.  * DESCRIPTION
  1124.  *  standard tab pane highlight handler
  1125.  * PARAMETERS
  1126.  *  index       [IN]            
  1127.  *  a(?)        [IN/OUT]        
  1128.  *  b(?)        [IN]            
  1129.  * RETURNS
  1130.  *  void
  1131.  *****************************************************************************/
  1132. void standard_tab_pane_highlight_function(S32 index)
  1133. {
  1134.     /*----------------------------------------------------------------*/
  1135.     /* Local Variables                                                */
  1136.     /*----------------------------------------------------------------*/
  1137.     /*----------------------------------------------------------------*/
  1138.     /* Code Body                                                      */
  1139.     /*----------------------------------------------------------------*/
  1140.     MMI_tab_highlight_handler(index);
  1141. }
  1142. /*****************************************************************************
  1143.  * FUNCTION
  1144.  *  enable_tab_pane_display
  1145.  * DESCRIPTION
  1146.  *  enables tab pane display
  1147.  * PARAMETERS
  1148.  *  void
  1149.  *  a(?)        [IN/OUT]        
  1150.  *  b(?)        [IN]            
  1151.  * RETURNS
  1152.  *  void
  1153.  *****************************************************************************/
  1154. void enable_tab_pane_display(void)
  1155. {
  1156.     /*----------------------------------------------------------------*/
  1157.     /* Local Variables                                                */
  1158.     /*----------------------------------------------------------------*/
  1159.     /*----------------------------------------------------------------*/
  1160.     /* Code Body                                                      */
  1161.     /*----------------------------------------------------------------*/
  1162.     MMI_enable_tab_pane_display = 1;
  1163. }
  1164. /*****************************************************************************
  1165.  * FUNCTION
  1166.  *  disable_tab_pane_display
  1167.  * DESCRIPTION
  1168.  *  disables tab pane display
  1169.  * PARAMETERS
  1170.  *  void
  1171.  *  a(?)        [IN/OUT]        
  1172.  *  b(?)        [IN]            
  1173.  * RETURNS
  1174.  *  void
  1175.  *****************************************************************************/
  1176. void disable_tab_pane_display(void)
  1177. {
  1178.     /*----------------------------------------------------------------*/
  1179.     /* Local Variables                                                */
  1180.     /*----------------------------------------------------------------*/
  1181.     /*----------------------------------------------------------------*/
  1182.     /* Code Body                                                      */
  1183.     /*----------------------------------------------------------------*/
  1184.     MMI_enable_tab_pane_display = 0;
  1185. }
  1186. /*****************************************************************************
  1187.  * FUNCTION
  1188.  *  is_enabled_tab_pane
  1189.  * DESCRIPTION
  1190.  *  used to check whether tab pane is enabled or not
  1191.  * PARAMETERS
  1192.  *  void
  1193.  *  a(?)        [IN/OUT]        
  1194.  *  b(?)        [IN]            
  1195.  * RETURNS
  1196.  *  
  1197.  *****************************************************************************/
  1198. S32 is_enabled_tab_pane(void)
  1199. {
  1200.     /*----------------------------------------------------------------*/
  1201.     /* Local Variables                                                */
  1202.     /*----------------------------------------------------------------*/
  1203.     /*----------------------------------------------------------------*/
  1204.     /* Code Body                                                      */
  1205.     /*----------------------------------------------------------------*/
  1206.     return MMI_enable_tab_pane_display;
  1207. }
  1208. /*****************************************************************************
  1209.  * FUNCTION
  1210.  *  show_tab_pane
  1211.  * DESCRIPTION
  1212.  *  shows tab pane
  1213.  * PARAMETERS
  1214.  *  void
  1215.  *  a(?)        [IN/OUT]        
  1216.  *  b(?)        [IN]            
  1217.  * RETURNS
  1218.  *  void
  1219.  *****************************************************************************/
  1220. void show_tab_pane(void)
  1221. {
  1222.     /*----------------------------------------------------------------*/
  1223.     /* Local Variables                                                */
  1224.     /*----------------------------------------------------------------*/
  1225.     /*----------------------------------------------------------------*/
  1226.     /* Code Body                                                      */
  1227.     /*----------------------------------------------------------------*/
  1228.     gui_show_tab_pane(&MMI_tab_control);
  1229. }
  1230. /*****************************************************************************
  1231.  * FUNCTION
  1232.  *  save_current_parent_id
  1233.  * DESCRIPTION
  1234.  *  saves cureent parent id
  1235.  * PARAMETERS
  1236.  *  void
  1237.  *  a(?)        [IN/OUT]        
  1238.  *  b(?)        [IN]            
  1239.  * RETURNS
  1240.  *  void
  1241.  *****************************************************************************/
  1242. void save_current_parent_id(void)
  1243. {
  1244.     /*----------------------------------------------------------------*/
  1245.     /* Local Variables                                                */
  1246.     /*----------------------------------------------------------------*/
  1247.     /*----------------------------------------------------------------*/
  1248.     /* Code Body                                                      */
  1249.     /*----------------------------------------------------------------*/
  1250.     gui_save_parent_id(&MMI_tab_control, GetParentHandler());
  1251. }
  1252. extern U8 *(*GetCategoryHistory) (U8 *buffer);
  1253. /*****************************************************************************
  1254.  * FUNCTION
  1255.  *  backup_current_category_function
  1256.  * DESCRIPTION
  1257.  *  backups current category history fucntion
  1258.  * PARAMETERS
  1259.  *  void
  1260.  *  a(?)        [IN/OUT]        
  1261.  *  b(?)        [IN]            
  1262.  * RETURNS
  1263.  *  void
  1264.  *****************************************************************************/
  1265. void backup_current_category_function(void)
  1266. {
  1267.     /*----------------------------------------------------------------*/
  1268.     /* Local Variables                                                */
  1269.     /*----------------------------------------------------------------*/
  1270.     /*----------------------------------------------------------------*/
  1271.     /* Code Body                                                      */
  1272.     /*----------------------------------------------------------------*/
  1273.     backup_category_func_ptr = GetCategoryHistory;
  1274.     GetCategoryHistory = get_tab_pane_and_parent_category_history;
  1275. }
  1276. /*****************************************************************************
  1277.  * FUNCTION
  1278.  *  tab_set_from_history
  1279.  * DESCRIPTION
  1280.  *  entry function if tab pane is enabled on some screen
  1281.  * PARAMETERS
  1282.  *  void
  1283.  *  a(?)        [IN/OUT]        
  1284.  *  b(?)        [IN]            
  1285.  * RETURNS
  1286.  *  void
  1287.  *****************************************************************************/
  1288. void tab_set_from_history(void)
  1289. {
  1290.     /*----------------------------------------------------------------*/
  1291.     /* Local Variables                                                */
  1292.     /*----------------------------------------------------------------*/
  1293.     /* PMT NEERAJ START 20050616 */
  1294. #ifdef __MMI_UI_TITLE_TRANSITION__
  1295.     S32 title_trans;
  1296. #endif 
  1297.     /*----------------------------------------------------------------*/
  1298.     /* Code Body                                                      */
  1299.     /*----------------------------------------------------------------*/
  1300.     /* PMT NEERAJ END 20050616 */
  1301.     set_list_history = 1;
  1302.     enable_tab_pane_display();
  1303.     process_history_buffer();
  1304.     if (MMI_tab_control.category_entry_callback)
  1305.     {
  1306.         MMI_tab_control.category_entry_callback();
  1307.     }
  1308.     SetParentHandler((S16) MMI_tab_control.parent_id);
  1309.     /* PMT NEERAJ START 20050616 */
  1310. #ifdef __MMI_UI_TITLE_TRANSITION__
  1311.     title_trans = get_title_transition();
  1312.     if (title_trans)
  1313.     {
  1314.         reset_title_transition();
  1315.     }
  1316. #endif /* __MMI_UI_TITLE_TRANSITION__ */ 
  1317.     /* PMT NEERAJ END 20050616 */
  1318.     if (enable_function_execution)
  1319.     {
  1320.         disable_history_saving();
  1321.         gdi_layer_lock_frame_buffer();
  1322.         tab_pane_hightlight_function(MMI_tab_control.highlighted_item);
  1323.         gdi_layer_unlock_frame_buffer();
  1324.         execute_left_softkey_function(KEY_EVENT_UP);
  1325.         backup_current_entry_function();
  1326.         backup_current_category_function();
  1327.         enable_history_saving();
  1328.     }
  1329.     register_tab_pane_keys();
  1330.     disable_tab_pane_display();
  1331.     /* PMT NEERAJ START 20050616 */
  1332. #ifdef __MMI_UI_TITLE_TRANSITION__
  1333.     if (title_trans)
  1334.     {
  1335.         set_title_transition(title_trans);
  1336.     }
  1337. #endif /* __MMI_UI_TITLE_TRANSITION__ */ 
  1338.     /* PMT NEERAJ END 20050616 */
  1339.     set_list_history = 0;
  1340. }
  1341. /*****************************************************************************
  1342.  * FUNCTION
  1343.  *  tab_exit_function
  1344.  * DESCRIPTION
  1345.  *  exit function if tab pane is enabled on some screen
  1346.  * PARAMETERS
  1347.  *  void
  1348.  *  a(?)        [IN/OUT]        
  1349.  *  b(?)        [IN]            
  1350.  * RETURNS
  1351.  *  void
  1352.  *****************************************************************************/
  1353. void tab_exit_function(void)
  1354. {
  1355.     /*----------------------------------------------------------------*/
  1356.     /* Local Variables                                                */
  1357.     /*----------------------------------------------------------------*/
  1358.     /*----------------------------------------------------------------*/
  1359.     /* Code Body                                                      */
  1360.     /*----------------------------------------------------------------*/
  1361.     if (MMI_tab_control.reset_data_callback)
  1362.     {
  1363.         MMI_tab_control.reset_data_callback();
  1364.     }
  1365.     if (backup_exit_func_ptr)
  1366.     {
  1367.         backup_exit_func_ptr();
  1368.     }
  1369.     if (MMI_tab_control.category_exit_callback)
  1370.     {
  1371.         MMI_tab_control.category_exit_callback();
  1372.     }
  1373.     backup_exit_func_ptr = NULL;
  1374.     allow_history_saving = 1;
  1375.     SetKeyHandler(NULL, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1376.     SetKeyHandler(NULL, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1377. }
  1378. /*****************************************************************************
  1379.  * FUNCTION
  1380.  *  backup_current_exit_function
  1381.  * DESCRIPTION
  1382.  *  backups current exit function
  1383.  * PARAMETERS
  1384.  *  void
  1385.  *  a(?)        [IN/OUT]        
  1386.  *  b(?)        [IN]            
  1387.  * RETURNS
  1388.  *  void
  1389.  *****************************************************************************/
  1390. void backup_current_exit_function(void)
  1391. {
  1392.     /*----------------------------------------------------------------*/
  1393.     /* Local Variables                                                */
  1394.     /*----------------------------------------------------------------*/
  1395.     /*----------------------------------------------------------------*/
  1396.     /* Code Body                                                      */
  1397.     /*----------------------------------------------------------------*/
  1398.     backup_exit_func_ptr = GetCurrExitFuncPtr();
  1399.     SetCurrExitFuncPtr(tab_exit_function);
  1400. }
  1401. /*****************************************************************************
  1402.  * FUNCTION
  1403.  *  backup_current_entry_function
  1404.  * DESCRIPTION
  1405.  *  backups current entry function
  1406.  * PARAMETERS
  1407.  *  void
  1408.  *  a(?)        [IN/OUT]        
  1409.  *  b(?)        [IN]            
  1410.  * RETURNS
  1411.  *  void
  1412.  *****************************************************************************/
  1413. void backup_current_entry_function(void)
  1414. {
  1415.     /*----------------------------------------------------------------*/
  1416.     /* Local Variables                                                */
  1417.     /*----------------------------------------------------------------*/
  1418.     /*----------------------------------------------------------------*/
  1419.     /* Code Body                                                      */
  1420.     /*----------------------------------------------------------------*/
  1421.     backup_entry_func_ptr = GetCurrEntryFuncPtr();
  1422.     SetCurrEntryFuncPtr(tab_set_from_history);
  1423.     backup_current_exit_function();
  1424. }
  1425. /*****************************************************************************
  1426.  * FUNCTION
  1427.  *  create_and_setup_two_icon_tab_pane
  1428.  * DESCRIPTION
  1429.  *  creates abd setups two icon tab panae
  1430.  * PARAMETERS
  1431.  *  void
  1432.  *  a(?)        [IN/OUT]        
  1433.  *  b(?)        [IN]            
  1434.  * RETURNS
  1435.  *  void
  1436.  *****************************************************************************/
  1437. void create_and_setup_two_icon_tab_pane(void)
  1438. {
  1439.     /*----------------------------------------------------------------*/
  1440.     /* Local Variables                                                */
  1441.     /*----------------------------------------------------------------*/
  1442.     /*----------------------------------------------------------------*/
  1443.     /* Code Body                                                      */
  1444.     /*----------------------------------------------------------------*/
  1445.     create_two_icon_tab_pane();
  1446.     set_two_icon_tab_pane();
  1447.     set_tab_pane_hightlight_function(standard_tab_pane_highlight_function);
  1448. }
  1449. /*****************************************************************************
  1450.  * FUNCTION
  1451.  *  create_and_setup_two_text_tab_pane
  1452.  * DESCRIPTION
  1453.  *  creates abd setups two text tab panae
  1454.  * PARAMETERS
  1455.  *  void
  1456.  *  a(?)        [IN/OUT]        
  1457.  *  b(?)        [IN]            
  1458.  * RETURNS
  1459.  *  void
  1460.  *****************************************************************************/
  1461. void create_and_setup_two_text_tab_pane(void)
  1462. {
  1463.     /*----------------------------------------------------------------*/
  1464.     /* Local Variables                                                */
  1465.     /*----------------------------------------------------------------*/
  1466.     /*----------------------------------------------------------------*/
  1467.     /* Code Body                                                      */
  1468.     /*----------------------------------------------------------------*/
  1469.     create_two_text_tab_pane();
  1470.     set_two_text_tab_pane();
  1471.     set_tab_pane_hightlight_function(standard_tab_pane_highlight_function);
  1472. }
  1473. /*****************************************************************************
  1474.  * FUNCTION
  1475.  *  create_and_setup_four_icon_tab_pane
  1476.  * DESCRIPTION
  1477.  *  creates abd setups four icon tab panae
  1478.  * PARAMETERS
  1479.  *  void
  1480.  *  a(?)        [IN/OUT]        
  1481.  *  b(?)        [IN]            
  1482.  * RETURNS
  1483.  *  void
  1484.  *****************************************************************************/
  1485. void create_and_setup_four_icon_tab_pane(void)
  1486. {
  1487.     /*----------------------------------------------------------------*/
  1488.     /* Local Variables                                                */
  1489.     /*----------------------------------------------------------------*/
  1490.     /*----------------------------------------------------------------*/
  1491.     /* Code Body                                                      */
  1492.     /*----------------------------------------------------------------*/
  1493.     create_four_icon_tab_pane();
  1494.     set_four_icon_tab_pane();
  1495.     set_tab_pane_hightlight_function(standard_tab_pane_highlight_function);
  1496. }
  1497. /*****************************************************************************
  1498.  * FUNCTION
  1499.  *  create_and_setup_three_icon_tab_pane
  1500.  * DESCRIPTION
  1501.  *  creates and setups three icon tab panae
  1502.  * PARAMETERS
  1503.  *  void
  1504.  *  a(?)        [IN/OUT]        
  1505.  *  b(?)        [IN]            
  1506.  * RETURNS
  1507.  *  void
  1508.  *****************************************************************************/
  1509. void create_and_setup_three_icon_tab_pane(void)
  1510. {
  1511.     /*----------------------------------------------------------------*/
  1512.     /* Local Variables                                                */
  1513.     /*----------------------------------------------------------------*/
  1514.     /*----------------------------------------------------------------*/
  1515.     /* Code Body                                                      */
  1516.     /*----------------------------------------------------------------*/
  1517.     create_three_icon_tab_pane();
  1518.     set_three_icon_tab_pane();
  1519.     set_tab_pane_hightlight_function(standard_tab_pane_highlight_function);
  1520. }
  1521. /*****************************************************************************
  1522.  * FUNCTION
  1523.  *  create_and_setup_one_icon_tab_pane
  1524.  * DESCRIPTION
  1525.  *  creates and setups three icon tab panae
  1526.  * PARAMETERS
  1527.  *  void
  1528.  *  a(?)        [IN/OUT]        
  1529.  *  b(?)        [IN]            
  1530.  * RETURNS
  1531.  *  void
  1532.  *****************************************************************************/
  1533. void create_and_setup_one_icon_tab_pane(void)
  1534. {
  1535.     /*----------------------------------------------------------------*/
  1536.     /* Local Variables                                                */
  1537.     /*----------------------------------------------------------------*/
  1538.     /*----------------------------------------------------------------*/
  1539.     /* Code Body                                                      */
  1540.     /*----------------------------------------------------------------*/
  1541.     create_one_icon_tab_pane();
  1542.     set_one_icon_tab_pane();
  1543.     set_tab_pane_hightlight_function(standard_tab_pane_highlight_function);
  1544. }
  1545. /*****************************************************************************
  1546.  * FUNCTION
  1547.  *  process_history_buffer
  1548.  * DESCRIPTION
  1549.  *  process tab pane history when the tab pane needs to be displayed from hsitory
  1550.  * PARAMETERS
  1551.  *  void
  1552.  *  a(?)        [IN/OUT]        
  1553.  *  b(?)        [IN]            
  1554.  * RETURNS
  1555.  *  void
  1556.  *****************************************************************************/
  1557. void process_history_buffer(void)
  1558. {
  1559.     /*----------------------------------------------------------------*/
  1560.     /* Local Variables                                                */
  1561.     /*----------------------------------------------------------------*/
  1562.     U8 *history_buffer;
  1563.     /*----------------------------------------------------------------*/
  1564.     /* Code Body                                                      */
  1565.     /*----------------------------------------------------------------*/
  1566.     memset((void*)&MMI_tab_control, 0, sizeof(MMI_tab_control));
  1567.     history_buffer = GetCurrGuiBuffer(GetCurrScrnId());
  1568.     set_tab_pane_category_history(history_buffer);
  1569.     history_buffer += get_tab_pane_history_size();
  1570.     change_curr_gui_buffer(history_buffer);
  1571. }
  1572. /*****************************************************************************
  1573.  * FUNCTION
  1574.  *  get_tab_pane_history_size
  1575.  * DESCRIPTION
  1576.  *  returns tab pane history size
  1577.  * PARAMETERS
  1578.  *  void
  1579.  *  a(?)        [IN/OUT]        
  1580.  *  b(?)        [IN]            
  1581.  * RETURNS
  1582.  *  
  1583.  *****************************************************************************/
  1584. S32 get_tab_pane_history_size(void)
  1585. {
  1586.     /*----------------------------------------------------------------*/
  1587.     /* Local Variables                                                */
  1588.     /*----------------------------------------------------------------*/
  1589.     /*----------------------------------------------------------------*/
  1590.     /* Code Body                                                      */
  1591.     /*----------------------------------------------------------------*/
  1592.     return (sizeof(struct_tab_pane_history));
  1593. }
  1594. /*****************************************************************************
  1595.  * FUNCTION
  1596.  *  get_tab_pane_history
  1597.  * DESCRIPTION
  1598.  *  returns tab pane history
  1599.  * PARAMETERS
  1600.  *  history_buffer      [?]             
  1601.  *  a(?)                [IN/OUT]        
  1602.  *  b(?)                [IN]            
  1603.  * RETURNS
  1604.  *  
  1605.  *****************************************************************************/
  1606. U8 *get_tab_pane_history(U8 *history_buffer)
  1607. {
  1608.     /*----------------------------------------------------------------*/
  1609.     /* Local Variables                                                */
  1610.     /*----------------------------------------------------------------*/
  1611.     /*----------------------------------------------------------------*/
  1612.     /* Code Body                                                      */
  1613.     /*----------------------------------------------------------------*/
  1614.     if (history_buffer != NULL)
  1615.     {
  1616.         struct_tab_pane_history *tab_history = (struct_tab_pane_history*) history_buffer;
  1617.         tab_history->first_displayed_item = MMI_tab_control.first_displayed_item;
  1618.         tab_history->highlighted_item = MMI_tab_control.highlighted_item;
  1619.         tab_history->last_displayed_item = MMI_tab_control.highlighted_item;
  1620.         tab_history->parent_id = MMI_tab_control.parent_id;
  1621.         tab_history->set_callback = MMI_tab_control.set_callback;
  1622.         tab_history->set_data_callback = MMI_tab_control.set_data_callback;
  1623.         tab_history->reset_data_callback = MMI_tab_control.reset_data_callback;
  1624.         tab_history->type = MMI_tab_control.type;
  1625.         tab_history->highlighted_pane = MMI_tab_control.highlighted_pane;
  1626.         tab_history->category_exit_callback = MMI_tab_control.category_exit_callback;
  1627.         tab_history->category_entry_callback = MMI_tab_control.category_entry_callback;
  1628.         tab_history->tab_list_history = MMI_tab_control.tab_list_history;
  1629.     }
  1630.     return (history_buffer);
  1631. }
  1632. /*****************************************************************************
  1633.  * FUNCTION
  1634.  *  get_tab_pane_and_parent_category_history
  1635.  * DESCRIPTION
  1636.  *  new history size function registered by tab pane
  1637.  * PARAMETERS
  1638.  *  history_buffer      [?]             
  1639.  *  a(?)                [IN/OUT]        
  1640.  *  b(?)                [IN]            
  1641.  * RETURNS
  1642.  *  
  1643.  *****************************************************************************/
  1644. U8 *get_tab_pane_and_parent_category_history(U8 *history_buffer)
  1645. {
  1646. #ifdef MMI_TAB_PANE_LIST_HISTORY
  1647.     /*----------------------------------------------------------------*/
  1648.     /* Local Variables                                                */
  1649.     /*----------------------------------------------------------------*/
  1650.     {
  1651.         list_menu_category_history list_history;
  1652.         /*----------------------------------------------------------------*/
  1653.         /* Code Body                                                      */
  1654.         /*----------------------------------------------------------------*/
  1655.         get_list_menu_category_history(1, (U8*) & list_history);
  1656.         MMI_tab_control.tab_list_history.first_displayed_item[MMI_tab_control.highlighted_item]
  1657.             = list_history.first_displayed_item;
  1658.         MMI_tab_control.tab_list_history.highlighted_item[MMI_tab_control.highlighted_item]
  1659.             = list_history.highlighted_item;
  1660.         MMI_tab_control.tab_list_history.last_displayed_item[MMI_tab_control.highlighted_item]
  1661.             = list_history.last_displayed_item;
  1662.     }
  1663. #endif /* MMI_TAB_PANE_LIST_HISTORY */ 
  1664.     get_tab_pane_history(history_buffer);
  1665. #ifndef MMI_TAB_PANE_LIST_HISTORY
  1666.     backup_category_func_ptr(history_buffer + get_tab_pane_history_size());
  1667. #else 
  1668.     memset(history_buffer + get_tab_pane_history_size(), 0, 4);
  1669. #endif 
  1670.     return (history_buffer);
  1671. }
  1672. /*****************************************************************************
  1673.  * FUNCTION
  1674.  *  set_tab_pane_category_history
  1675.  * DESCRIPTION
  1676.  *  sets tab pane history
  1677.  * PARAMETERS
  1678.  *  history_buffer      [?]             
  1679.  *  a(?)                [IN/OUT]        
  1680.  *  b(?)                [IN]            
  1681.  * RETURNS
  1682.  *  void
  1683.  *****************************************************************************/
  1684. void set_tab_pane_category_history(U8 *history_buffer)
  1685. {
  1686.     /*----------------------------------------------------------------*/
  1687.     /* Local Variables                                                */
  1688.     /*----------------------------------------------------------------*/
  1689.     /*----------------------------------------------------------------*/
  1690.     /* Code Body                                                      */
  1691.     /*----------------------------------------------------------------*/
  1692.     if (history_buffer != NULL)
  1693.     {
  1694.         struct_tab_pane_history *tab_history = (struct_tab_pane_history*) history_buffer;
  1695.         register_set_tab_pane_callback(
  1696.             tab_history->set_callback,
  1697.             tab_history->set_data_callback,
  1698.             tab_history->reset_data_callback);
  1699.         switch (tab_history->type)
  1700.         {
  1701.             case TAB_CONTROL_WITH_TWO_ICON:
  1702.                 create_and_setup_two_icon_tab_pane();
  1703.                 break;
  1704.             case TAB_CONTROL_WITH_TWO_TEXT:
  1705.                 create_and_setup_two_text_tab_pane();
  1706.                 break;
  1707.             case TAB_CONTROL_WITH_FOUR_ICON:
  1708.                 create_and_setup_four_icon_tab_pane();
  1709.                 break;
  1710.             case TAB_CONTROL_WITH_THREE_ICON:
  1711.                 create_and_setup_three_icon_tab_pane();
  1712.                 break;
  1713.             case TAB_CONTROL_WITH_ONE_ICON:
  1714.                 create_and_setup_one_icon_tab_pane();
  1715.                 break;
  1716.         }
  1717.         MMI_tab_control.first_displayed_item = tab_history->first_displayed_item;
  1718.         MMI_tab_control.highlighted_item = tab_history->highlighted_item;
  1719.         MMI_tab_control.highlighted_item = tab_history->last_displayed_item;
  1720.         MMI_tab_control.parent_id = tab_history->parent_id;
  1721.         MMI_tab_control.highlighted_pane = tab_history->highlighted_pane;
  1722.         MMI_tab_control.category_exit_callback = tab_history->category_exit_callback;
  1723.         MMI_tab_control.category_entry_callback = tab_history->category_entry_callback;
  1724.         MMI_tab_control.tab_list_history = tab_history->tab_list_history;
  1725.     }
  1726. }
  1727. /*****************************************************************************
  1728.  * FUNCTION
  1729.  *  tab_pane_disable_function_exection
  1730.  * DESCRIPTION
  1731.  *  disbale tab pane function execution on highlighting
  1732.  * PARAMETERS
  1733.  *  void
  1734.  *  a(?)        [IN/OUT]        
  1735.  *  b(?)        [IN]            
  1736.  * RETURNS
  1737.  *  void
  1738.  *****************************************************************************/
  1739. void tab_pane_disable_function_exection(void)
  1740. {
  1741.     /*----------------------------------------------------------------*/
  1742.     /* Local Variables                                                */
  1743.     /*----------------------------------------------------------------*/
  1744.     /*----------------------------------------------------------------*/
  1745.     /* Code Body                                                      */
  1746.     /*----------------------------------------------------------------*/
  1747.     enable_function_execution = 0;
  1748. }
  1749. /*****************************************************************************
  1750.  * FUNCTION
  1751.  *  set_pre_tab_pane_display
  1752.  * DESCRIPTION
  1753.  *  tab pane function to be called in function entry if the entry function is not called directly.
  1754.  *  needs to be called before EntryNewScreen
  1755.  * PARAMETERS
  1756.  *  void
  1757.  *  a(?)        [IN/OUT]        
  1758.  *  b(?)        [IN]            
  1759.  * RETURNS
  1760.  *  void
  1761.  *****************************************************************************/
  1762. void set_pre_tab_pane_display(void)
  1763. {
  1764.     /*----------------------------------------------------------------*/
  1765.     /* Local Variables                                                */
  1766.     /*----------------------------------------------------------------*/
  1767.     /*----------------------------------------------------------------*/
  1768.     /* Code Body                                                      */
  1769.     /*----------------------------------------------------------------*/
  1770.     SetCurrEntryFuncPtr(backup_entry_func_ptr);
  1771.     if (!allow_history_saving)
  1772.     {
  1773.         disable_history_saving();
  1774.     }
  1775.     SetCurrExitFuncPtr(backup_exit_func_ptr);
  1776.     if (backup_category_func_ptr)
  1777.     {
  1778.         GetCategoryHistory = backup_category_func_ptr;
  1779.     }
  1780.     enable_tab_pane_display();
  1781. }
  1782. /*****************************************************************************
  1783.  * FUNCTION
  1784.  *  set_post_tab_pane_display
  1785.  * DESCRIPTION
  1786.  *  tab pane function to be called in function entry if the entry function is not called directly.
  1787.  *  needs to be called after the keys have been registered.
  1788.  * PARAMETERS
  1789.  *  void
  1790.  *  a(?)        [IN/OUT]        
  1791.  *  b(?)        [IN]            
  1792.  * RETURNS
  1793.  *  void
  1794.  *****************************************************************************/
  1795. void set_post_tab_pane_display(void)
  1796. {
  1797.     /*----------------------------------------------------------------*/
  1798.     /* Local Variables                                                */
  1799.     /*----------------------------------------------------------------*/
  1800.     /*----------------------------------------------------------------*/
  1801.     /* Code Body                                                      */
  1802.     /*----------------------------------------------------------------*/
  1803.     backup_current_entry_function();
  1804.     backup_current_category_function();
  1805.     register_tab_pane_keys();
  1806.     disable_tab_pane_display();
  1807.     enable_history_saving();
  1808. }
  1809. /*****************************************************************************
  1810.  * FUNCTION
  1811.  *  set_tab_pane_category_exit_function
  1812.  * DESCRIPTION
  1813.  *  sets tab pane category exit function
  1814.  * PARAMETERS
  1815.  *  f           [IN]            
  1816.  *  a(?)        [IN/OUT]        F: category exit function
  1817.  *  b(?)        [IN]            
  1818.  * RETURNS
  1819.  *  void
  1820.  *****************************************************************************/
  1821. void set_tab_pane_category_exit_function(void (*f) (void))
  1822. {
  1823.     /*----------------------------------------------------------------*/
  1824.     /* Local Variables                                                */
  1825.     /*----------------------------------------------------------------*/
  1826.     /*----------------------------------------------------------------*/
  1827.     /* Code Body                                                      */
  1828.     /*----------------------------------------------------------------*/
  1829.     gui_set_tab_pane_category_exit_function(&MMI_tab_control, f);
  1830. }
  1831. /*****************************************************************************
  1832.  * FUNCTION
  1833.  *  set_tab_pane_category_entry_function
  1834.  * DESCRIPTION
  1835.  *  sets tab pane category entry function
  1836.  * PARAMETERS
  1837.  *  f           [IN]            
  1838.  *  a(?)        [IN/OUT]        F: category entry function
  1839.  *  b(?)        [IN]            
  1840.  * RETURNS
  1841.  *  void
  1842.  *****************************************************************************/
  1843. void set_tab_pane_category_entry_function(void (*f) (void))
  1844. {
  1845.     /*----------------------------------------------------------------*/
  1846.     /* Local Variables                                                */
  1847.     /*----------------------------------------------------------------*/
  1848.     /*----------------------------------------------------------------*/
  1849.     /* Code Body                                                      */
  1850.     /*----------------------------------------------------------------*/
  1851.     gui_set_tab_pane_category_entry_function(&MMI_tab_control, f);
  1852. }
  1853. /*****************************************************************************
  1854.  * FUNCTION
  1855.  *  get_current_tab_pane_height
  1856.  * DESCRIPTION
  1857.  *  returns current tab pane height
  1858.  * PARAMETERS
  1859.  *  void
  1860.  *  a(?)        [IN/OUT]        NONE
  1861.  *  b(?)        [IN]            
  1862.  * RETURNS
  1863.  *  
  1864.  *****************************************************************************/
  1865. S32 get_current_tab_pane_height(void)
  1866. {
  1867.     /*----------------------------------------------------------------*/
  1868.     /* Local Variables                                                */
  1869.     /*----------------------------------------------------------------*/
  1870.     /*----------------------------------------------------------------*/
  1871.     /* Code Body                                                      */
  1872.     /*----------------------------------------------------------------*/
  1873.     return MMI_tab_control.height;
  1874. }
  1875. /*****************************************************************************
  1876.  * FUNCTION
  1877.  *  is_tab_pane_displayed_on_current_screen
  1878.  * DESCRIPTION
  1879.  *  this function is used to cjeck if tab pane is being displayed on current screen
  1880.  * PARAMETERS
  1881.  *  void
  1882.  *  a(?)        [IN/OUT]        
  1883.  *  b(?)        [IN]            
  1884.  * RETURNS
  1885.  *  
  1886.  *****************************************************************************/
  1887. S32 is_tab_pane_displayed_on_current_screen(void)
  1888. {
  1889.     /*----------------------------------------------------------------*/
  1890.     /* Local Variables                                                */
  1891.     /*----------------------------------------------------------------*/
  1892.     /*----------------------------------------------------------------*/
  1893.     /* Code Body                                                      */
  1894.     /*----------------------------------------------------------------*/
  1895.     if (GetCurrEntryFuncPtr() == tab_set_from_history)
  1896.     {
  1897.         return 1;
  1898.     }
  1899.     else
  1900.     {
  1901.         return 0;
  1902.     }
  1903. }
  1904. /*****************************************************************************
  1905.  * FUNCTION
  1906.  *  set_list_in_tab_history
  1907.  * DESCRIPTION
  1908.  *  this function is used to set the list history when scrolling left to right
  1909.  * PARAMETERS
  1910.  *  void
  1911.  *  a(?)        [IN/OUT]        
  1912.  *  b(?)        [IN]            
  1913.  * RETURNS
  1914.  *  
  1915.  *****************************************************************************/
  1916. S32 set_list_in_tab_history(void)
  1917. {
  1918. #ifndef MMI_TAB_PANE_LIST_HISTORY
  1919.     /*----------------------------------------------------------------*/
  1920.     /* Local Variables                                                */
  1921.     /*----------------------------------------------------------------*/
  1922.     /*----------------------------------------------------------------*/
  1923.     /* Code Body                                                      */
  1924.     /*----------------------------------------------------------------*/
  1925.     return 0;
  1926. #else /* MMI_TAB_PANE_LIST_HISTORY */ 
  1927.     if (set_list_history)
  1928.     {
  1929.         if (MMI_tab_control.tab_list_history.highlighted_item[MMI_tab_control.highlighted_item] == 0
  1930.             && MMI_tab_control.tab_list_history.first_displayed_item[MMI_tab_control.highlighted_item] == 0
  1931.             && MMI_tab_control.tab_list_history.last_displayed_item[MMI_tab_control.highlighted_item] == 0)
  1932.         {
  1933.             return 0;
  1934.         }
  1935.         MMI_fixed_list_menu.highlighted_item =
  1936.             MMI_tab_control.tab_list_history.highlighted_item[MMI_tab_control.highlighted_item];
  1937.         MMI_fixed_list_menu.first_displayed_item =
  1938.             MMI_tab_control.tab_list_history.first_displayed_item[MMI_tab_control.highlighted_item];
  1939.         MMI_fixed_list_menu.last_displayed_item =
  1940.             MMI_tab_control.tab_list_history.last_displayed_item[MMI_tab_control.highlighted_item];
  1941.         return 1;
  1942.     }
  1943.     return 0;
  1944. #endif /* MMI_TAB_PANE_LIST_HISTORY */ 
  1945. }
  1946. /*****************************************************************************
  1947.  * FUNCTION
  1948.  *  tab_pane_modify_data
  1949.  * DESCRIPTION
  1950.  *  this function is used to modify the data when any category is changed if required by tab pane
  1951.  * PARAMETERS
  1952.  *  void
  1953.  *  a(?)        [IN/OUT]        
  1954.  *  b(?)        [IN]            
  1955.  * RETURNS
  1956.  *  void
  1957.  *****************************************************************************/
  1958. void tab_pane_modify_data(void)
  1959. {
  1960.     /*----------------------------------------------------------------*/
  1961.     /* Local Variables                                                */
  1962.     /*----------------------------------------------------------------*/
  1963.     /*----------------------------------------------------------------*/
  1964.     /* Code Body                                                      */
  1965.     /*----------------------------------------------------------------*/
  1966.     if (tab_pane_modify_data_ptr)
  1967.     {
  1968.         tab_pane_modify_data_ptr();
  1969.     }
  1970. }
  1971. /*****************************************************************************
  1972.  * FUNCTION
  1973.  *  set_tab_pane_modify_data_function
  1974.  * DESCRIPTION
  1975.  *  this function is used to set the tab pane modify function by category screen
  1976.  * PARAMETERS
  1977.  *  ptr         [IN]            
  1978.  *  a(?)        [IN/OUT]        
  1979.  *  b(?)        [IN]            
  1980.  * RETURNS
  1981.  *  void
  1982.  *****************************************************************************/
  1983. void set_tab_pane_modify_data_function(void (*ptr) (void))
  1984. {
  1985.     /*----------------------------------------------------------------*/
  1986.     /* Local Variables                                                */
  1987.     /*----------------------------------------------------------------*/
  1988.     /*----------------------------------------------------------------*/
  1989.     /* Code Body                                                      */
  1990.     /*----------------------------------------------------------------*/
  1991.     tab_pane_modify_data_ptr = ptr;
  1992. }
  1993. /*****************************************************************************
  1994.  * FUNCTION
  1995.  *  reset_tab_pane_modify_data_function
  1996.  * DESCRIPTION
  1997.  *  this function sets the tab pane modify function to NULL
  1998.  * PARAMETERS
  1999.  *  void
  2000.  *  a(?)        [IN/OUT]        
  2001.  *  b(?)        [IN]            
  2002.  * RETURNS
  2003.  *  void
  2004.  *****************************************************************************/
  2005. void reset_tab_pane_modify_data_function(void)
  2006. {
  2007.     /*----------------------------------------------------------------*/
  2008.     /* Local Variables                                                */
  2009.     /*----------------------------------------------------------------*/
  2010.     /*----------------------------------------------------------------*/
  2011.     /* Code Body                                                      */
  2012.     /*----------------------------------------------------------------*/
  2013.     tab_pane_modify_data_ptr = NULL;
  2014. }
  2015. /*****************************************************************************
  2016.  * FUNCTION
  2017.  *  set_tab_pane_modify_title_icon
  2018.  * DESCRIPTION
  2019.  *  this function sets the tab pane modify function to NULL
  2020.  * PARAMETERS
  2021.  *  void
  2022.  *  a(?)        [IN/OUT]        
  2023.  *  b(?)        [IN]            
  2024.  * RETURNS
  2025.  *  void
  2026.  *****************************************************************************/
  2027. void set_tab_pane_modify_title_icon(void)
  2028. {
  2029.     /*----------------------------------------------------------------*/
  2030.     /* Local Variables                                                */
  2031.     /*----------------------------------------------------------------*/
  2032.     /*----------------------------------------------------------------*/
  2033.     /* Code Body                                                      */
  2034.     /*----------------------------------------------------------------*/
  2035.     MMI_title_icon = MMI_tab_control.item_data[MMI_tab_control.highlighted_item].item_icon;
  2036. }
  2037. /*****************************************************************************
  2038.  * FUNCTION
  2039.  *  set_tab_pane_cyclic
  2040.  * DESCRIPTION
  2041.  *  this function sets the tab pane in cyclic mode
  2042.  * PARAMETERS
  2043.  *  void
  2044.  *  a(?)        [IN/OUT]        
  2045.  *  b(?)        [IN]            
  2046.  * RETURNS
  2047.  *  void
  2048.  *****************************************************************************/
  2049. void set_tab_pane_cyclic(void)
  2050. {
  2051.     /*----------------------------------------------------------------*/
  2052.     /* Local Variables                                                */
  2053.     /*----------------------------------------------------------------*/
  2054.     /*----------------------------------------------------------------*/
  2055.     /* Code Body                                                      */
  2056.     /*----------------------------------------------------------------*/
  2057.     gui_set_tab_pane_flags(&MMI_tab_control, MMI_tab_control.flags | UI_TAB_CONTROL_CYCLIC);
  2058. }
  2059. #endif /* __MMI_UI_TAB_PANE__ */