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
00625 U_STABLE UCalendar* U_EXPORT2
00626 ucal_open(const UChar* zoneID,
00627 int32_t len,
00628 const char* locale,
00629 UCalendarType type,
00630 UErrorCode* status);
00631
00638 U_STABLE void U_EXPORT2
00639 ucal_close(UCalendar *cal);
00640
00649 U_DRAFT UCalendar* U_EXPORT2
00650 ucal_clone(const UCalendar* cal,
00651 UErrorCode* status);
00652
00662 U_STABLE void U_EXPORT2
00663 ucal_setTimeZone(UCalendar* cal,
00664 const UChar* zoneID,
00665 int32_t len,
00666 UErrorCode* status);
00667
00672 enum UCalendarDisplayNameType {
00674 UCAL_STANDARD,
00676 UCAL_SHORT_STANDARD,
00678 UCAL_DST,
00680 UCAL_SHORT_DST
00681 };
00682
00684 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
00685
00699 U_STABLE int32_t U_EXPORT2
00700 ucal_getTimeZoneDisplayName(const UCalendar* cal,
00701 UCalendarDisplayNameType type,
00702 const char* locale,
00703 UChar* result,
00704 int32_t resultLength,
00705 UErrorCode* status);
00706
00715 U_STABLE UBool U_EXPORT2
00716 ucal_inDaylightTime(const UCalendar* cal,
00717 UErrorCode* status );
00718
00739 U_STABLE void U_EXPORT2
00740 ucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode);
00741
00762 U_STABLE UDate U_EXPORT2
00763 ucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode);
00764
00769 enum UCalendarAttribute {
00771 UCAL_LENIENT,
00773 UCAL_FIRST_DAY_OF_WEEK,
00775 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
00776 };
00777
00779 typedef enum UCalendarAttribute UCalendarAttribute;
00780
00792 U_STABLE int32_t U_EXPORT2
00793 ucal_getAttribute(const UCalendar* cal,
00794 UCalendarAttribute attr);
00795
00807 U_STABLE void U_EXPORT2
00808 ucal_setAttribute(UCalendar* cal,
00809 UCalendarAttribute attr,
00810 int32_t newValue);
00811
00821 U_STABLE const char* U_EXPORT2
00822 ucal_getAvailable(int32_t index);
00823
00832 U_STABLE int32_t U_EXPORT2
00833 ucal_countAvailable(void);
00834
00846 U_STABLE UDate U_EXPORT2
00847 ucal_getMillis(const UCalendar* cal,
00848 UErrorCode* status);
00849
00861 U_STABLE void U_EXPORT2
00862 ucal_setMillis(UCalendar* cal,
00863 UDate dateTime,
00864 UErrorCode* status );
00865
00880 U_STABLE void U_EXPORT2
00881 ucal_setDate(UCalendar* cal,
00882 int32_t year,
00883 int32_t month,
00884 int32_t date,
00885 UErrorCode* status);
00886
00904 U_STABLE void U_EXPORT2
00905 ucal_setDateTime(UCalendar* cal,
00906 int32_t year,
00907 int32_t month,
00908 int32_t date,
00909 int32_t hour,
00910 int32_t minute,
00911 int32_t second,
00912 UErrorCode* status);
00913
00923 U_STABLE UBool U_EXPORT2
00924 ucal_equivalentTo(const UCalendar* cal1,
00925 const UCalendar* cal2);
00926
00942 U_STABLE void U_EXPORT2
00943 ucal_add(UCalendar* cal,
00944 UCalendarDateFields field,
00945 int32_t amount,
00946 UErrorCode* status);
00947
00963 U_STABLE void U_EXPORT2
00964 ucal_roll(UCalendar* cal,
00965 UCalendarDateFields field,
00966 int32_t amount,
00967 UErrorCode* status);
00968
00985 U_STABLE int32_t U_EXPORT2
00986 ucal_get(const UCalendar* cal,
00987 UCalendarDateFields field,
00988 UErrorCode* status );
00989
01005 U_STABLE void U_EXPORT2
01006 ucal_set(UCalendar* cal,
01007 UCalendarDateFields field,
01008 int32_t value);
01009
01025 U_STABLE UBool U_EXPORT2
01026 ucal_isSet(const UCalendar* cal,
01027 UCalendarDateFields field);
01028
01043 U_STABLE void U_EXPORT2
01044 ucal_clearField(UCalendar* cal,
01045 UCalendarDateFields field);
01046
01057 U_STABLE void U_EXPORT2
01058 ucal_clear(UCalendar* calendar);
01059
01064 enum UCalendarLimitType {
01066 UCAL_MINIMUM,
01068 UCAL_MAXIMUM,
01070 UCAL_GREATEST_MINIMUM,
01072 UCAL_LEAST_MAXIMUM,
01074 UCAL_ACTUAL_MINIMUM,
01076 UCAL_ACTUAL_MAXIMUM
01077 };
01078
01080 typedef enum UCalendarLimitType UCalendarLimitType;
01081
01096 U_STABLE int32_t U_EXPORT2
01097 ucal_getLimit(const UCalendar* cal,
01098 UCalendarDateFields field,
01099 UCalendarLimitType type,
01100 UErrorCode* status);
01101
01109 U_STABLE const char * U_EXPORT2
01110 ucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status);
01111
01118 U_DRAFT const char * U_EXPORT2
01119 ucal_getTZDataVersion(UErrorCode* status);
01120
01139 U_DRAFT int32_t U_EXPORT2
01140 ucal_getCanonicalTimeZoneID(const UChar* id, int32_t len,
01141 UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status);
01149 U_DRAFT const char * U_EXPORT2
01150 ucal_getType(const UCalendar *cal, UErrorCode* status);
01151
01168 U_DRAFT UEnumeration* U_EXPORT2
01169 ucal_getKeywordValuesForLocale(const char* key,
01170 const char* locale,
01171 UBool commonlyUsed,
01172 UErrorCode* status);
01173
01174
01175 #endif
01176
01177 #endif