00001
00002
00003
00004
00005
00006
00007
00008 #ifndef UCAL_H
00009 #define UCAL_H
00010
00011 #include "unicode/utypes.h"
00012 #include "unicode/uenum.h"
00013 #include "unicode/uloc.h"
00014
00015 #if !UCONFIG_NO_FORMATTING
00016
00146 typedef void* UCalendar;
00147
00151 enum UCalendarType {
00157 UCAL_TRADITIONAL,
00162 UCAL_GREGORIAN,
00167 UCAL_DEFAULT = UCAL_TRADITIONAL
00168 };
00169
00171 typedef enum UCalendarType UCalendarType;
00172
00176 enum UCalendarDateFields {
00182 UCAL_ERA,
00183
00188 UCAL_YEAR,
00189
00209 UCAL_MONTH,
00210
00222 UCAL_WEEK_OF_YEAR,
00223
00237 UCAL_WEEK_OF_MONTH,
00238
00246 UCAL_DATE,
00247
00253 UCAL_DAY_OF_YEAR,
00254
00269 UCAL_DAY_OF_WEEK,
00270
00294 UCAL_DAY_OF_WEEK_IN_MONTH,
00295
00305 UCAL_AM_PM,
00306
00316 UCAL_HOUR,
00317
00325 UCAL_HOUR_OF_DAY,
00326
00333 UCAL_MINUTE,
00334
00341 UCAL_SECOND,
00342
00349 UCAL_MILLISECOND,
00350
00356 UCAL_ZONE_OFFSET,
00357
00363 UCAL_DST_OFFSET,
00364
00372 UCAL_YEAR_WOY,
00373
00380 UCAL_DOW_LOCAL,
00381
00388 UCAL_EXTENDED_YEAR,
00389
00400 UCAL_JULIAN_DAY,
00401
00411 UCAL_MILLISECONDS_IN_DAY,
00412
00417 UCAL_IS_LEAP_MONTH,
00418
00423 UCAL_FIELD_COUNT,
00424
00433 UCAL_DAY_OF_MONTH=UCAL_DATE
00434 };
00435
00437 typedef enum UCalendarDateFields UCalendarDateFields;
00446 enum UCalendarDaysOfWeek {
00448 UCAL_SUNDAY = 1,
00450 UCAL_MONDAY,
00452 UCAL_TUESDAY,
00454 UCAL_WEDNESDAY,
00456 UCAL_THURSDAY,
00458 UCAL_FRIDAY,
00460 UCAL_SATURDAY
00461 };
00462
00464 typedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek;
00465
00469 enum UCalendarMonths {
00471 UCAL_JANUARY,
00473 UCAL_FEBRUARY,
00475 UCAL_MARCH,
00477 UCAL_APRIL,
00479 UCAL_MAY,
00481 UCAL_JUNE,
00483 UCAL_JULY,
00485 UCAL_AUGUST,
00487 UCAL_SEPTEMBER,
00489 UCAL_OCTOBER,
00491 UCAL_NOVEMBER,
00493 UCAL_DECEMBER,
00498 UCAL_UNDECIMBER
00499 };
00500
00502 typedef enum UCalendarMonths UCalendarMonths;
00503
00507 enum UCalendarAMPMs {
00509 UCAL_AM,
00511 UCAL_PM
00512 };
00513
00515 typedef enum UCalendarAMPMs UCalendarAMPMs;
00516
00528 U_STABLE UEnumeration* U_EXPORT2
00529 ucal_openTimeZones(UErrorCode* ec);
00530
00547 U_STABLE UEnumeration* U_EXPORT2
00548 ucal_openCountryTimeZones(const char* country, UErrorCode* ec);
00549
00566 U_STABLE int32_t U_EXPORT2
00567 ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec);
00568
00578 U_STABLE void U_EXPORT2
00579 ucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec);
00580
00597 U_STABLE int32_t U_EXPORT2
00598 ucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec);
00599
00606 U_STABLE UDate U_EXPORT2
00607 ucal_getNow(void);
00608
00631 U_STABLE UCalendar* U_EXPORT2
00632 ucal_open(const UChar* zoneID,
00633 int32_t len,
00634 const char* locale,
00635 UCalendarType type,
00636 UErrorCode* status);
00637
00644 U_STABLE void U_EXPORT2
00645 ucal_close(UCalendar *cal);
00646
00655 U_DRAFT UCalendar* U_EXPORT2
00656 ucal_clone(const UCalendar* cal,
00657 UErrorCode* status);
00658
00668 U_STABLE void U_EXPORT2
00669 ucal_setTimeZone(UCalendar* cal,
00670 const UChar* zoneID,
00671 int32_t len,
00672 UErrorCode* status);
00673
00678 enum UCalendarDisplayNameType {
00680 UCAL_STANDARD,
00682 UCAL_SHORT_STANDARD,
00684 UCAL_DST,
00686 UCAL_SHORT_DST
00687 };
00688
00690 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
00691
00705 U_STABLE int32_t U_EXPORT2
00706 ucal_getTimeZoneDisplayName(const UCalendar* cal,
00707 UCalendarDisplayNameType type,
00708 const char* locale,
00709 UChar* result,
00710 int32_t resultLength,
00711 UErrorCode* status);
00712
00721 U_STABLE UBool U_EXPORT2
00722 ucal_inDaylightTime(const UCalendar* cal,
00723 UErrorCode* status );
00724
00745 U_STABLE void U_EXPORT2
00746 ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode);
00747
00768 U_STABLE UDate U_EXPORT2
00769 ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode);
00770
00775 enum UCalendarAttribute {
00777 UCAL_LENIENT,
00779 UCAL_FIRST_DAY_OF_WEEK,
00781 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
00782 };
00783
00785 typedef enum UCalendarAttribute UCalendarAttribute;
00786
00798 U_STABLE int32_t U_EXPORT2
00799 ucal_getAttribute(const UCalendar* cal,
00800 UCalendarAttribute attr);
00801
00813 U_STABLE void U_EXPORT2
00814 ucal_setAttribute(UCalendar* cal,
00815 UCalendarAttribute attr,
00816 int32_t newValue);
00817
00827 U_STABLE const char* U_EXPORT2
00828 ucal_getAvailable(int32_t localeIndex);
00829
00838 U_STABLE int32_t U_EXPORT2
00839 ucal_countAvailable(void);
00840
00852 U_STABLE UDate U_EXPORT2
00853 ucal_getMillis(const UCalendar* cal,
00854 UErrorCode* status);
00855
00867 U_STABLE void U_EXPORT2
00868 ucal_setMillis(UCalendar* cal,
00869 UDate dateTime,
00870 UErrorCode* status );
00871
00886 U_STABLE void U_EXPORT2
00887 ucal_setDate(UCalendar* cal,
00888 int32_t year,
00889 int32_t month,
00890 int32_t date,
00891 UErrorCode* status);
00892
00910 U_STABLE void U_EXPORT2
00911 ucal_setDateTime(UCalendar* cal,
00912 int32_t year,
00913 int32_t month,
00914 int32_t date,
00915 int32_t hour,
00916 int32_t minute,
00917 int32_t second,
00918 UErrorCode* status);
00919
00929 U_STABLE UBool U_EXPORT2
00930 ucal_equivalentTo(const UCalendar* cal1,
00931 const UCalendar* cal2);
00932
00948 U_STABLE void U_EXPORT2
00949 ucal_add(UCalendar* cal,
00950 UCalendarDateFields field,
00951 int32_t amount,
00952 UErrorCode* status);
00953
00969 U_STABLE void U_EXPORT2
00970 ucal_roll(UCalendar* cal,
00971 UCalendarDateFields field,
00972 int32_t amount,
00973 UErrorCode* status);
00974
00991 U_STABLE int32_t U_EXPORT2
00992 ucal_get(const UCalendar* cal,
00993 UCalendarDateFields field,
00994 UErrorCode* status );
00995
01011 U_STABLE void U_EXPORT2
01012 ucal_set(UCalendar* cal,
01013 UCalendarDateFields field,
01014 int32_t value);
01015
01031 U_STABLE UBool U_EXPORT2
01032 ucal_isSet(const UCalendar* cal,
01033 UCalendarDateFields field);
01034
01049 U_STABLE void U_EXPORT2
01050 ucal_clearField(UCalendar* cal,
01051 UCalendarDateFields field);
01052
01063 U_STABLE void U_EXPORT2
01064 ucal_clear(UCalendar* calendar);
01065
01070 enum UCalendarLimitType {
01072 UCAL_MINIMUM,
01074 UCAL_MAXIMUM,
01076 UCAL_GREATEST_MINIMUM,
01078 UCAL_LEAST_MAXIMUM,
01080 UCAL_ACTUAL_MINIMUM,
01082 UCAL_ACTUAL_MAXIMUM
01083 };
01084
01086 typedef enum UCalendarLimitType UCalendarLimitType;
01087
01102 U_STABLE int32_t U_EXPORT2
01103 ucal_getLimit(const UCalendar* cal,
01104 UCalendarDateFields field,
01105 UCalendarLimitType type,
01106 UErrorCode* status);
01107
01115 U_STABLE const char * U_EXPORT2
01116 ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status);
01117
01124 U_DRAFT const char * U_EXPORT2
01125 ucal_getTZDataVersion(UErrorCode* status);
01126
01145 U_DRAFT int32_t U_EXPORT2
01146 ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len,
01147 UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status);
01155 U_DRAFT const char * U_EXPORT2
01156 ucal_getType(const UCalendar *cal, UErrorCode* status);
01157
01174 U_DRAFT UEnumeration* U_EXPORT2
01175 ucal_getKeywordValuesForLocale(const char* key,
01176 const char* locale,
01177 UBool commonlyUsed,
01178 UErrorCode* status);
01179
01180
01181 #endif
01182
01183 #endif