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

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.  * Extra.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file implements main menu screen of Extra applications.
  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.  *------------------------------------------------------------------------------
  92.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  93.  *============================================================================
  94.  ****************************************************************************/
  95. #ifndef _MMI_EXTRA_C
  96. #define _MMI_EXTRA_C
  97. /*  Include: MMI header file */
  98. #include "stdC.h"
  99. #include "MMI_Features.h"
  100. #include "L4Dr.h"
  101. #include "L4Dr1.h"
  102. #include "MMI_features.h"
  103. #include "wgui_categories.h"
  104. #include "CustDataRes.h"
  105. #include "GlobalDefs.h"
  106. #include "HistoryGprot.h"
  107. #include "Unicodexdcl.h"
  108. #include "MainMenuDef.h"
  109. #include "CustMenuRes.h"
  110. #include "ExtraDef.h"
  111. #include "Calculator.h" /* for calculator */
  112. #include "unitconvertor.h"      /* for converters */
  113. #include "Calorie.h"    /* for health */
  114. #include "Bmi.h"
  115. #include "Healthmenstural.h"
  116. #include "SettingGprots.h"      /* for aphorism */
  117. #include "SettingProt.h"
  118. #include "SimDetectionGexdcl.h"
  119. #include "MessagesExDcl.h"
  120. #include "PopulateRes.h"
  121. #if defined (__MMI_CURRENCY_CONVERTER__)
  122. #include "currencyconvertor.h"
  123. #elif defined (__MMI_EXTENDED_CURRENCY_CONVERTER__)
  124. #include "CurrencyConvertorE.h"
  125. #endif 
  126. #if defined (__MMI_EBOOK_READER__)
  127. #include "FileManagerGprot.h"
  128. #include "EbookGprot.h"
  129. #include "EbookProt.h"
  130. #endif 
  131. #ifdef __MMI_MESSAGES_CLUB__
  132. #include "SATGProts.h"
  133. #endif 
  134. #ifdef __MMI_DICTIONARY__
  135. #include "DictionaryMain.h"
  136. #endif 
  137. /* 
  138.  * Define
  139.  */
  140. // #define APR_TEXT_CHARCTERS           3
  141. /* 
  142.  * Typedef 
  143.  */
  144. /* 
  145.  * Local Variable
  146.  */
  147. /* 
  148.  * Local Function
  149.  */
  150. #if defined(__MMI_BMI__) || defined(__MMI_CALORIE__) || defined(__MMI_MENSTRUAL__)
  151. void EntryExtraHealthApp(void);
  152. void HighlightExtraHealthMenu(void);
  153. #endif /* defined(__MMI_BMI__) || defined(__MMI_CALORIE__) || defined(__MMI_MENSTRUAL__) */ 
  154. /* 
  155.  * Global Variable
  156.  */
  157. extern U16 gIndexIconsImageList[];
  158. #if defined(__MMI_APHORISM__)
  159. /* under construction !*/
  160. #endif 
  161. /* 
  162.  * Global Function
  163.  */
  164. #if defined(__MMI_BMI__) || defined(__MMI_CALORIE__) || defined(__MMI_MENSTRUAL__)
  165. /*****************************************************************************
  166.  * FUNCTION
  167.  *  EntryExtraHealthApp
  168.  * DESCRIPTION
  169.  *  Display list of health applications.
  170.  * PARAMETERS
  171.  *  void
  172.  * RETURNS
  173.  *  void
  174.  *****************************************************************************/
  175. void EntryExtraHealthApp(void)
  176. {
  177.     /*----------------------------------------------------------------*/
  178.     /* Local Variables                                                */
  179.     /*----------------------------------------------------------------*/
  180.     U8 *guiBuffer;
  181.     U16 nStrItemList[3];
  182.     U16 nNumofItem;
  183.     /*----------------------------------------------------------------*/
  184.     /* Code Body                                                      */
  185.     /*----------------------------------------------------------------*/
  186.     EntryNewScreen(SCR_HEALTH_MENU, NULL, EntryExtraHealthApp, NULL);
  187.     guiBuffer = GetCurrGuiBuffer(SCR_HEALTH_MENU);
  188.     nNumofItem = GetNumOfChild(EXTRA_HEALTH_MENU);
  189.     GetSequenceStringIds(EXTRA_HEALTH_MENU, nStrItemList);
  190.     SetParentHandler(EXTRA_HEALTH_MENU);
  191.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  192.     ShowCategory15Screen(
  193.         STR_SCR_HEALTH_CAPTION,
  194.         GetRootTitleIcon(EXTRA_HEALTH_MENU),
  195.         STR_GLOBAL_OK,
  196.         IMG_GLOBAL_OK,
  197.         STR_GLOBAL_BACK,
  198.         IMG_GLOBAL_BACK,
  199.         nNumofItem,
  200.         nStrItemList,
  201.         gIndexIconsImageList,
  202.         LIST_MENU,
  203.         0,
  204.         guiBuffer);
  205.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  206.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  207. }
  208. /*****************************************************************************
  209.  * FUNCTION
  210.  *  HighlightExtraHealthMenu
  211.  * DESCRIPTION
  212.  *  Highlight handler of Health menu item.
  213.  *  Register key handlers.
  214.  * PARAMETERS
  215.  *  void
  216.  * RETURNS
  217.  *  void
  218.  *****************************************************************************/
  219. void HighlightExtraHealthMenu(void)
  220. {
  221.     /*----------------------------------------------------------------*/
  222.     /* Local Variables                                                */
  223.     /*----------------------------------------------------------------*/
  224.     /*----------------------------------------------------------------*/
  225.     /* Code Body                                                      */
  226.     /*----------------------------------------------------------------*/
  227.     ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
  228.     ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
  229.     SetLeftSoftkeyFunction(EntryExtraHealthApp, KEY_EVENT_UP);
  230.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  231.     SetKeyHandler(EntryExtraHealthApp, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  232.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  233. }
  234. #endif /* defined(__MMI_BMI__) || defined(__MMI_CALORIE__) || defined(__MMI_MENSTRUAL__) */ 
  235. /*****************************************************************************
  236.  * FUNCTION
  237.  *  ExtraInit
  238.  * DESCRIPTION
  239.  *  Initialize each applications in Extra.
  240.  * PARAMETERS
  241.  *  void
  242.  * RETURNS
  243.  *  void
  244.  *****************************************************************************/
  245. void ExtraInit(void)
  246. {
  247.     /*----------------------------------------------------------------*/
  248.     /* Local Variables                                                */
  249.     /*----------------------------------------------------------------*/
  250.     /*----------------------------------------------------------------*/
  251.     /* Code Body                                                      */
  252.     /*----------------------------------------------------------------*/
  253.     /* calucartor */
  254. #if defined (__MMI_CALCULATOR__)
  255.     CalcInit();
  256. #endif 
  257.     /* unit converter */
  258. #if defined (__MMI_UNIT_CONVERTER__) || defined (__MMI_EXTENDED_UNIT_CONVERTER__)
  259.     UconvInit();
  260. #endif 
  261.     /* currency converter (extended version) */
  262. #if defined (__MMI_CURRENCY_CONVERTER__)
  263.     CconvInit();
  264. #elif defined (__MMI_EXTENDED_CURRENCY_CONVERTER__)
  265.     mmi_cconv_init();
  266. #endif 
  267.     /* health */
  268. #if defined(__MMI_BMI__) || defined(__MMI_CALORIE__) || defined(__MMI_MENSTRUAL__)
  269.     SetHiliteHandler(EXTRA_HEALTH_MENU, HighlightExtraHealthMenu);
  270. #endif 
  271.     /* bmi */
  272. #if defined(__MMI_BMI__)
  273.     SetHiliteHandler(EXTRA_HEALTH_MENU_BMI, HighlightBMIMenu);
  274. #endif 
  275.     /* menstrual */
  276. #if defined(__MMI_MENSTRUAL__)
  277.     MensInit();
  278. #endif 
  279.     /* calorie */
  280. #if defined(__MMI_CALORIE__)
  281. /* under construction !*/
  282. #endif 
  283.     /* aphorism */
  284. #if defined(__MMI_APHORISM__)
  285. /* under construction !*/
  286. #endif 
  287. #if defined (__MMI_EBOOK_READER__)
  288.     InitEbookApp();
  289.     SetHiliteHandler(MAIN_MENU_EBOOK_MENUID, highlight_mainmenu_ebook);
  290. #endif /* defined (__MMI_EBOOK_READER__) */ 
  291. #if defined(__MMI_DICTIONARY__)
  292.     mmi_dictionary_init();
  293. #endif 
  294. }
  295. /*****************************************************************************
  296. * FUNCTION
  297. *  ExtraDeInit
  298. * DESCRIPTION
  299. *   Deinitialize each application of Extra
  300. * PARAMETERS
  301. *  None.
  302. * RETURNS
  303. *  None.
  304. * GLOBALS AFFECTED
  305. *  None
  306. *****************************************************************************/
  307. /*
  308.  * void ExtraDeInit(void)
  309.  * {  
  310.  * #if defined(__MMI_CALENDAR__)
  311.  * ClndrDeInit();
  312.  * #endif
  313.  * 
  314.  * #if defined (__MMI_CALCULATOR__)
  315.  * //CalcDeInit();
  316.  * #endif
  317.  * 
  318.  * // currency converter (extended version) 
  319.  * #if defined (__MMI_CURRENCY_CONVERTER__)
  320.  * CconvDeInit();
  321.  * #elif defined (__MMI_EXTENDED_CURRENCY_CONVERTER__)
  322.  * //mmi_cconv_deinit();
  323.  * #endif
  324.  * 
  325.  * #if defined (__MMI_UNIT_CONVERTER__) || defined(__MMI_EXTENDED_UNIT_CONVERTER__)
  326.  * //UconvDeInit();
  327.  * #endif
  328.  * 
  329.  * #if defined(__MMI_BMI__)
  330.  * BmiDeInit();
  331.  * #endif
  332.  * 
  333.  * #if defined(__MMI_MENSTRUAL__)
  334.  * MensDeInit();
  335.  * #endif
  336.  * 
  337.  * #if defined(__MMI_CALORIE__)
  338.  * CaleDeInit();
  339.  * #endif   
  340.  * }
  341.  */
  342. #if defined(__MMI_APHORISM__)
  343. /* under construction !*/
  344. /* under construction !*/
  345. /* under construction !*/
  346. /* under construction !*/
  347. /* under construction !*/
  348. /* under construction !*/
  349. /* under construction !*/
  350. /* under construction !*/
  351. /* under construction !*/
  352. /* under construction !*/
  353. /* under construction !*/
  354. /* under construction !*/
  355. /* under construction !*/
  356. /* under construction !*/
  357. /* under construction !*/
  358. /* under construction !*/
  359. /* under construction !*/
  360. /* under construction !*/
  361. /* under construction !*/
  362. /* under construction !*/
  363. /* under construction !*/
  364. /* under construction !*/
  365. /* under construction !*/
  366. /* under construction !*/
  367. /* under construction !*/
  368. /* under construction !*/
  369. /* under construction !*/
  370. /* under construction !*/
  371. /* under construction !*/
  372. /* under construction !*/
  373. #endif /* defined(__MMI_APHORISM__) */ 
  374. #if defined(__MMI_EBOOK_READER__)
  375. /*****************************************************************************
  376.  * FUNCTION
  377.  *  highlight_mainmenu_ebook
  378.  * DESCRIPTION
  379.  *  
  380.  * PARAMETERS
  381.  *  void
  382.  * RETURNS
  383.  *  void
  384.  *****************************************************************************/
  385. void highlight_mainmenu_ebook(void)
  386. {
  387.     /*----------------------------------------------------------------*/
  388.     /* Local Variables                                                */
  389.     /*----------------------------------------------------------------*/
  390.     /*----------------------------------------------------------------*/
  391.     /* Code Body                                                      */
  392.     /*----------------------------------------------------------------*/
  393.     SetLeftSoftkeyFunction(ebr_entry_book_shel_screen, KEY_EVENT_UP);
  394.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  395. SetKeyHandler(ebr_entry_book_shel_screen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  396.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  397.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  398. }
  399. #endif /* defined(__MMI_EBOOK_READER__) */ 
  400. #endif /* _MMI_EXTRA_C */ // #ifndef _MMI_EXTRA_C