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

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.  * mainmenu.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for main menu
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  *
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  * removed!
  100.  * removed!
  101.  * removed!
  102.  *
  103.  * removed!
  104.  * removed!
  105.  * removed!
  106.  *
  107.  * removed!
  108.  * removed!
  109.  * removed!
  110.  *
  111.  * removed!
  112.  * removed!
  113.  * removed!
  114.  *
  115.  * removed!
  116.  * removed!
  117.  * removed!
  118.  *
  119.  * removed!
  120.  * removed!
  121.  * removed!
  122.  *
  123.  * removed!
  124.  * removed!
  125.  * removed!
  126.  *
  127.  * removed!
  128.  * removed!
  129.  * removed!
  130.  *
  131.  * removed!
  132.  * removed!
  133.  * removed!
  134.  *
  135.  *------------------------------------------------------------------------------
  136.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  137.  *============================================================================
  138.  ****************************************************************************/
  139. /**
  140.  * Copyright Notice
  141.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  142.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  143.  *  (It is illegal to remove this copyright notice from this software or any
  144.  *  portion of it)
  145.  */
  146. /**********************************************************************************
  147.    Filename:      mainmenu.c
  148.    Author:        manju, Vijay Vaidya
  149.    Date Created:  September-07-2002
  150.    Contains:      Main menu application
  151. **********************************************************************************/
  152. #include "stdC.h"
  153. #include "MMI_Features.h"
  154. #include "L4Dr.h"
  155. #include "L4Dr1.h"
  156. #include "AllAppGprot.h"
  157. //#include "CustDataRes.h"
  158. //#include "CustMenuRes.h"
  159. #include "FrameworkStruct.h"
  160. // #include "CustMenuRes.h"
  161. #include "GlobalConstants.h"
  162. #include "EventsGprot.h"
  163. #include "mmiappfnptrs.h"
  164. #include "HistoryGprot.h"
  165. #include "PhoneBookDef.h"
  166. #include "MainMenuDef.h"
  167. #include "MainMenuProt.h"
  168. #include "wgui_categories.h"
  169. #include "wgui_categories_MM.h"
  170. #include "MiscFunctions.h"
  171. #include "ProfilesEnum.h"
  172. #include "SettingGprots.h"
  173. //micha0202
  174. //#include "NetworkSetupDefs.h"
  175. //#include "ConnectGprots.h"
  176. #include "FunAndGamesDefs.h"
  177. #include "FunAndGamesProts.h"
  178. #include "ExtraDef.h"
  179. /* MTK amanda change 0114 */
  180. #include "CallHistoryMain.h"
  181. #include "SettingDefs.h"
  182. #include "Globaldefs.h"
  183. #include "SimDetectionGexdcl.h"
  184. #include "SimDetectionGprot.h"
  185. // #ifdef __MOD_SMSAL__
  186. #include "MessagesExDcl.h"
  187. // #endif
  188. #include "CommonScreens.h"
  189. /* micha0601 */
  190. #include "Service.h"
  191. #ifdef __SAT__
  192. #include "SATGProts.h"
  193. #endif 
  194. #ifdef __MMI_FILE_MANAGER__
  195. #include "FileMgr.h"
  196. #endif 
  197. #ifndef __DISABLE_SHORTCUTS_MENU__
  198. #include "ShortcutsProts.h"
  199. #endif 
  200. #include "FunandGamesProts.h"
  201. #include "wgui_status_icons.h"
  202. // MTK amanda remove 0114
  203. //#include "CallHistoryGProts.h"
  204. #include "MainMenudef.h"
  205. // MTK amanda remove 0114
  206. //#include "CallsDefs.h"
  207. #include "ManageCallMain.h"
  208. #include "IdleAppDef.h"
  209. // MTK amanda remove 0114
  210. //#include "CallhistoryEnum.h"
  211. #include "CallSetUpEnum.h"
  212. #include "Unicodexdcl.h"
  213. #include "OrganizerGProt.h"
  214. #include "OrganizerDef.h"
  215. #include "SettingProt.h"
  216. #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
  217. #include "gui_custom_menus.h"
  218. #include "CustMenuRes.h"
  219. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  220. #include "wgui_tab_bars.h"
  221. #endif 
  222. extern U8 PhnsetGetMainMenuStyle(void);
  223. #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
  224. #if (defined(__MMI_IRDA_SUPPORT__) || defined(__MMI_USB_SUPPORT__) || defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__))
  225. #include "ExtDeviceDefs.h"
  226. #endif 
  227. /* MTK Leo add, mini_tab_bar */
  228. #include "DebugInitDef.h"
  229. /* MTK Leo end */
  230. //KP Jerry add for putting kongzhong net in main menu on 2007-4-29 start
  231. #ifdef __VALUE_ADDED_SERVICE_IN_MAINMENU__
  232. #include "IdleAppProt.h"
  233. #endif
  234. //KP Jerry add for putting kongzhong net in main menu on 2007-4-29 end
  235. extern void EntryIdleScreen(void);
  236. /* extern S32 gidle_call;//vandana */
  237. extern void EntryScrProfiles(void);
  238. extern void mmi_phb_reset_scr_id(void); /* Pranav */
  239. //micha0601
  240. //extern U8 IsSATPresent(void);
  241. extern void GoToSATMainMenu(void);
  242. #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__    /* Robin 1223 */
  243. extern void IdleHandleKeypadLockProcess(void);
  244. extern void IdleHandlePoundKeyForKeypadLock(void);
  245. #endif /* __MMI_KEYPAD_LOCK_PATTERN_2__ */ 
  246. extern U16 gMainMenuTitleIcon[];
  247. /* 113004 Calvin added */
  248. extern main_menu_index;
  249. extern S32 MMI_main_menu_type;
  250. extern UI_3D_circular_menu wgui_CM3D_menu;
  251. /* Calvin end */
  252. /* PMT VIKAS START 20050707 */
  253. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  254. extern void shuffle_draw_white(void);
  255. #endif 
  256. /* PMT VIKAS END 20050707 */
  257. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  258. extern BOOL inMatrixNoTitleFlag;    /* 041105 Calvin added */
  259. #endif 
  260. #if defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__)
  261. extern void mmi_fmrdo_skip_highlight_hdlr(S32 index);   /* defined in FMRadioSrc.c */
  262. extern U16 mmi_fmrdo_check_chip_or_hide(U16 n_items, U16 *string_ids, U16 *icon_ids); /* defined in FMRadioSrc.c */
  263. #endif /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  264. /*****************************************************************************
  265.  * FUNCTION
  266.  *  handle_mainmenu_right_softkey_up
  267.  * DESCRIPTION
  268.  *  Go to previous screen when rt soft key
  269.  *  is released
  270.  * PARAMETERS
  271.  *  void
  272.  * RETURNS
  273.  *  void
  274.  *****************************************************************************/
  275. void handle_mainmenu_right_softkey_up(void)
  276. {
  277.     /*----------------------------------------------------------------*/
  278.     /* Local Variables                                                */
  279.     /*----------------------------------------------------------------*/
  280.     /*----------------------------------------------------------------*/
  281.     /* Code Body                                                      */
  282.     /*----------------------------------------------------------------*/
  283.     GoBackHistory();
  284. }
  285. /*****************************************************************************
  286.  * FUNCTION
  287.  *  highlight_mainmenu_profiles
  288.  * DESCRIPTION
  289.  *  Associate the key handler
  290.  *  with left and rt soft key
  291.  *  
  292.  *  AUTHOR            :Ashima
  293.  * PARAMETERS
  294.  *  void
  295.  * RETURNS
  296.  *  void
  297.  *****************************************************************************/
  298. void highlight_mainmenu_profiles(void)
  299. {
  300.     /*----------------------------------------------------------------*/
  301.     /* Local Variables                                                */
  302.     /*----------------------------------------------------------------*/
  303.     /*----------------------------------------------------------------*/
  304.     /* Code Body                                                      */
  305.     /*----------------------------------------------------------------*/
  306.     /* 030705 Calvin modified */
  307. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  308.     if (inMatrixNoTitleFlag)
  309.     {
  310.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  311.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  312.     }
  313.     else    /* 041105 Calvin added */
  314.     {
  315.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  316.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  317.     }
  318. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  319.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  320.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  321. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  322.     SetLeftSoftkeyFunction(EntryScrProfiles, KEY_EVENT_UP);
  323.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  324.     /* if(gPrevScreenIndicator == ENTER_SIM_INSERTION) */
  325.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  326.     {
  327.         SetKeyHandler(EntryScrProfiles, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  328.     }
  329. }
  330. /*****************************************************************************
  331.  * FUNCTION
  332.  *  highlight_mainmenu_phonebook
  333.  * DESCRIPTION
  334.  *  Associate the key handler
  335.  *  with left and rt soft key
  336.  * PARAMETERS
  337.  *  void
  338.  * RETURNS
  339.  *  void
  340.  *****************************************************************************/
  341. void highlight_mainmenu_phonebook(void)
  342. {
  343.     /*----------------------------------------------------------------*/
  344.     /* Local Variables                                                */
  345.     /*----------------------------------------------------------------*/
  346.     /*----------------------------------------------------------------*/
  347.     /* Code Body                                                      */
  348.     /*----------------------------------------------------------------*/
  349.     /* 030705 Calvin modified */
  350. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  351.     if (inMatrixNoTitleFlag)
  352.     {
  353.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  354.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  355.     }
  356.     else    /* 041105 Calvin added */
  357.     {
  358.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  359.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  360.     }
  361. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  362.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  363.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  364. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  365.     SetLeftSoftkeyFunction(mmi_phb_entry_main_menu, KEY_EVENT_UP);
  366.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  367.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  368.     {
  369.         SetKeyHandler(mmi_phb_entry_main_menu, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  370.     }
  371. }
  372. /*****************************************************************************
  373.  * FUNCTION
  374.  *  highlight_mainmenu_messages
  375.  * DESCRIPTION
  376.  *  Associate the key handler
  377.  *  with left and rt soft key
  378.  * PARAMETERS
  379.  *  void
  380.  * RETURNS
  381.  *  void
  382.  *****************************************************************************/
  383. void highlight_mainmenu_messages(void)
  384. {
  385.     /*----------------------------------------------------------------*/
  386.     /* Local Variables                                                */
  387.     /*----------------------------------------------------------------*/
  388.     /*----------------------------------------------------------------*/
  389.     /* Code Body                                                      */
  390.     /*----------------------------------------------------------------*/
  391.     /* 030705 Calvin modified */
  392. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  393.     if (inMatrixNoTitleFlag)
  394.     {
  395.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  396.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  397.     }
  398.     else    /* 041105 Calvin added */
  399.     {
  400.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  401.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  402.     }
  403. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  404.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  405.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  406. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  407. #ifdef __MOD_SMSAL__
  408.     SetLeftSoftkeyFunction(EntryScrMessagesMenuList, KEY_EVENT_UP);     /* sms-code */
  409. #endif 
  410.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  411. }
  412. /*****************************************************************************
  413.  * FUNCTION
  414.  *  highlight_mainmenu_funandgames
  415.  * DESCRIPTION
  416.  *  Associate the key handler
  417.  *  with left and rt soft key
  418.  * PARAMETERS
  419.  *  void
  420.  * RETURNS
  421.  *  void
  422.  *****************************************************************************/
  423. void highlight_mainmenu_funandgames(void)
  424. {
  425.     /*----------------------------------------------------------------*/
  426.     /* Local Variables                                                */
  427.     /*----------------------------------------------------------------*/
  428.     /*----------------------------------------------------------------*/
  429.     /* Code Body                                                      */
  430.     /*----------------------------------------------------------------*/
  431.     /* 030705 Calvin modified */
  432. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  433.     if (inMatrixNoTitleFlag)
  434.     {
  435.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  436.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  437.     }
  438.     else    /* 041105 Calvin added */
  439.     {
  440.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  441.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  442.     }
  443. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  444.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  445.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  446. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  447.     SetLeftSoftkeyFunction(mmi_fng_entry_screen, KEY_EVENT_UP);
  448.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  449.     /* if(gPrevScreenIndicator == ENTER_SIM_INSERTION) */
  450.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  451.     {
  452.         SetKeyHandler(mmi_fng_entry_screen, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  453.     }
  454. }
  455. /*****************************************************************************
  456.  * FUNCTION
  457.  *  highlight_mainmenu_organizer
  458.  * DESCRIPTION
  459.  *  Associate the key handler
  460.  *  with left and rt soft key
  461.  * PARAMETERS
  462.  *  void
  463.  * RETURNS
  464.  *  void
  465.  *****************************************************************************/
  466. void highlight_mainmenu_organizer(void)
  467. {
  468.     /*----------------------------------------------------------------*/
  469.     /* Local Variables                                                */
  470.     /*----------------------------------------------------------------*/
  471.     /*----------------------------------------------------------------*/
  472.     /* Code Body                                                      */
  473.     /*----------------------------------------------------------------*/
  474.     /* 030705 Calvin modified */
  475. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  476.     if (inMatrixNoTitleFlag)
  477.     {
  478.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  479.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  480.     }
  481.     else    /* 041105 Calvin added */
  482.     {
  483.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  484.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  485.     }
  486. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  487.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  488.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  489. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  490.     SetLeftSoftkeyFunction(EntryOrganizer, KEY_EVENT_UP);
  491.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  492.     /* if(gPrevScreenIndicator == ENTER_SIM_INSERTION) */
  493.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  494.     {
  495.         SetKeyHandler(EntryOrganizer, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  496.     }
  497. }
  498. /*****************************************************************************
  499.  * FUNCTION
  500.  *  highlight_mainmenu_settings
  501.  * DESCRIPTION
  502.  *  Associate the key handler
  503.  *  with left and rt soft key
  504.  * PARAMETERS
  505.  *  void
  506.  * RETURNS
  507.  *  void
  508.  *****************************************************************************/
  509. void highlight_mainmenu_settings(void)
  510. {
  511.     /*----------------------------------------------------------------*/
  512.     /* Local Variables                                                */
  513.     /*----------------------------------------------------------------*/
  514.     /*----------------------------------------------------------------*/
  515.     /* Code Body                                                      */
  516.     /*----------------------------------------------------------------*/
  517.     /* 030705 Calvin modified */
  518. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  519.     if (inMatrixNoTitleFlag)
  520.     {
  521.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  522.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  523.     }
  524.     else    /* 041105 Calvin added */
  525.     {
  526.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  527.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  528.     }
  529. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  530.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  531.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  532. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  533.     /* micha0420 */
  534.     SetLeftSoftkeyFunction(EntryScrSettingMenu, KEY_EVENT_UP);
  535.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  536.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  537.     {
  538.         SetKeyHandler(EntryScrSettingMenu, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  539.     }
  540. }
  541. #ifdef __MMI_MESSAGES_CLUB__
  542. /*****************************************************************************
  543.  * FUNCTION
  544.  *  highlight_mainmenu_msgclub
  545.  * DESCRIPTION
  546.  *  Associate the key handler
  547.  *  with left and rt soft key
  548.  * PARAMETERS
  549.  *  void
  550.  * RETURNS
  551.  *  void
  552.  *****************************************************************************/
  553. void highlight_mainmenu_msgclub(void)
  554. {
  555.     /*----------------------------------------------------------------*/
  556.     /* Local Variables                                                */
  557.     /*----------------------------------------------------------------*/
  558.     /*----------------------------------------------------------------*/
  559.     /* Code Body                                                      */
  560.     /*----------------------------------------------------------------*/
  561.     /* 030705 Calvin modified */
  562. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  563.     if (inMatrixNoTitleFlag)
  564.     {
  565.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  566.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  567.     }
  568.     else    /* 041105 Calvin added */
  569.     {
  570.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  571.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  572.     }
  573. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  574.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  575.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  576. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  577. #ifdef __MOD_SMSAL__
  578.     SetLeftSoftkeyFunction(mmi_msg_club_entry_level_1, KEY_EVENT_UP);   /* sms-code */
  579. #endif 
  580.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  581. }
  582. #endif /* __MMI_MESSAGES_CLUB__ */ 
  583. /*****************************************************************************
  584.  * FUNCTION
  585.  *  highlight_mainmenu_shortcuts
  586.  * DESCRIPTION
  587.  *  Associate the key handler
  588.  *  with left and rt soft key
  589.  * PARAMETERS
  590.  *  void
  591.  * RETURNS
  592.  *  void
  593.  *****************************************************************************/
  594. #ifndef __DISABLE_SHORTCUTS_MENU__
  595. void highlight_mainmenu_shortcuts(void)
  596. {
  597.     /*----------------------------------------------------------------*/
  598.     /* Local Variables                                                */
  599.     /*----------------------------------------------------------------*/
  600.     /*----------------------------------------------------------------*/
  601.     /* Code Body                                                      */
  602.     /*----------------------------------------------------------------*/
  603.     /* 030705 Calvin modified */
  604. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  605.     if (inMatrixNoTitleFlag)
  606.     {
  607.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  608.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  609.     }
  610.     else    /* 041105 Calvin added */
  611.     {
  612.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  613.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  614.     }
  615. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  616.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  617.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  618. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  619.     SetLeftSoftkeyFunction(EntryShctInMainMenu, KEY_EVENT_UP);
  620. //KP Jerry modify on 2007-4-29 start
  621. #ifdef __VALUE_ADDED_SERVICE_IN_MAINMENU__
  622.        SetKeyHandler(EntryShctInMainMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  623.        SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  624.        SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  625. #else
  626.    #if defined(__MMI_VERSION_2__) && !defined(__MMI_MESSAGES_CLUB__)
  627.        SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  628.    #else /* defined(__MMI_VERSION_2__) && !defined(__MMI_MESSAGES_CLUB__) */ 
  629.        SetKeyHandler(EntryShctInMainMenu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  630.        SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  631.        SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  632.    #endif /* defined(__MMI_VERSION_2__) && !defined(__MMI_MESSAGES_CLUB__) */ 
  633. #endif
  634. //KP Jerry modify on 2007-4-29 end
  635. }
  636. #endif /* __DISABLE_SHORTCUTS_MENU__ */ 
  637. /*****************************************************************************
  638.  * FUNCTION
  639.  *  highlight_mainmenu_services
  640.  * DESCRIPTION
  641.  *  Associate the key handler
  642.  *  with left and rt soft key
  643.  * PARAMETERS
  644.  *  void
  645.  * RETURNS
  646.  *  void
  647.  *****************************************************************************/
  648. void highlight_mainmenu_services(void)
  649. {
  650.     /*----------------------------------------------------------------*/
  651.     /* Local Variables                                                */
  652.     /*----------------------------------------------------------------*/
  653.     /*----------------------------------------------------------------*/
  654.     /* Code Body                                                      */
  655.     /*----------------------------------------------------------------*/
  656.     /* 030705 Calvin modified */
  657. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  658.     if (inMatrixNoTitleFlag)
  659.     {
  660.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  661.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  662.     }
  663.     else    /* 041105 Calvin added */
  664.     {
  665.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  666.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  667.     }
  668. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  669.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  670.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  671. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  672.     /* micha1223 */
  673. #ifdef __MMI_MERGE_SAT_TO_MAINMENU__
  674.     /* micha1217 */
  675. #ifndef WAP_SUPPORT
  676.     /* micha0601 */
  677.     if (IsSATPresent())
  678.     {
  679.         SetLeftSoftkeyFunction(GoToSATMainMenu, KEY_EVENT_UP);
  680.     }
  681.     else
  682.     {
  683.         SetLeftSoftkeyFunction(GoToServicesMenu, KEY_EVENT_UP);
  684.     }
  685. #else /* WAP_SUPPORT */ 
  686.     SetLeftSoftkeyFunction(GoToServicesMenu, KEY_EVENT_UP);
  687. #endif /* WAP_SUPPORT */ 
  688. #else /* __MMI_MERGE_SAT_TO_MAINMENU__ */ 
  689.     SetLeftSoftkeyFunction(GoToServicesMenu, KEY_EVENT_UP);
  690. #endif /* __MMI_MERGE_SAT_TO_MAINMENU__ */ 
  691.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  692. }
  693. /*****************************************************************************
  694.  * FUNCTION
  695.  *  initalize_main_menu_application
  696.  * DESCRIPTION
  697.  *  Set all highlte handler for main menu
  698.  * PARAMETERS
  699.  *  void
  700.  * RETURNS
  701.  *  void
  702.  *****************************************************************************/
  703. void initalize_main_menu_application(void)
  704. {
  705.     /*----------------------------------------------------------------*/
  706.     /* Local Variables                                                */
  707.     /*----------------------------------------------------------------*/
  708.     /*----------------------------------------------------------------*/
  709.     /* Code Body                                                      */
  710.     /*----------------------------------------------------------------*/
  711.     SetHiliteHandler(MAIN_MENU_PROFILES_MENUID, highlight_mainmenu_profiles);
  712.     SetHiliteHandler(MAIN_MENU_PHONEBOOK_MENUID, highlight_mainmenu_phonebook);
  713.     SetHiliteHandler(MAIN_MENU_PHONEBOOK_NO_SIM_MENUID, highlight_mainmenu_phonebook);
  714.     SetHiliteHandler(MAIN_MENU_MESSAGES_MENUID, highlight_mainmenu_messages);
  715.     SetHiliteHandler(MAIN_MENU_FUNANDGAMES_MENUID, highlight_mainmenu_funandgames);
  716.     SetHiliteHandler(MAIN_MENU_ORGANIZER_MENUID, highlight_mainmenu_organizer);
  717.     SetHiliteHandler(MAIN_MENU_SETTINGS_MENUID, highlight_mainmenu_settings);
  718.     SetHiliteHandler(MAIN_MENU_SETTINGS_NO_SIM_MENUID, highlight_mainmenu_settings);    /* diamond, 2005/12/23 Phone setup in option menu */
  719. #ifdef __MMI_MESSAGES_CLUB__
  720.     SetHiliteHandler(MAIN_MENU_MSGCLUB_MENUID, highlight_mainmenu_msgclub);
  721. #endif 
  722. //KP Jerry modify on 2007-4-29 start
  723. #ifdef __VALUE_ADDED_SERVICE_IN_MAINMENU__
  724. #ifdef __KONG_NET_SP__
  725. SetHiliteHandler(MAIN_MENU_DREAM_FAIRYLAND_ID, hi_light_EntryDreamFairylandHandler);
  726. #endif
  727. #else
  728. #ifndef __DISABLE_SHORTCUTS_MENU__
  729.     SetHiliteHandler(EXTRA_SHORTCUTS_MENUID, highlight_mainmenu_shortcuts);
  730. #endif
  731. #endif
  732. //KP Jerry modify on 2007-4-29 end
  733.     SetHiliteHandler(MAIN_MENU_SERVICES_MENUID, highlight_mainmenu_services);
  734.     SetHiliteHandler(MAIN_MENU_CALL_HISTORY, highlight_mainmenu_callhistory);
  735.     SetHiliteHandler(MAIN_MENU_MULTIMEDIA_MENUID, highlight_mainmenu_multimedia);
  736. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  737.     SetHiliteHandler(MAIN_MENU_OPTION_AVZONE_MENUID, highlight_mainmenu_avzone);
  738. #endif 
  739. #if defined(__MMI_FILE_MANAGER__)
  740.     SetHiliteHandler(MAIN_MENU_FILE_MNGR_MENUID, highlight_mainmenu_filemngr);
  741. #endif 
  742. #if defined(__MMI_VERSION_2__)
  743.     SetHiliteHandler(MAIN_MENU_EXTRA_MENUID, highlight_mainmenu_extra);
  744. #endif 
  745.     mmi_frm_set_highlight_handler();
  746.     initialize_mainmenu_title_icons();
  747. }
  748. /*****************************************************************************
  749.  * FUNCTION
  750.  *  main_menu_shortcut_executer
  751.  * DESCRIPTION
  752.  *  Shortcut handler to main menu
  753.  * PARAMETERS
  754.  *  index       [IN]        
  755.  * RETURNS
  756.  *  void
  757.  *****************************************************************************/
  758. void main_menu_shortcut_executer(S32 index)
  759. {
  760.     /*----------------------------------------------------------------*/
  761.     /* Local Variables                                                */
  762.     /*----------------------------------------------------------------*/
  763.     S32 n_items = GetNumOfChild(IDLE_SCREEN_MENU_ID);
  764.     /*----------------------------------------------------------------*/
  765.     /* Code Body                                                      */
  766.     /*----------------------------------------------------------------*/
  767.     if (index >= 0 && index < n_items)
  768.     {
  769.         execute_left_softkey_function(KEY_EVENT_UP);
  770.     }
  771. }
  772. /* /PMT NEERAJ START 20050616 */
  773. #if defined(__MMI_MAINMENU_TAB_SUPPORT__) && defined(__MMI_MAINMENU_STYLE_CHANGE_EN__)  /* 071705 Calvin modified */
  774. #include "wgui_categories_tab.h"
  775. /*****************************************************************************
  776.  * FUNCTION
  777.  *  set_main_menu_tab_pane
  778.  * DESCRIPTION
  779.  *  Set tab pane function for main menu in tab pane
  780.  * PARAMETERS
  781.  *  void
  782.  * RETURNS
  783.  *  void
  784.  *****************************************************************************/
  785. void set_main_menu_tab_pane(void)
  786. {
  787.     /*----------------------------------------------------------------*/
  788.     /* Local Variables                                                */
  789.     /*----------------------------------------------------------------*/
  790.     MMI_ID_TYPE mm_stringIDs[MAX_MAIN_MENU_ITEMS];
  791.     MMI_ID_TYPE mm_iconIDs[MAX_MAIN_MENU_ITEMS];
  792.     MMI_ID_TYPE mm_iconIDs_display[MAX_MAIN_MENU_ITEMS];
  793.     MMI_ID_TYPE *iconList;
  794.     S32 n_items;
  795.     S32 i;
  796.     /*----------------------------------------------------------------*/
  797.     /* Code Body                                                      */
  798.     /*----------------------------------------------------------------*/
  799.     n_items = GetNumOfChild(IDLE_SCREEN_MENU_ID);
  800.     GetSequenceStringIds(IDLE_SCREEN_MENU_ID, mm_stringIDs);
  801.     GetSequenceImageIds(IDLE_SCREEN_MENU_ID, mm_iconIDs);
  802.     for (i = 0; i < (MAIN_MENU_TAB_ICON_IMGBASE_MAX - MAIN_MENU_TAB_ICON_IMGBASE); i++)
  803.     {
  804.         mm_iconIDs_display[i] = MAIN_MENU_TAB_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
  805.     }
  806.     iconList = mm_iconIDs_display;
  807.     SetParentHandler(IDLE_SCREEN_MENU_ID);
  808.     register_tab_pane_hilite_handler(ExecuteCurrHiliteHandler);
  809.     set_tab_pane(n_items, mm_stringIDs, iconList, 0);
  810. }
  811. #endif /* defined(__MMI_MAINMENU_TAB_SUPPORT__) && defined(__MMI_MAINMENU_STYLE_CHANGE_EN__) */ 
  812. /* PMT NEERAJ END 20050616 */
  813. /*****************************************************************************
  814.  * FUNCTION
  815.  *  main_menu_custom_highlight_handler
  816.  * DESCRIPTION
  817.  *  
  818.  * PARAMETERS
  819.  *  index       [IN]        
  820.  * RETURNS
  821.  *  void
  822.  *****************************************************************************/
  823. void main_menu_custom_highlight_handler(S32 index)
  824. {
  825.     /*----------------------------------------------------------------*/
  826.     /* Local Variables                                                */
  827.     /*----------------------------------------------------------------*/
  828.     /*----------------------------------------------------------------*/
  829.     /* Code Body                                                      */
  830.     /*----------------------------------------------------------------*/
  831.     /* PMT VIKAS START 20050707 */
  832. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  833.     gdi_layer_lock_frame_buffer();
  834. #endif 
  835.     //PMT VIKAS END 20050707
  836.     //MTK JL add no key clear hilite
  837.     ExecuteCurrHiliteHandler_Ext(index);
  838.     //MTK JL end
  839.     //PMT VIKAS START 20050707
  840. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  841.     gdi_layer_unlock_frame_buffer();
  842.     gui_BLT_double_buffer(0, UI_device_height - MMI_BUTTON_BAR_HEIGHT, UI_device_width - 1, UI_device_height - 1);
  843. #endif /* __MMI_UI_DALMATIAN_SOFTKEYS__ */ 
  844.     //PMT VIKAS END 20050707
  845.     //MTK Leo add 20040409, to sync titleicon
  846. #ifndef __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__    /* 030705 Calvin added */
  847.     if (MMI_main_menu_type != ROTATE_MENU && MMI_main_menu_type != CIRCULAR_3D_MENU)    /* 113004 Calvin added if check */
  848.     {
  849.         ChangeTitleIcon((U16) gMainMenuTitleIcon[index]);
  850.         draw_title();
  851.     }
  852. #endif /* __MMI_MATRIX_MAIN_MENU_NO_TITLEBAR__ */ 
  853.     //MTK Leo end
  854.     //if (MMI_main_menu_type == ROTATE_MENU)
  855.     main_menu_index = index;
  856. }
  857. /* Robin 1223 */
  858. /*****************************************************************************
  859.  * FUNCTION
  860.  *  EntryMainMenuFromIdleScreen
  861.  * DESCRIPTION
  862.  *  
  863.  * PARAMETERS
  864.  *  void
  865.  * RETURNS
  866.  *  void
  867.  *****************************************************************************/
  868. void EntryMainMenuFromIdleScreen(void)
  869. {
  870.     /*----------------------------------------------------------------*/
  871.     /* Local Variables                                                */
  872.     /*----------------------------------------------------------------*/
  873.     /*----------------------------------------------------------------*/
  874.     /* Code Body                                                      */
  875.     /*----------------------------------------------------------------*/
  876. #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
  877.     g_idle_context.ToMainMenuScrFromIdleApp = 1;
  878. #endif 
  879.     goto_main_menu();
  880. }
  881. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  882. extern void ShowCategory414Screen(
  883.                 U16 title,
  884.                 U16 title_icon,
  885.                 U16 left_softkey,
  886.                 U16 left_softkey_icon,
  887.                 U16 right_softkey,
  888.                 U16 right_softkey_icon,
  889.                 S32 number_of_items,
  890.                 U16 *list_of_items,
  891.                 U16 *list_of_icons,
  892.                 U16 *list_of_icons2,
  893.                 U16 *list_of_menuitem_id,
  894.                 S32 flags,
  895.                 S32 highlighted_item,
  896.                 U8 *history_buffer);
  897. /*****************************************************************************
  898.  * FUNCTION
  899.  *  list_matrix_main_menu_highlight_handler
  900.  * DESCRIPTION
  901.  *  
  902.  * PARAMETERS
  903.  *  index       [IN]        
  904.  * RETURNS
  905.  *  void
  906.  *****************************************************************************/
  907. void list_matrix_main_menu_highlight_handler(S32 index)
  908. {
  909.     /*----------------------------------------------------------------*/
  910.     /* Local Variables                                                */
  911.     /*----------------------------------------------------------------*/
  912.     S32 n_items;
  913.     U16 nMenuItemList[MAX_SUB_MENUS];
  914.     MMI_ID_TYPE mm_stringIDs[MAX_SUB_MENUS];
  915.     MMI_ID_TYPE mm_iconIDs[MAX_SUB_MENUS];
  916.     U8 *history_buffer;
  917.     list_matrix_menu_category_history *h;
  918.     /*----------------------------------------------------------------*/
  919.     /* Code Body                                                      */
  920.     /*----------------------------------------------------------------*/
  921.     GetSequenceItemIds(IDLE_SCREEN_MENU_ID, nMenuItemList);
  922.     if (nMenuItemList[index] == MAIN_MENU_FILE_MNGR_MENUID)
  923.     {
  924.         return;
  925.     }
  926.     history_buffer = GetCurrGuiBuffer(MAIN_MENU_SCREENID);
  927.     GetSequenceStringIds(nMenuItemList[index], mm_stringIDs);
  928.     GetSequenceImageIds(nMenuItemList[index], mm_iconIDs);
  929.     SetParentHandler(nMenuItemList[index]);
  930.     n_items = GetNumOfChild(nMenuItemList[index]);
  931.     MMI_matrix_highlight_handler = ExecuteCurrHiliteHandler;
  932.     ChangeTitleString((U8*) GetString(GetStringIdOfItem(nMenuItemList[index])));
  933.     MMI_title_icon = NULL;
  934.     draw_title();
  935.     if (history_buffer != NULL)
  936.     {
  937.         h = (list_matrix_menu_category_history*) history_buffer;
  938.         ShowCat414Matrix(n_items, mm_stringIDs, mm_iconIDs, MATRIX_MENU, 0, &(h->matrix_menu_history));
  939.     }
  940.     else
  941.     {
  942.         ShowCat414Matrix(n_items, mm_stringIDs, mm_iconIDs, MATRIX_MENU, 0, NULL);
  943.     }
  944. }
  945. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  946. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  947. extern U16 *GetSeqItems(U16 ParentItemId);
  948. #endif 
  949. /*****************************************************************************
  950.  * FUNCTION
  951.  *  goto_main_menu
  952.  * DESCRIPTION
  953.  *  Display the main menu.
  954.  *  
  955.  *  This a entry function for the main menu
  956.  * PARAMETERS
  957.  *  void
  958.  * RETURNS
  959.  *  void
  960.  *****************************************************************************/
  961. void goto_main_menu(void)
  962. {
  963.     /*----------------------------------------------------------------*/
  964.     /* Local Variables                                                */
  965.     /*----------------------------------------------------------------*/
  966.     MMI_ID_TYPE mm_stringIDs[MAX_MAIN_MENU_ITEMS];
  967.     MMI_ID_TYPE mm_iconIDs[MAX_MAIN_MENU_ITEMS];
  968. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  969.     MMI_ID_TYPE mm_iconID2[MAX_MAIN_MENU_ITEMS];
  970.     U16 nMenuItemList[MAX_SUB_MENUS];
  971. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  972.     U8 *history_buffer;
  973.     S32 n_items;
  974.     S32 attributes;
  975.     U8 HighlightMenu = 0;
  976.     MMI_ID_TYPE *iconList;
  977. #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
  978.     U8 menu_style = 0;
  979.     MMI_ID_TYPE mm_iconIDs_display[MAX_MAIN_MENU_ITEMS];
  980.     U8 i = 0;
  981. #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
  982. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  983.     U8 j = 0;
  984. #endif 
  985.     /*----------------------------------------------------------------*/
  986.     /* Code Body                                                      */
  987.     /*----------------------------------------------------------------*/
  988.     mmi_phb_reset_scr_id();
  989.     EntryNewScreen(MAIN_MENU_SCREENID, exit_main_menu, NULL, NULL);
  990.     history_buffer = GetCurrGuiBuffer(MAIN_MENU_SCREENID);
  991.     n_items = GetNumOfChild(IDLE_SCREEN_MENU_ID);
  992.     GetSequenceStringIds(IDLE_SCREEN_MENU_ID, mm_stringIDs);
  993.     GetSequenceImageIds(IDLE_SCREEN_MENU_ID, mm_iconIDs);
  994.     SetParentHandler(IDLE_SCREEN_MENU_ID);
  995.     attributes = GetDispAttributeOfItem(IDLE_SCREEN_MENU_ID);
  996. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  997.     GetSequenceItemIds(IDLE_SCREEN_MENU_ID, nMenuItemList);
  998. #endif 
  999.     /* MTK Leo add, for mini_tab_bar */
  1000. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  1001.     wgui_setup_mini_tab_bar(
  1002.         MMI_content_x,
  1003.         MMI_content_y,
  1004.         MMI_content_width,
  1005.         20,
  1006.         UI_COLOR_BLACK,
  1007.         UI_COLOR_RED,
  1008.         UI_COLOR_GREY,
  1009.         9 /* n_items */ ,
  1010.         GetSeqItems(IDLE_SCREEN_MENU_ID),
  1011.         NULL);
  1012.     wgui_mini_tab_bar_set_flag_on(0x00000002 /* WGUI_MINI_TAB_BAR_IN_PARENT */ );
  1013. #endif /* __MMI_WGUI_MINI_TAB_BAR__ */ 
  1014.     /* MTK Leo end */
  1015.     /* RegisterHighlightHandler(main_menu_custom_highlight_handler); */
  1016. #ifdef __MMI_DEFAULT_MAIN_MENU_HIGHLIGHT_CENTER__
  1017.     /* HighlightMenu = (n_items>>1); */
  1018.     HighlightMenu = ((n_items - 1) >> 1);   /* 022105 Calvin modified */
  1019. #endif /* __MMI_DEFAULT_MAIN_MENU_HIGHLIGHT_CENTER__ */ 
  1020. #ifdef __MMI_MAINMENU_STYLE_CHANGE_EN__
  1021.     menu_style = PhnsetGetMainMenuStyle();
  1022.     switch (menu_style)
  1023.     {
  1024.     #ifdef __MMI_MAINMENU_MATRIX_SUPPORT__  /* 071705 Calvin added */
  1025.         case PHNSET_MAINMENU_STYLE_MATRIX:
  1026.             attributes = MATRIX_MENU;
  1027.             for (i = 0; i < (MAIN_MENU_MATRIX_ICON_IMGBASE_MAX - MAIN_MENU_MATRIX_ICON_IMGBASE); i++)
  1028.             {
  1029.                 /* U16 a = mm_iconIDs[i];
  1030.                    U16 b = MAIN_MENU_ICON_IMGBASE;
  1031.                    U16 c = MAIN_MENU_MATRIX_ICON_IMGBASE;
  1032.                    U16 d = ( mm_iconIDs[i] -MAIN_MENU_ICON_IMGBASE  );
  1033.                    U16 e = MAIN_MENU_MATRIX_ICON_IMGBASE+( mm_iconIDs[i] -MAIN_MENU_ICON_IMGBASE  );
  1034.                    printf( "%d %d %d %d %d ", a, b, c, d, e ); */
  1035.                 mm_iconIDs_display[i] = MAIN_MENU_MATRIX_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
  1036.             }
  1037.             iconList = mm_iconIDs_display;
  1038.             break;
  1039.     #endif /* __MMI_MAINMENU_MATRIX_SUPPORT__ */ 
  1040.         #ifdef __MMI_MAINMENU_PAGE_SUPPORT__    /* 071705 Calvin added */
  1041.         case PHNSET_MAINMENU_STYLE_PAGE:
  1042.             attributes = PAGE_MENU;
  1043.             for (i = 0; i < (MAIN_MENU_PAGE_ICON_IMGBASE_MAX - MAIN_MENU_PAGE_ICON_IMGBASE); i++)
  1044.             {
  1045.                 mm_iconIDs_display[i] = MAIN_MENU_PAGE_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
  1046.             }
  1047.             iconList = mm_iconIDs_display;
  1048.             break;
  1049.         #endif /* __MMI_MAINMENU_PAGE_SUPPORT__ */ 
  1050.         #ifdef __MMI_MAINMENU_LIST_SUPPORT__    /* 071705 Calvin added */
  1051.         case PHNSET_MAINMENU_STYLE_LIST:
  1052.             attributes = LIST_MENU;
  1053.             for (i = 0; i < (MAIN_MENU_LIST_ICON_IMGBASE_MAX - MAIN_MENU_LIST_ICON_IMGBASE); i++)
  1054.             {
  1055.                 mm_iconIDs_display[i] = MAIN_MENU_LIST_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
  1056.             }
  1057.             iconList = mm_iconIDs_display;
  1058.             break;
  1059.         #endif /* __MMI_MAINMENU_LIST_SUPPORT__ */ 
  1060.         #ifdef __MMI_MAINMENU_CIRCULAR_SUPPORT__        /* 071705 Calvin modified */
  1061.         case PHNSET_MAINMENU_STYLE_CIRCULE:
  1062.             attributes = CIRCULAR_3D_MENU;
  1063.             for (i = 0; i < (MAIN_MENU_CIRCULAR_ICON_IMGBASE_MAX - MAIN_MENU_CIRCULAR_ICON_IMGBASE); i++)
  1064.             {
  1065.                 mm_iconIDs_display[i] = MAIN_MENU_CIRCULAR_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
  1066.             }
  1067.             iconList = mm_iconIDs_display;
  1068.             break;
  1069.         #endif /* __MMI_MAINMENU_CIRCULAR_SUPPORT__ */ 
  1070.         #ifdef __MMI_MAINMENU_ROTATE_SUPPORT__
  1071.         case PHNSET_MAINMENU_STYLE_ROTATE:
  1072.             attributes = ROTATE_MENU;
  1073.             for (i = 0; i < (MAIN_MENU_ROTATE_ICON_IMGBASE_MAX - MAIN_MENU_ROTATE_ICON_IMGBASE); i++)
  1074.             {
  1075.                 mm_iconIDs_display[i] = MAIN_MENU_ROTATE_ICON_IMGBASE + (mm_iconIDs[i] - MAIN_MENU_ICON_IMGBASE);
  1076.             }
  1077.             iconList = mm_iconIDs_display;
  1078.             break;
  1079.         #endif /* __MMI_MAINMENU_ROTATE_SUPPORT__ */ 
  1080.             /* PMT NEERAJ START 20050616 */
  1081.         #ifdef __MMI_MAINMENU_TAB_SUPPORT__     /* 071705 Calvin modified */
  1082.         case PHNSET_MAINMENU_STYLE_TAB:
  1083.         {
  1084.             register_set_tab_pane_callback(set_main_menu_tab_pane, NULL, NULL);
  1085.             show_category_one_icon_tab_pane();
  1086.             return;
  1087.         }
  1088.         #endif /* __MMI_MAINMENU_TAB_SUPPORT__ */ 
  1089.             /* PMT NEERAJ END 20050616 */
  1090.         default:
  1091.             iconList = mm_iconIDs;
  1092.             break;
  1093.     }
  1094. #else /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
  1095.     iconList = mm_iconIDs;
  1096. #endif /* __MMI_MAINMENU_STYLE_CHANGE_EN__ */ 
  1097.     /* 113004 Calvin removed if-else check */
  1098.     /*
  1099.      * if((attributes==CIRCULAR_3D_MENU)||(attributes==ROTATE_MENU))
  1100.      * RegisterHighlightHandler(ExecuteCurrHiliteHandler_Ext); //MTK JL add no key clear hilite
  1101.      * else
  1102.      * RegisterHighlightHandler(main_menu_custom_highlight_handler);
  1103.      */
  1104. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1105.     RegisterHighlightHandler(list_matrix_main_menu_highlight_handler);
  1106. #else 
  1107.     RegisterHighlightHandler(main_menu_custom_highlight_handler);
  1108. #endif 
  1109.     /* Calvin end */
  1110.     /* PMT VIKAS START 20050707 */
  1111. #ifdef __MMI_UI_DALMATIAN_SOFTKEYS__
  1112.     gui_register_button_shuffle(shuffle_draw_white);
  1113. #endif 
  1114.     /* PMT VIKAS END 20050707 */
  1115. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1116.     for (j = 0; j < 4; j++)
  1117.     {
  1118.         mm_iconID2[j] = mm_iconIDs[j] + 1;
  1119.     }
  1120. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1121. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1122.     ShowCategory414Screen(
  1123.         MAIN_MENU_TITLE_TEXT,
  1124.         MAIN_MENU_TITLE_ICON,
  1125.         STR_GLOBAL_OK,
  1126.         IMG_GLOBAL_OK,
  1127.         STR_GLOBAL_BACK,
  1128.         IMG_GLOBAL_BACK,
  1129.         n_items,
  1130.         mm_stringIDs,
  1131.         iconList,
  1132.         mm_iconID2,
  1133.         nMenuItemList,
  1134.         attributes,
  1135.         HighlightMenu,
  1136.         (U8*) history_buffer);
  1137. #else /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1138.     ShowCategory14Screen(
  1139.         MAIN_MENU_TITLE_TEXT,
  1140.         MAIN_MENU_TITLE_ICON,
  1141.         STR_GLOBAL_OK,
  1142.         IMG_GLOBAL_OK,
  1143.         STR_GLOBAL_BACK,
  1144.         IMG_GLOBAL_BACK,
  1145.         n_items,
  1146.         mm_stringIDs,
  1147.         iconList,
  1148.         attributes,
  1149.         HighlightMenu,
  1150.         (U8*) history_buffer);
  1151. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1152. #if (defined(__MMI_KEYPAD_LOCK_PATTERN_2__) && !defined(__MMI_DISABLE_KEYPAD_LOCK__))
  1153.     if (g_idle_context.ToMainMenuScrFromIdleApp == 1)
  1154.     {
  1155.         StartTimer(KEYPAD_LOCK_TIMER, KEYPAD_LOCK_TIMEOUT, IdleHandleKeypadLockProcess);
  1156.         SetKeyHandler(IdleHandlePoundKeyForKeypadLock, KEY_STAR, KEY_EVENT_UP);
  1157.     }
  1158. #endif /* (defined(__MMI_KEYPAD_LOCK_PATTERN_2__) && !defined(__MMI_DISABLE_KEYPAD_LOCK__)) */ 
  1159.     register_menu_shortcut_selected(main_menu_shortcut_executer);
  1160.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1161. }
  1162. /*****************************************************************************
  1163.  * FUNCTION
  1164.  *  exit_main_menu
  1165.  * DESCRIPTION
  1166.  *  Store the  snap shot
  1167.  *  before displaying next screen
  1168.  * PARAMETERS
  1169.  *  void
  1170.  * RETURNS
  1171.  *  void
  1172.  *****************************************************************************/
  1173. void exit_main_menu(void)
  1174. {
  1175.     /*----------------------------------------------------------------*/
  1176.     /* Local Variables                                                */
  1177.     /*----------------------------------------------------------------*/
  1178.     history main_menu_history;
  1179.     S16 nHistory = 0;
  1180.     /*----------------------------------------------------------------*/
  1181.     /* Code Body                                                      */
  1182.     /*----------------------------------------------------------------*/
  1183.     pfnUnicodeStrcpy((S8*) main_menu_history.inputBuffer, (S8*) & nHistory);
  1184.     main_menu_history.scrnID = MAIN_MENU_SCREENID;
  1185.     main_menu_history.entryFuncPtr = goto_main_menu;
  1186.     GetCategoryHistory(main_menu_history.guiBuffer);
  1187.     AddHistory(main_menu_history);
  1188. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  1189.     wgui_mini_tab_bar_set_flag_off(WGUI_MINI_TAB_BAR_IN_PARENT);
  1190. #endif 
  1191. #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__    /* Robin 1223 */
  1192.     g_idle_context.ToMainMenuScrFromIdleApp = 0;
  1193. #endif 
  1194. }
  1195. /*****************************************************************************
  1196.  * FUNCTION
  1197.  *  highlight_mainmenu_callhistory
  1198.  * DESCRIPTION
  1199.  *  
  1200.  * PARAMETERS
  1201.  *  void
  1202.  * RETURNS
  1203.  *  void
  1204.  *****************************************************************************/
  1205. void highlight_mainmenu_callhistory(void)
  1206. {
  1207.     /*----------------------------------------------------------------*/
  1208.     /* Local Variables                                                */
  1209.     /*----------------------------------------------------------------*/
  1210.     /*----------------------------------------------------------------*/
  1211.     /* Code Body                                                      */
  1212.     /*----------------------------------------------------------------*/
  1213.     /* 030705 Calvin modified */
  1214. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  1215.     if (inMatrixNoTitleFlag)
  1216.     {
  1217.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  1218.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  1219.     }
  1220.     else    /* 041105 Calvin added */
  1221.     {
  1222.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1223.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1224.     }
  1225. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1226.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1227.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1228. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1229.     SetLeftSoftkeyFunction(EntryCHISTMainMenu, KEY_EVENT_UP);
  1230.     SetRightSoftkeyFunction(handle_mainmenu_right_softkey_up, KEY_EVENT_UP);
  1231. }
  1232. /*****************************************************************************
  1233.  * FUNCTION
  1234.  *  highlight_mainmenu_multimedia
  1235.  * DESCRIPTION
  1236.  *  
  1237.  * PARAMETERS
  1238.  *  void
  1239.  * RETURNS
  1240.  *  void
  1241.  *****************************************************************************/
  1242. void highlight_mainmenu_multimedia(void)
  1243. {
  1244.     /*----------------------------------------------------------------*/
  1245.     /* Local Variables                                                */
  1246.     /*----------------------------------------------------------------*/
  1247.     /*----------------------------------------------------------------*/
  1248.     /* Code Body                                                      */
  1249.     /*----------------------------------------------------------------*/
  1250.     /* 030705 Calvin modified */
  1251. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  1252.     if (inMatrixNoTitleFlag)
  1253.     {
  1254.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  1255.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  1256.     }
  1257.     else    /* 041105 Calvin added */
  1258.     {
  1259.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1260.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1261.     }
  1262. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1263.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1264.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1265. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1266.     SetLeftSoftkeyFunction(EntryMainMultimedia, KEY_EVENT_UP);
  1267.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1268.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  1269.     {
  1270.         SetKeyHandler(EntryMainMultimedia, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1271.     }
  1272. }
  1273. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1274. /*****************************************************************************
  1275.  * FUNCTION
  1276.  *  highlight_mainmenu_avzone
  1277.  * DESCRIPTION
  1278.  *  
  1279.  * PARAMETERS
  1280.  *  void
  1281.  * RETURNS
  1282.  *  void
  1283.  *****************************************************************************/
  1284. void highlight_mainmenu_avzone(void)
  1285. {
  1286.     /*----------------------------------------------------------------*/
  1287.     /* Local Variables                                                */
  1288.     /*----------------------------------------------------------------*/
  1289.     /*----------------------------------------------------------------*/
  1290.     /* Code Body                                                      */
  1291.     /*----------------------------------------------------------------*/
  1292.     /* 030705 Calvin modified */
  1293. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  1294.     if (inMatrixNoTitleFlag)
  1295.     {
  1296.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  1297.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  1298.     }
  1299.     else    /* 041105 Calvin added */
  1300.     {
  1301.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1302.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1303.     }
  1304. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1305.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1306.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1307. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1308.     SetLeftSoftkeyFunction(EntryMainAVZone, KEY_EVENT_UP);
  1309.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1310.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  1311.     {
  1312.         SetKeyHandler(EntryMainAVZone, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1313.     }
  1314. }
  1315. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1316. /*****************************************************************************
  1317.  * FUNCTION
  1318.  *  highlight_mainmenu_filemngr
  1319.  * DESCRIPTION
  1320.  *  
  1321.  * PARAMETERS
  1322.  *  void
  1323.  * RETURNS
  1324.  *  void
  1325.  *****************************************************************************/
  1326. void highlight_mainmenu_filemngr(void)
  1327. {
  1328.     /*----------------------------------------------------------------*/
  1329.     /* Local Variables                                                */
  1330.     /*----------------------------------------------------------------*/
  1331.     /*----------------------------------------------------------------*/
  1332.     /* Code Body                                                      */
  1333.     /*----------------------------------------------------------------*/
  1334.     /* 030705 Calvin modified */
  1335. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  1336.     if (inMatrixNoTitleFlag)
  1337.     {
  1338.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  1339.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  1340.     }
  1341.     else    /* 041105 Calvin added */
  1342.     {
  1343.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1344.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1345.     }
  1346. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1347.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1348.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1349. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1350.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1351. #ifdef __MMI_FILE_MANAGER__
  1352.     SetLeftSoftkeyFunction(fmgr_launch, KEY_EVENT_UP);
  1353. #if defined(__MMI_VERSION_2__)
  1354.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  1355.     {
  1356.         SetKeyHandler(fmgr_launch, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1357.     }
  1358. #else /* defined(__MMI_VERSION_2__) */ 
  1359.     SetKeyHandler(fmgr_launch, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1360.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1361. #endif /* defined(__MMI_VERSION_2__) */ 
  1362. #else /* __MMI_FILE_MANAGER__ */ 
  1363.     SetLeftSoftkeyFunction(NULL, KEY_EVENT_UP);
  1364.     ClearKeyHandler(KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1365. #endif /* __MMI_FILE_MANAGER__ */ 
  1366. }
  1367. #if defined(__MMI_VERSION_2__)
  1368. /*****************************************************************************
  1369.  * FUNCTION
  1370.  *  highlight_mainmenu_extra
  1371.  * DESCRIPTION
  1372.  *  
  1373.  * PARAMETERS
  1374.  *  void
  1375.  * RETURNS
  1376.  *  void
  1377.  *****************************************************************************/
  1378. void highlight_mainmenu_extra(void)
  1379. {
  1380.     /*----------------------------------------------------------------*/
  1381.     /* Local Variables                                                */
  1382.     /*----------------------------------------------------------------*/
  1383.     /*----------------------------------------------------------------*/
  1384.     /* Code Body                                                      */
  1385.     /*----------------------------------------------------------------*/
  1386.     /* 030705 Calvin modified */
  1387. #ifdef __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__
  1388.     if (inMatrixNoTitleFlag)
  1389.     {
  1390.         ChangeLeftSoftkeyByStringLength(MMI_highlighted_item_text, NULL);
  1391.         ChangeRightSoftkeyByStringLength((UI_string_type) GetString(STR_GLOBAL_BACK), (PU8) GetImage(IMG_GLOBAL_BACK));
  1392.     }
  1393.     else    /* 041105 Calvin added */
  1394.     {
  1395.         ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1396.         ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1397.     }
  1398. #else /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1399.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  1400.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  1401. #endif /* __MMI_MATRIX_MAIN_MENU_FULL_BACKGROUND__ */ 
  1402.     SetLeftSoftkeyFunction(EntryMainExtra, KEY_EVENT_UP);
  1403.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1404.     if (g_pwr_context.PrevScreenIndicator != ENTER_IDLE_SCR || mmi_bootup_get_active_flight_mode() != 0)
  1405.     {
  1406.         SetKeyHandler(EntryMainExtra, KEY_RIGHT_ARROW, KEY_EVENT_UP);
  1407.     }
  1408. }
  1409. #endif /* defined(__MMI_VERSION_2__) */ 
  1410. /* Max: temporary define here, shall be moved to each application file */
  1411. #define SCR_FILE_MANAGER   FILE_MANAGER_BASE
  1412. #define SCR_MMEDIA         MMEDIA_BASE
  1413. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1414. #define  SCR_AVZONE        MMEDIA_BASE+1
  1415. #endif 
  1416. /*****************************************************************************
  1417.  * FUNCTION
  1418.  *  EntryMainMultimedia
  1419.  * DESCRIPTION
  1420.  *  
  1421.  * PARAMETERS
  1422.  *  void
  1423.  * RETURNS
  1424.  *  void
  1425.  *****************************************************************************/
  1426. void EntryMainMultimedia(void)
  1427. {
  1428.     /*----------------------------------------------------------------*/
  1429.     /* Local Variables                                                */
  1430.     /*----------------------------------------------------------------*/
  1431.     U16 ItemList[MAX_SUB_MENUS];
  1432.     U16 ItemIcons[MAX_SUB_MENUS];
  1433.     U16 nItems;
  1434.     U8 *guiBuffer;
  1435.     /*----------------------------------------------------------------*/
  1436.     /* Code Body                                                      */
  1437.     /*----------------------------------------------------------------*/
  1438.     EntryNewScreen(SCR_MMEDIA, NULL, EntryMainMultimedia, NULL);
  1439.     guiBuffer = GetCurrGuiBuffer(SCR_MMEDIA);
  1440.     nItems = GetNumOfChild(MAIN_MENU_MULTIMEDIA_MENUID);
  1441.     GetSequenceStringIds(MAIN_MENU_MULTIMEDIA_MENUID, ItemList);
  1442.     GetSequenceImageIds(MAIN_MENU_MULTIMEDIA_MENUID, ItemIcons);
  1443.     SetParentHandler(MAIN_MENU_MULTIMEDIA_MENUID);
  1444.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1445. #if defined(__MMI_VRSD__) || defined(__MMI_VRSI__)
  1446.     /* No SIM, remove voice dial menu items */
  1447.     if (mmi_bootup_is_sim_valid() == MMI_FALSE)
  1448.     {
  1449.         nItems -= 1;
  1450.     }
  1451. #endif /* defined(__MMI_VRSD__) || defined(__MMI_VRSI__) */ 
  1452. #if defined(__MMI_PHB_CALLER_RES_SETTING__)
  1453.     /* No SIM, remove caller picture menu items */
  1454.     if (mmi_bootup_is_sim_valid() == MMI_FALSE)
  1455.     {
  1456.         S32 MenuItemId;
  1457.         MenuItemId = GetChildMenuIDIndexByParentMenuID(MAIN_MENU_MULTIMEDIA_MENUID, MENU_ID_PHB_CALLER_PIC_1);
  1458.         if (MenuItemId != -1)   /* Menu Exists. */
  1459.         {
  1460.             nItems -= 1;
  1461.         }
  1462.     }
  1463. #endif /* defined(__MMI_PHB_CALLER_RES_SETTING__) */ 
  1464. #if defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__)
  1465.     RegisterHighlightHandler(mmi_fmrdo_skip_highlight_hdlr);
  1466.     nItems = mmi_fmrdo_check_chip_or_hide(nItems, ItemList, ItemIcons);
  1467. #else /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  1468.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1469. #endif /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  1470.     /* MTK Leo add, mini_tab_bar */
  1471. #ifdef __MMI_WGUI_MINI_TAB_BAR__
  1472.     wgui_enable_mini_tab_bar(MAIN_MENU_MULTIMEDIA_MENUID);
  1473. #endif 
  1474.     /* MTK Leo end */
  1475.     ShowCategory52Screen(
  1476.         MAIN_MENU_MMEDIA_TEXT,
  1477.         MAIN_MENU_TITLE_MULTIMEDIA_ICON,
  1478.         STR_GLOBAL_OK,
  1479.         IMG_GLOBAL_OK,
  1480.         STR_GLOBAL_BACK,
  1481.         IMG_GLOBAL_BACK,
  1482.         nItems,
  1483.         ItemList,
  1484.         ItemIcons,
  1485.         0,
  1486.         0,
  1487.         0,
  1488.         guiBuffer);
  1489.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1490.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1491. }
  1492. /*****************************************************************************
  1493.  * FUNCTION
  1494.  *  EntryMainFileMngr
  1495.  * DESCRIPTION
  1496.  *  
  1497.  * PARAMETERS
  1498.  *  void
  1499.  * RETURNS
  1500.  *  void
  1501.  *****************************************************************************/
  1502. void EntryMainFileMngr(void)
  1503. {
  1504.     /*----------------------------------------------------------------*/
  1505.     /* Local Variables                                                */
  1506.     /*----------------------------------------------------------------*/
  1507.     /*----------------------------------------------------------------*/
  1508.     /* Code Body                                                      */
  1509.     /*----------------------------------------------------------------*/
  1510.     /* shall be implemented later */
  1511. }
  1512. /*****************************************************************************
  1513.  * FUNCTION
  1514.  *  ExitMainFileMngr
  1515.  * DESCRIPTION
  1516.  *  
  1517.  * PARAMETERS
  1518.  *  void
  1519.  * RETURNS
  1520.  *  void
  1521.  *****************************************************************************/
  1522. void ExitMainFileMngr(void)
  1523. {
  1524.     /*----------------------------------------------------------------*/
  1525.     /* Local Variables                                                */
  1526.     /*----------------------------------------------------------------*/
  1527.     /*----------------------------------------------------------------*/
  1528.     /* Code Body                                                      */
  1529.     /*----------------------------------------------------------------*/
  1530.     /* shall be implemented later */
  1531. }
  1532. #if defined(__MMI_VERSION_2__)
  1533. /*****************************************************************************
  1534.  * FUNCTION
  1535.  *  EntryMainExtra
  1536.  * DESCRIPTION
  1537.  *  
  1538.  * PARAMETERS
  1539.  *  void
  1540.  * RETURNS
  1541.  *  void
  1542.  *****************************************************************************/
  1543. void EntryMainExtra(void)
  1544. {
  1545.     /*----------------------------------------------------------------*/
  1546.     /* Local Variables                                                */
  1547.     /*----------------------------------------------------------------*/
  1548.     U16 ItemList[MAX_SUB_MENUS];
  1549.     U16 ItemIcons[MAX_SUB_MENUS];
  1550.     U16 nItems;
  1551.     U8 *guiBuffer;
  1552.     U8 i = 0, j = 0;
  1553.     /*----------------------------------------------------------------*/
  1554.     /* Code Body                                                      */
  1555.     /*----------------------------------------------------------------*/
  1556.     EntryNewScreen(SCR_EXTRA, NULL, EntryMainExtra, NULL);
  1557.     guiBuffer = GetCurrGuiBuffer(SCR_EXTRA);
  1558.     nItems = GetNumOfChild(MAIN_MENU_EXTRA_MENUID);
  1559.     GetSequenceStringIds(MAIN_MENU_EXTRA_MENUID, ItemList);
  1560.     GetSequenceImageIds(MAIN_MENU_EXTRA_MENUID, ItemIcons);
  1561.     SetParentHandler(MAIN_MENU_EXTRA_MENUID);
  1562.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1563. #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) || defined(__MMI_IRDA_SUPPORT__)
  1564.     /* flight mode, Remove Infrared and Bluetooth menu */
  1565.     if (mmi_bootup_get_active_flight_mode())
  1566.     {
  1567.         i = 0;
  1568.         j = 0;
  1569.         while (i < nItems && j < nItems)
  1570.         {
  1571.             if (ItemList[i] == STR_IRDA_MENU_TITLE || ItemList[i] == STR_BT_MENU_TITLE)
  1572.             {
  1573.                 j++;
  1574.                 continue;
  1575.             }
  1576.             ItemList[i] = ItemList[j];
  1577.             i++;
  1578.             j++;
  1579.         }
  1580.         nItems = i;
  1581.     }
  1582. #ifdef __MMI_BT_HP_SUPPORT__
  1583.     else if(mmi_bootup_is_sim_valid() == MMI_FALSE)
  1584.     {
  1585.         i = 0;
  1586.         j = 0;
  1587.         while (i < nItems && j < nItems)
  1588.         {
  1589.             if (ItemList[i] == STR_BT_MENU_TITLE )
  1590.             {
  1591.                 j++;
  1592.                 continue;
  1593.             }
  1594.             ItemList[i] = ItemList[j];
  1595.             i++;
  1596.             j++;
  1597.         }
  1598.         nItems = i;
  1599.     }
  1600. #endif
  1601. #endif
  1602.       
  1603.     ShowCategory52Screen(
  1604.         MAIN_MENU_EXTRA_TEXT,
  1605.         MAIN_MENU_TITLE_EXTRA_APP_ICON,
  1606.         STR_GLOBAL_OK,
  1607.         IMG_GLOBAL_OK,
  1608.         STR_GLOBAL_BACK,
  1609.         IMG_GLOBAL_BACK,
  1610.         nItems,
  1611.         ItemList,
  1612.         ItemIcons,
  1613.         0,
  1614.         0,
  1615.         0,
  1616.         guiBuffer);
  1617.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1618.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1619. }
  1620. #ifdef __MMI_BI_DEGREE_MAIN_MENU_STYLE__
  1621. /*****************************************************************************
  1622.  * FUNCTION
  1623.  *  EntryMainAVZone
  1624.  * DESCRIPTION
  1625.  *  
  1626.  * PARAMETERS
  1627.  *  void
  1628.  * RETURNS
  1629.  *  void
  1630.  *****************************************************************************/
  1631. void EntryMainAVZone(void)
  1632. {
  1633.     /*----------------------------------------------------------------*/
  1634.     /* Local Variables                                                */
  1635.     /*----------------------------------------------------------------*/
  1636.     U16 ItemList[MAX_SUB_MENUS];
  1637.     U16 ItemIcons[MAX_SUB_MENUS];
  1638.     U16 nItems;
  1639.     U8 *guiBuffer;
  1640.     /*----------------------------------------------------------------*/
  1641.     /* Code Body                                                      */
  1642.     /*----------------------------------------------------------------*/
  1643.     EntryNewScreen(SCR_AVZONE, NULL, EntryMainAVZone, NULL);
  1644.     guiBuffer = GetCurrGuiBuffer(SCR_AVZONE);
  1645.     nItems = GetNumOfChild(MAIN_MENU_OPTION_AVZONE_MENUID);
  1646.     GetSequenceStringIds(MAIN_MENU_OPTION_AVZONE_MENUID, ItemList);
  1647.     GetSequenceImageIds(MAIN_MENU_OPTION_AVZONE_MENUID, ItemIcons);
  1648.     SetParentHandler(MAIN_MENU_OPTION_AVZONE_MENUID);
  1649.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1650. #if defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__)
  1651.     RegisterHighlightHandler(mmi_fmrdo_skip_highlight_hdlr);
  1652.     nItems = mmi_fmrdo_check_chip_or_hide(nItems, ItemList, ItemIcons);
  1653. #else /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  1654.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1655. #endif /* defined(__MMI_FM_RADIO__) && defined(__MMI_FM_RADIO_CHECK_CHIP_OR_HIDE__) */ 
  1656.     /*
  1657.      * //MTK Leo add, mini_tab_bar
  1658.      * #ifdef __MMI_WGUI_MINI_TAB_BAR__
  1659.      * wgui_enable_mini_tab_bar(MAIN_MENU_AVZONE_MENU_ID);
  1660.      * #endif
  1661.      * //MTK Leo end
  1662.      */
  1663.     ShowCategory52Screen(
  1664.         MAIN_MENU_AVZONE_TEXT,
  1665.         MAIN_MENU_TITLE_MULTIMEDIA_ICON,
  1666.         STR_GLOBAL_OK,
  1667.         IMG_GLOBAL_OK,
  1668.         STR_GLOBAL_BACK,
  1669.         IMG_GLOBAL_BACK,
  1670.         nItems,
  1671.         ItemList,
  1672.         ItemIcons,
  1673.         0,
  1674.         0,
  1675.         0,
  1676.         guiBuffer);
  1677.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1678.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1679. }
  1680. #endif /* __MMI_BI_DEGREE_MAIN_MENU_STYLE__ */ 
  1681. #endif /* defined(__MMI_VERSION_2__) */