worldclock.h
上传用户: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.  * Filename:
  37.  * ---------
  38.  * Worldclock.h
  39.  *
  40.  * Project:
  41.  * --------
  42.  * MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  * This file is defines constant, enum value, structure, and function prototype for world clock.
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52.  *==============================================================================
  53.  *             HISTORY
  54.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  55.  *------------------------------------------------------------------------------
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  * removed!
  91.  * removed!
  92.  * removed!
  93.  *
  94.  *------------------------------------------------------------------------------
  95.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  96.  *==============================================================================
  97.  *******************************************************************************/
  98. /**
  99.  * Copyright Notice
  100.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  101.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  102.  *  (It is illegal to remove this copyright notice from this software or any
  103.  *  portion of it)
  104.  */
  105. /**********************************************************************************
  106.    Filename:      worldclock.h
  107.    Author:        Vandana M
  108.    Date Created:  July-14-2003
  109.    Contains:      WorldClock
  110. **********************************************************************************/
  111. #ifndef _MMI_WORLDCLOCK_H
  112. #define _MMI_WORLDCLOCK_H
  113. #define __MMI_WORLDCLOCK_DST__
  114. #include "MMI_features.h"
  115. #include "PixtelDataTypes.h"
  116. #include "Gui_data_types.h"
  117. /* 
  118.  * Define
  119.  */
  120. /* 
  121.  * Typedef 
  122.  */
  123. typedef struct
  124. {
  125.     FLOAT CityTimeZone; /* time difference */
  126.     U16 CityName;       /* city name in English. */
  127.     U16 CityAbbr;       /* abbreviation name of city. */
  128.     U8 CityX;           /* the X coordinate of city. */
  129.     U8 CityY;           /* the Y coordinate of city. */
  130.     U8 MapIndex;
  131. } TimeZoneStruct;
  132. typedef struct
  133. {
  134. #ifndef __MMI_WC_TZ_SUPPORT__
  135.     bitmap *VLine;      /* bitmap object to store the image of vertical and horizontal line */
  136.     bitmap *HLine;
  137. #else
  138.     FLOAT CurrTZ;
  139. #endif
  140.     U8 CurrMap;         /* index of current image map */
  141.     U8 CurrCityIndex;   /* index of current selected city in world map */
  142. #if defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__)
  143.     U8 CurrHiliteSublcd;
  144.     U8 CurrHiliteCity;  /* for multitap selection of cities */
  145.     U8 City1;
  146.     U8 City2;
  147. #endif /* defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__) */ 
  148. #ifdef __MMI_WORLDCLOCK_DST__
  149.     U8 DSTForeign;
  150. #endif 
  151.     S32 arrow_width, arrow_height;
  152. #ifdef __MMI_TOUCH_SCREEN__
  153.     U32 event_on_object;
  154. #endif 
  155. } wc_context_struct;
  156. typedef enum
  157. {
  158.     ORGANIZER_MENU_WORLDCLOCK_IMAGEID = WORLD_CLOCK + 1,
  159.     WORLD_CLOCK_IMAGE1,
  160.     WORLD_CLOCK_IMAGE2,
  161.     WORLD_CLOCK_IMAGE3,
  162.     SUN_ICON,
  163.     MOON_ICON,
  164.     WORLD_CLOCK_LEFT_ARROW_UP,
  165.     WORLD_CLOCK_LEFT_ARROW_DOWN,
  166.     WORLD_CLOCK_RIGHT_ARROW_UP,
  167.     WORLD_CLOCK_RIGHT_ARROW_DOWN
  168. } WC_IMG_ID_ENUM;
  169. typedef enum
  170. {
  171.     STR_WCLOCK_CITY_NONE = WORLD_CLOCK + 1,
  172.     STR_WCLOCK_CITY1,
  173.     STR_WCLOCK_CITY2,
  174.     STR_WCLOCK_CITY3,
  175.     STR_WCLOCK_CITY4,
  176.     STR_WCLOCK_CITY5,
  177.     STR_WCLOCK_CITY6,
  178.     STR_WCLOCK_CITY7,
  179.     STR_WCLOCK_CITY8,
  180.     STR_WCLOCK_CITY9,
  181.     STR_WCLOCK_CITY10,
  182.     STR_WCLOCK_CITY11,
  183.     STR_WCLOCK_CITY12,
  184.     STR_WCLOCK_CITY13,
  185.     STR_WCLOCK_CITY14,
  186.     STR_WCLOCK_CITY15,
  187.     STR_WCLOCK_CITY16,
  188.     STR_WCLOCK_CITY17,
  189.     STR_WCLOCK_CITY18,
  190.     STR_WCLOCK_CITY19,
  191.     STR_WCLOCK_CITY20,
  192.     STR_WCLOCK_CITY21,
  193.     STR_WCLOCK_CITY22,
  194.     STR_WCLOCK_CITY23,
  195.     STR_WCLOCK_CITY24,
  196.     STR_WCLOCK_CITY25,
  197.     STR_WCLOCK_CITY26,
  198.     STR_WCLOCK_CITY27,
  199.     STR_WCLOCK_CITY28,
  200.     STR_WCLOCK_CITY29,
  201.     STR_WCLOCK_CITY30,
  202.     STR_WCLOCK_CITY31,
  203.     STR_WCLOCK_CITY32,
  204.     STR_WCLOCK_CITY33,
  205.     STR_WCLOCK_CITY34,
  206.     STR_WCLOCK_CITY35,
  207.     STR_WCLOCK_CITY36,
  208.     STR_WCLOCK_CITY37,
  209.     STR_WCLOCK_CITY38,
  210.     STR_WCLOCK_CITY39,
  211.     STR_WCLOCK_CITY40,
  212.     STR_WCLOCK_CITY41,
  213.     STR_WCLOCK_CITY42,
  214.     STR_WCLOCK_CITY43,
  215.     STR_WCLOCK_CITY44,
  216.     STR_WCLOCK_CITY45,
  217.     STR_WCLOCK_CITY46,
  218.     STR_WCLOCK_CITY47,
  219.     STR_WCLOCK_CITY48,
  220.     STR_WCLOCK_CITY49,
  221.     STR_WCLOCK_CITY50,
  222.     STR_WCLOCK_CITY51,
  223.     STR_WCLOCK_CITY52,
  224.     STR_WCLOCK_CITY53,
  225.     STR_WCLOCK_CITY54,
  226.     STR_WCLOCK_CITY55,
  227.     STR_WCLOCK_CITY56,
  228.     STR_WCLOCK_CITY57,
  229.     STR_WCLOCK_CITY58,
  230.     STR_WCLOCK_CITY59,
  231.     STR_WCLOCK_CITY60,
  232.     STR_WCLOCK_CITY61,
  233.     STR_WCLOCK_CITY62,
  234.     STR_WCLOCK_CITY63,
  235.     STR_WCLOCK_CITY64,
  236.     STR_WCLOCK_CITY65,
  237.     STR_WCLOCK_CITY66,
  238.     STR_WCLOCK_CITY67,
  239.     STR_WCLOCK_CITY68,
  240.     STR_WCLOCK_CITY69,
  241.     STR_WCLOCK_CITY70,
  242.     STR_WCLOCK_CITY71,
  243.     STR_WCLOCK_CITY72,
  244.     STR_WCLOCK_CITY73,
  245.     STR_WCLOCK_CITY74,    
  246.     STR_WCLOCK_CITY75,    
  247.     STR_WCLOCK_CITY76,    
  248.     STR_WCLOCK_CITY77,    
  249.     STR_TOTAL_NUM_CITY,
  250.     STR_WCLOCK_CITY_ABBRE_NONE,
  251.     STR_WCLOCK_CITY_ABBRE1,
  252.     STR_WCLOCK_CITY_ABBRE2,
  253.     STR_WCLOCK_CITY_ABBRE3,
  254.     STR_WCLOCK_CITY_ABBRE4,
  255.     STR_WCLOCK_CITY_ABBRE5,
  256.     STR_WCLOCK_CITY_ABBRE6,
  257.     STR_WCLOCK_CITY_ABBRE7,
  258.     STR_WCLOCK_CITY_ABBRE8,
  259.     STR_WCLOCK_CITY_ABBRE9,
  260.     STR_WCLOCK_CITY_ABBRE10,
  261.     STR_WCLOCK_CITY_ABBRE11,
  262.     STR_WCLOCK_CITY_ABBRE12,
  263.     STR_WCLOCK_CITY_ABBRE13,
  264.     STR_WCLOCK_CITY_ABBRE14,
  265.     STR_WCLOCK_CITY_ABBRE15,
  266.     STR_WCLOCK_CITY_ABBRE16,
  267.     STR_WCLOCK_CITY_ABBRE17,
  268.     STR_WCLOCK_CITY_ABBRE18,
  269.     STR_WCLOCK_CITY_ABBRE19,
  270.     STR_WCLOCK_CITY_ABBRE20,
  271.     STR_WCLOCK_CITY_ABBRE21,
  272.     STR_WCLOCK_CITY_ABBRE22,
  273.     STR_WCLOCK_CITY_ABBRE23,
  274.     STR_WCLOCK_CITY_ABBRE24,
  275.     STR_WCLOCK_CITY_ABBRE25,
  276.     STR_WCLOCK_CITY_ABBRE26,
  277.     STR_WCLOCK_CITY_ABBRE27,
  278.     STR_WCLOCK_CITY_ABBRE28,
  279.     STR_WCLOCK_CITY_ABBRE29,
  280.     STR_WCLOCK_CITY_ABBRE30,
  281.     STR_WCLOCK_CITY_ABBRE31,
  282.     STR_WCLOCK_CITY_ABBRE32,
  283.     STR_WCLOCK_CITY_ABBRE33,
  284.     STR_WCLOCK_CITY_ABBRE34,
  285.     STR_WCLOCK_CITY_ABBRE35,
  286.     STR_WCLOCK_CITY_ABBRE36,
  287.     STR_WCLOCK_CITY_ABBRE37,
  288.     STR_WCLOCK_CITY_ABBRE38,
  289.     STR_WCLOCK_CITY_ABBRE39,
  290.     STR_WCLOCK_CITY_ABBRE40,
  291.     STR_WCLOCK_CITY_ABBRE41,
  292.     STR_WCLOCK_CITY_ABBRE42,
  293.     STR_WCLOCK_CITY_ABBRE43,
  294.     STR_WCLOCK_CITY_ABBRE44,
  295.     STR_WCLOCK_CITY_ABBRE45,
  296.     STR_WCLOCK_CITY_ABBRE46,
  297.     STR_WCLOCK_CITY_ABBRE47,
  298.     STR_WCLOCK_CITY_ABBRE48,
  299.     STR_WCLOCK_CITY_ABBRE49,
  300.     STR_WCLOCK_CITY_ABBRE50,
  301.     STR_WCLOCK_CITY_ABBRE51,
  302.     STR_WCLOCK_CITY_ABBRE52,
  303.     STR_WCLOCK_CITY_ABBRE53,
  304.     STR_WCLOCK_CITY_ABBRE54,
  305.     STR_WCLOCK_CITY_ABBRE55,
  306.     STR_WCLOCK_CITY_ABBRE56,
  307.     STR_WCLOCK_CITY_ABBRE57,
  308.     STR_WCLOCK_CITY_ABBRE58,
  309.     STR_WCLOCK_CITY_ABBRE59,
  310.     STR_WCLOCK_CITY_ABBRE60,
  311.     STR_WCLOCK_CITY_ABBRE61,
  312.     STR_WCLOCK_CITY_ABBRE62,
  313.     STR_WCLOCK_CITY_ABBRE63,
  314.     STR_WCLOCK_CITY_ABBRE64,
  315.     STR_WCLOCK_CITY_ABBRE65,
  316.     STR_WCLOCK_CITY_ABBRE66,
  317.     STR_WCLOCK_CITY_ABBRE67,
  318.     STR_WCLOCK_CITY_ABBRE68,
  319.     STR_WCLOCK_CITY_ABBRE69,
  320.     STR_WCLOCK_CITY_ABBRE70,
  321.     STR_WCLOCK_CITY_ABBRE71,
  322.     STR_WCLOCK_CITY_ABBRE72,
  323.     STR_WCLOCK_CITY_ABBRE73,
  324.     STR_WCLOCK_CITY_ABBRE74,
  325.     STR_WCLOCK_CITY_ABBRE75,
  326.     STR_WCLOCK_CITY_ABBRE76,
  327.     STR_WCLOCK_CITY_ABBRE77,
  328.     STR_WORLD_CLOCK_TITLE,
  329.     STR_WORLD_CLOCK_MENU1,
  330. #if defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__)
  331.     STR_WORLD_CLOCK_MENU2,
  332.     STR_WORLD_CLOCK_CITY1,
  333.     STR_WORLD_CLOCK_CITY2,
  334.     STR_WORLD_SELECT_CITY,
  335. #endif /* defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__) */ 
  336. #ifdef __MMI_WORLDCLOCK_DST__
  337.     STR_WORLD_CLOCK_DST_FOREIGN,
  338.     STR_WORLD_CLOCL_DST_TITLE,
  339. #endif /* __MMI_WORLDCLOCK_DST__ */ 
  340. #ifdef __MMI_WC_TZ_SUPPORT__
  341.     STR_WORLD_CLOCK_LOCAL,
  342.     STR_WORLD_CLOCK_GMT,
  343. #endif /* __MMI_WORLDCLOCK_DST__ */ 
  344.     ORGANIZER_MENU_WORLDCLOCK_STRINGID
  345. } WC_STR_ID_ENUM;
  346. typedef enum
  347. {
  348.     SCR_ID_WC_BROWSE_CITY = WORLD_CLOCK + 1,    /* SCREEN IDS */
  349. #if defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__)
  350.     SCR_ID_WC_APP,
  351.     SCR_ID_WC_SUBLCD,
  352.     SCR_ID_WC_OPTIONS,
  353. #endif /* defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__) */ 
  354. #ifdef __MMI_WORLDCLOCK_DST__
  355.     SCR_ID_WC_DST,
  356. #endif 
  357.     SCR_ID_WC_TOTAL
  358. } WC_SCR_ID_ENUM;
  359. /* 
  360.  * Extern Global Variable
  361.  */
  362. extern const TimeZoneStruct TimeZoneData[];
  363. extern U8 mmi_wc_get_size(void);
  364. #define NUMBER_OF_CITY mmi_wc_get_size()
  365. #ifdef __MMI_WORLD_CLOCK__
  366. extern wc_context_struct g_wc_cntx;
  367. #endif 
  368. /* 
  369.  * Extern Global Function
  370.  */
  371. extern void WcInit(void);
  372. extern void WcGenerateTimeZoneIndex(void);
  373. extern FLOAT GetTimeZone(U8 cityIndex);
  374. extern S8 *mmi_wc_get_home_city(void);
  375. extern void WcSetCityIndex(U16 index);
  376. #ifdef __MMI_NITZ_TZ_SUPPORT__
  377. extern void mmi_wc_set_default_city_for_tz(void);
  378. extern S16 mmi_wc_set_home_city_from_nitz(S16 nitz_tz);
  379. #endif /* __MMI_NITZ_TZ_SUPPORT__ */ 
  380. #ifdef __MMI_WORLD_CLOCK__
  381. extern void HighlightWCMenu(void);
  382. extern void EntryWcBrowseCity(void);
  383. extern void EntryWcBrowseCityEx(void (*entry_func) (void), void (*exit_func) (void));
  384. extern void ExitWcBrowseCity(void);
  385. extern void HighlightWcBrowseCity(void);
  386. extern FLOAT WcTimeZoneDiff(U8 City1, U8 City2);
  387. extern void WcShowDateTime(void);
  388. extern void WcHandleKeyLeft(void);
  389. extern void WcHandleKeyRight(void);
  390. extern void WcHandleKeyEnd(void);
  391. extern void WcEntryDST(void);
  392. extern void WcHandleRSK(void);
  393. extern void WcRedrawWorldClock(S32 old_x_vertical, S32 old_y_horizontal);
  394. extern U8 WcGetCityPosition(U8 index);
  395. extern void WcRedrawCategory(void);
  396. extern void WcDSTEndKeyHandler(void);
  397. #if defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__)
  398. extern void HighlightWcSubLcd(void);
  399. extern void EntryWcSubLcd(void);
  400. extern void EntryWcSelectCity(void);    /* sub-LCD */
  401. extern void EntryWcApp(void);
  402. extern void WcHintCity1(U16 index);
  403. extern void WcHintCity2(U16 index);
  404. #endif /* defined(__MMI_WORLD_CLOCK_SUBLCD_SETTING__) */ 
  405. #ifdef __MMI_WC_TZ_SUPPORT__
  406. extern void mmi_wc_get_index_info(void* info);
  407. extern void mmi_wc_get_foreign_city_dt(MYTIME* dt);
  408. extern void mmi_wc_leftkey_handler(U8 index_num);
  409. extern void mmi_wc_rightkey_handler(U8 index_num);
  410. extern U8 mmi_wc_default_city_of_tz(FLOAT tz);
  411. extern void mmi_wc_dt_format(MYTIME* dt, U8* dtString);
  412. extern void mmi_wc_paint_pen_handler(S32 x, S32 y, S32 event_type);
  413. extern U8 mmi_wc_entry_from_phnset(void);
  414. extern void mmi_wc_get_tz_string(FLOAT tz, S8* outStr);
  415. extern void mmi_wc_get_city_string(U8 cityIndex);
  416. #endif /* #ifdef __MMI_WC_TZ_SUPPORT__ */ 
  417. #endif /* __MMI_WORLD_CLOCK__ */ 
  418. extern void mmi_wc_is_dst(void);
  419. #endif /* _MMI_WORLDCLOCK_H */