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

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.  *  CalendarDef.h
  39.  *
  40.  * Project:
  41.  * --------
  42.  *  MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  
  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.  *------------------------------------------------------------------------------
  79.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  80.  *==============================================================================
  81.  *******************************************************************************/
  82. /**
  83.  * Copyright Notice
  84.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  85.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  86.  *  (It is illegal to remove this copyright notice from this software or any
  87.  *  portion of it)
  88.  */
  89. /**************************************************************
  90.    FILENAME : CalendarDef.h
  91.    PURPOSE     : 
  92.    REMARKS     : nil
  93.    AUTHOR      : Gautam Saluja
  94.    DATE     : 
  95. **************************************************************/
  96. #ifndef _CALDEF_H
  97. #define _CALDEF_H
  98. #include "PixtelDatatypes.h"
  99. /******************************************************************/
  100. #include "wgui_calendar.h"
  101. #include "MMI_features.h"
  102. #ifdef __MMI_CALENDAR_V2__
  103. #define CLNDR_HORIZON_LIST_CELL_LEN  (4)
  104. #define CLNDR_VERTICAL_LIST_CELL_LEN  (6)
  105. #define CLNDR_VERTICAL_SELECT_LEN (5 * ENCODING_LENGTH)
  106. #define CLNDR_MAX_ROW 24
  107. #define DLNDR_MAX_DAY_HOURS 24
  108. #define CLNDR_COLUMN 7
  109. #define CLNDR_ROW 6
  110. #define CLNDR_START_WEEKDAY 0
  111. #define CLNDR_TOTAL_WEEKDAY 7
  112. #define CLNDR_WEEK_SYMBOL_LEN 1
  113. #define CLNDR_CELL_SIZE sizeof(wgui_cat83_cell_struct)
  114. #define CLNDR_MAX_BUFF_SIZE ((CLNDR_TITLE_LEN  * CLNDR_COLUMN + CLNDR_HORIZON_LIST_CELL_LEN * CLNDR_COLUMN + CLNDR_VERTICAL_LIST_CELL_LEN * CLNDR_COLUMN)  * ENCODING_LENGTH +  CLNDR_MAX_ROW * CLNDR_COLUMN * CLNDR_CELL_SIZE)
  115. #define CLNDR_MONTHLY_VIEW 1
  116. #define CLNDR_WEEKLY_VIEW 2
  117. #define CLNDR_REMINDER_TASK_AMOUNT  2
  118. #define CLNDR_IDLE_TASK_AMOUNT  2
  119. #define CLNDR_INFO_BOX_ROW 2
  120. #define CLNDR_MAX_INFO_BOX_LEN (20 * ENCODING_LENGTH)
  121. #ifdef __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__
  122. #define CLNDR_LARGER_THAN_MAX_YEAR  1
  123. #define CLNDR_LARGER_THAN_MIN_YEAR  2
  124. #define  CLNDR_START_YEAR     1970      /* the frist year in the database table */
  125. #define  CLNDR_END_YEAR         2030    /* the frist year in the database table */
  126. #define  CLNDR_MONTH_DAYS   31
  127. #define CLNDR_WEEKLY_PERIOD_INTERVAL 2
  128. #endif /* __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__ */ 
  129. #endif /* __MMI_CALENDAR_V2__ */ 
  130. #define  CLNDR_DAY_LEN           3*ENCODING_LENGTH
  131. #define  CLNDR_MON_LEN           3*ENCODING_LENGTH
  132. #define  CLNDR_YEAR_LEN          6*ENCODING_LENGTH
  133. #define  CLNDR_TABLE_START_YEAR     1969        /* the frist year in the database table */
  134. #define  CLNDR_TABLE_END_YEAR       2031        /* the last year in the database table */
  135. #define  CLNDR_TIME_PER_YEAR        31556926
  136. /* indication codes */
  137. #define CLNDR_BASE 1939
  138. #define CLNDR_TIME_STRING_LENGTH (5)    /* HH:MM */
  139. #define CLNDR_DATE_STRING_LENGTH (10)   /* YYYY/MM/DD */
  140. /*
  141.  * Typedef 
  142.  */
  143. /* struct clndr_lnuar_date_info_struct defines all data needed for lunar calendar */
  144. typedef struct
  145. {
  146.     U8 BaseDays;    /* different days from solar Jan 1 to lunar Jan 1. */
  147.     U8 BaseWeekday; /* week day of Jan 1 this year. 0=Sunday */
  148.     U8 BaseKanChi;  /* the Kan and Chin of Jan 1 this year. */
  149.     S8 Intercalary;     /* an intercalary month in the lunar calendar.                    
  150.                            0==no intercalary month in this year. */
  151.     U16 MonthDays;  /* the number of days in lunar month, bit-level representation 0=29, 1=30. */
  152. } clndr_lunar_table_struct;
  153. /* struct DateInfo defines all data/result for calendar converting */
  154. typedef struct
  155. {
  156.     U16 SolarYear;                      /* year in solar calendar system. */
  157.     U16 LunarYear;                      /* year in lunar calendar system. */
  158.     U8 SolarMonth;                      /* month in solar calendar system. */
  159.     U8 SolarDay;                        /* day in solar calendar system. */
  160.     U8 LunarMonth;                      /* month in lunar calendar system. */
  161.     U8 LunarDay;                        /* day in lunar calendar system. */
  162.     U8 KanYear;                         /* the Kan symbol of given year */
  163.     U8 ChiYear;                         /* the Chin symbol of given year */
  164.     U8 Direction;                       /* the unfortunate direction of selecting day */
  165.     U8 Age;                             /* the unfortunate age of selecting day */
  166.     U8 Animal;                          /* the unfortunate symbolizing animal today */
  167.     U8 SolarTerm;                       /* solar term today, 25 == NONE */
  168.     U8 SolarDate;                       /* the nearest solar date from today */
  169.     U8 YearAnimal;                      /* the symbolizing animal of this year */
  170.     S8 TitleInfo1[CLNDR_TITLE_LEN];     /* the string shown in the first line of title */
  171.     S8 TitleInfo2[CLNDR_TITLE_LEN];     /* the string shown in the second line of title */
  172.     S8 MessageLine1[CLNDR_HINT_LEN];    /* the string shown solar term */
  173.     S8 MessageLine2[CLNDR_HINT_LEN];    /* the string shown about unlucky direction */
  174.     S8 MessageLine3[CLNDR_HINT_LEN];    /* the string shown about unfortunate age */
  175. } clndr_lnuar_date_info_struct;
  176. typedef struct
  177. {
  178.     U8 date;
  179. #ifdef __MMI_CLNDR_ICON_SUPPORT__
  180.     U16 icon;
  181. #endif 
  182.     ToDoListNode *maxPriorityTask;
  183. } clndr_task_icon_struct;
  184. #ifdef __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__
  185. typedef struct
  186. {
  187.     U8 taskNum;
  188.     U8 weeday;
  189.     U8 periodIndex;
  190. #ifdef __MMI_CLNDR_ICON_SUPPORT__
  191.     U16 icon;
  192. #endif 
  193.     /* ToDoListNode* maxPriorityTask; */
  194. } clndr_weekly_task_struct;
  195. #endif /* __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__ */ 
  196. #ifdef __MMI_BIRTHDAY_REMINDER__
  197. typedef struct
  198. {
  199.     U16 firstMatchedIndex;
  200.     U16 count;
  201. } birthday_info_struct;
  202. #endif /* __MMI_BIRTHDAY_REMINDER__ */ 
  203. typedef struct
  204. {
  205.     /* U16  ImgID; */
  206.     MYTIME CalTime;
  207.     clndr_lnuar_date_info_struct LunarInfo;
  208.     /* S8   TitleString[CLNDR_TITLE_LEN]; */
  209.     S8 DayBuf[CLNDR_DAY_LEN];
  210.     S8 MonBuf[CLNDR_MON_LEN];
  211.     S8 YearBuf[CLNDR_YEAR_LEN];
  212.     U8 LunarState;
  213.     U8 DayOnFirst;
  214.     U8 NumDaysInMonth;
  215. #ifdef __MMI_CALENDAR_V2__
  216.     U8 *Title;
  217.     U8 *HorizonList[CLNDR_COLUMN];
  218.     U8 *VerticalList[CLNDR_ROW];
  219.     wgui_cat83_cell_struct *CalendarCell;
  220.     U8 RowNumber;
  221.     U8 DisplayType;
  222.     U8 horizon_select1[CLNDR_VERTICAL_SELECT_LEN];
  223.     U8 horizon_select2[CLNDR_VERTICAL_SELECT_LEN];
  224. #endif /* __MMI_CALENDAR_V2__ */ 
  225. #ifdef __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__
  226.     U8 WeekNum;
  227.     U8 CurrPeriodIndex; /* start period of weekly view */
  228.     U8 PeriodInterval;  /* unit of each period */
  229.     U8 PeriodStartIndex;
  230. #endif /* __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__ */ 
  231. #ifndef __MMI_CLNDR_ICON_SUPPORT__
  232.     U8 TaskDayList[CLNDR_MAX_DAYS + 1];
  233. #else /* __MMI_CLNDR_ICON_SUPPORT__ */ 
  234.     clndr_task_icon_struct TaskDayList[CLNDR_COLUMN *CLNDR_MAX_ROW];
  235.     /* clndr_weekly_task_struct TaskPeriodList[CLNDR_COLUMN * CLNDR_MAX_ROW]; */
  236.     U16 info_box_icon[CLNDR_INFO_BOX_ROW];
  237.     U8 *info_box_text[CLNDR_INFO_BOX_ROW];
  238. #ifdef __MMI_BIRTHDAY_REMINDER__
  239.     birthday_info_struct BirthdayInfo[CLNDR_MONTH_DAYS + 1];
  240.     /* U16 DailylyBirthdayCount; */
  241. #endif /* __MMI_BIRTHDAY_REMINDER__ */ 
  242. #endif /* __MMI_CLNDR_ICON_SUPPORT__ */ 
  243. } clndr_context_struct;
  244. typedef enum
  245. {
  246.     SCR_ID_CLNDR_SCREEN = CAL_BASE + 1,
  247.     SCR_ID_CLNDR_OPTION,
  248.     SCR_ID_CLNDR_JUMP
  249. } SCR_ID_CLNDR_ENUM;
  250. typedef enum
  251. {
  252.     CAL_STRING_LUNAR = CAL_BASE + 1,
  253.     STR_CAL_CHINESE_NO1,    /* do not change the order */
  254.     STR_CAL_CHINESE_NO2,
  255.     STR_CAL_CHINESE_NO3,
  256.     STR_CAL_CHINESE_NO4,
  257.     STR_CAL_CHINESE_NO5,
  258.     STR_CAL_CHINESE_NO6,
  259.     STR_CAL_CHINESE_NO7,
  260.     STR_CAL_CHINESE_NO8,
  261.     STR_CAL_CHINESE_NO9,
  262.     STR_CAL_CHINESE_NO10,
  263.     STR_CAL_CHINESE_NO20,
  264.     STR_CAL_CHINESE_NO30,
  265.     STR_CAL_SOLARTERM1,     /* do not change the order *//* Sligt Cold */
  266.     STR_CAL_SOLARTERM2,
  267.     STR_CAL_SOLARTERM3,
  268.     STR_CAL_SOLARTERM4,
  269.     STR_CAL_SOLARTERM5,
  270.     STR_CAL_SOLARTERM6,
  271.     STR_CAL_SOLARTERM7,
  272.     STR_CAL_SOLARTERM8,
  273.     STR_CAL_SOLARTERM9,
  274.     STR_CAL_SOLARTERM10,
  275.     STR_CAL_SOLARTERM11,
  276.     STR_CAL_SOLARTERM12,
  277.     STR_CAL_SOLARTERM13,
  278.     STR_CAL_SOLARTERM14,
  279.     STR_CAL_SOLARTERM15,
  280.     STR_CAL_SOLARTERM16,
  281.     STR_CAL_SOLARTERM17,
  282.     STR_CAL_SOLARTERM18,
  283.     STR_CAL_SOLARTERM19,
  284.     STR_CAL_SOLARTERM20,
  285.     STR_CAL_SOLARTERM21,
  286.     STR_CAL_SOLARTERM22,
  287.     STR_CAL_SOLARTERM23,
  288.     STR_CAL_SOLARTERM24,
  289.     STR_CAL_ANIMAL1,        /* do not change the order */
  290.     STR_CAL_ANIMAL2,
  291.     STR_CAL_ANIMAL3,
  292.     STR_CAL_ANIMAL4,
  293.     STR_CAL_ANIMAL5,
  294.     STR_CAL_ANIMAL6,
  295.     STR_CAL_ANIMAL7,
  296.     STR_CAL_ANIMAL8,
  297.     STR_CAL_ANIMAL9,
  298.     STR_CAL_ANIMAL10,
  299.     STR_CAL_ANIMAL11,
  300.     STR_CAL_ANIMAL12,
  301.     STR_CAL_KAN1,           /* do not change the order */
  302.     STR_CAL_KAN2,
  303.     STR_CAL_KAN3,
  304.     STR_CAL_KAN4,
  305.     STR_CAL_KAN5,
  306.     STR_CAL_KAN6,
  307.     STR_CAL_KAN7,
  308.     STR_CAL_KAN8,
  309.     STR_CAL_KAN9,
  310.     STR_CAL_KAN10,
  311.     STR_CAL_CHI1,           /* do not change the order */
  312.     STR_CAL_CHI2,
  313.     STR_CAL_CHI3,
  314.     STR_CAL_CHI4,
  315.     STR_CAL_CHI5,
  316.     STR_CAL_CHI6,
  317.     STR_CAL_CHI7,
  318.     STR_CAL_CHI8,
  319.     STR_CAL_CHI9,
  320.     STR_CAL_CHI10,
  321.     STR_CAL_CHI11,
  322.     STR_CAL_CHI12,
  323.     STR_CAL_DIRECTION1,     /* do not change the order */
  324.     STR_CAL_DIRECTION2,
  325.     STR_CAL_DIRECTION3,
  326.     STR_CAL_DIRECTION4,
  327.     STR_CAL_UNFORTUNATE,
  328.     STR_CAL_UNLUCKY,
  329.     STR_CAL_YEAR,
  330.     STR_CAL_MONTH,
  331.     STR_CAL_DAY,
  332.     STR_CLNDR_JUMP_TO,
  333.     STR_CLNDR_DATE,
  334.     STR_CLNDR_WRONG_DATE,
  335. #ifdef __MMI_CALENDAR_V2__
  336.     STR_CLNDR_WEEK_SYMBOL,
  337.     STR_CLNDR_WEEK_SUNDAY,
  338.     STR_CLNDR_WEEK_MONDAY,
  339.     STR_CLNDR_WEEK_TUESDAY,
  340.     STR_CLNDR_WEEK_WEDNESDAY,
  341.     STR_CLNDR_WEEK_THURSDAY,
  342.     STR_CLNDR_WEEK_FRIDAY,
  343.     STR_CLNDR_WEEK_SATURDAY,
  344.     STR_CLNDR_OUT_OF_CALENDAR,
  345. #ifdef __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__
  346.     STR_CLNDR_WEEKLY_VIEW,
  347.     STR_CLNDR_MONTHLY_VIEW,
  348. #endif /* __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__ */ 
  349.     STR_CLNDR_ADD_TASK,
  350.     STR_CLNDR_DELETE_TASK,
  351. #endif /* __MMI_CALENDAR_V2__ */ 
  352.     ORGANIZER_MENU_CALENDER_STRINGID
  353. } STR_ID_CLNDR_ENUM;
  354. typedef enum
  355. {
  356.     CAL_OPTION_IMAGE = CAL_BASE + 1,
  357.     CAL_IMAGE_VIEW,
  358.     CAL_IMAGE_LUNAR,
  359.     IMG_CAL_ON,
  360.     IMG_CAL_OFF,
  361.     MONTH_BLANK_IMAGE,
  362.     ORGANIZER_MENU_CALENDER_IMAGEID,
  363. #ifdef __MMI_CALENDAR_V2__
  364.     IMG_CLNDR_TASK_CLOCK,
  365.     IMG_TOP_UP, /* 072406 new calendar */
  366.     IMG_TOP_DOWN,
  367.     IMG_BOTTOM_UP,
  368.     IMG_BOTTOM_DOWN,
  369.     IMG_HOUR_PLUS_UP,//072406 new calendar
  370.     IMG_HOUR_PLUS_DOWN,
  371.     IMG_HOUR_SUBTRACT_UP,
  372.     IMG_HOUR_SUBTRACT_DOWN,
  373. #ifdef __MMI_CLNDR_ICON_SUPPORT__
  374.     IMG_CLNDR_ICON_REMINDER,
  375.     IMG_CLNDR_ICON_MEETING,
  376.     IMG_CLNDR_ICON_COURSE,
  377.     IMG_CLNDR_ICON_DATE,
  378.     IMG_CLNDR_ICON_CALL,
  379.     IMG_CLNDR_ICON_ANNIVERSIRY,
  380. #endif /* __MMI_CLNDR_ICON_SUPPORT__ */ 
  381. #ifdef __MMI_BIRTHDAY_REMINDER__
  382.     IMG_CLNDR_BIRTHDAY_REMINDER,
  383. #endif    
  384. #endif 
  385.     IMG_CLNDR_TOTAL
  386. } IMG_ID_CLNDR_ENUM;
  387. typedef enum
  388. {
  389. #ifdef __MMI_TODOLIST__
  390.     CLNDR_GOTO_TASK_CAL,
  391.     CLNDR_ADD_TASK,
  392. #endif /* __MMI_TODOLIST__ */ 
  393.     CLNDR_JUMP_TO_DATE,
  394. #ifdef __MMI_CLNDR_WEEKLY_VIEW_SUPPORT__
  395.     CLNDR_VARIED_VIEW,
  396. #endif 
  397.     CLNDR_CAL_TYPE, /* must be last one */
  398.     CLNDR_OPTIONS_TOTAL
  399. } OPTIONS_CLNDR_ENUM;
  400. #ifdef __MMI_CALENDAR_V2__
  401. typedef enum
  402. {
  403.     CLNDR_KEY_UP = 0,
  404.     CLNDR_KEY_DOWN,
  405.     CLNDR_KEY_LEFT,
  406.     CLNDR_KEY_RIGHT,
  407.     CLNDR_KEY_TOTAL
  408. } CLNDR_KEY_ENUM;
  409. typedef enum CLNDR_CLNDAR_MOVEMENT
  410. {
  411.     CLNDR_NEXT_MONTH,
  412.     CLNDR_PRIVOUS_MONTH,
  413.     CLNDR_NEXT_WEEK,
  414.     CLNDR_PRIVOUS_WEEK,
  415. #ifdef __MMI_TOUCH_SCREEN__
  416.     CLNDR_NEXT_YEAR,
  417.     CLNDR_PRIVOUS_YEAR,
  418.     CLNDR_NEXT_PERIOD,
  419.     CLNDR_PRIVOUS_PERIOD,
  420.     CLNDR_NEXT_MULTI_PERIOD,
  421.     CLNDR_PRIVOUS_MULTI_PERIOD,
  422. #endif /* __MMI_TOUCH_SCREEN__ */ 
  423.     CLNDR_CLNDAR_MOVEMENT_TOTAL
  424. } CLNDR_CLNDAR_MOVEMENT_ENUM;
  425. #endif /* __MMI_CALENDAR_V2__ */ 
  426. #endif /* _CALDEF_H */