00001
00002
00003
00004
00005
00006 #ifndef UCAL_H
00007 #define UCAL_H
00008
00009 #include "unicode/utypes.h"
00010 #include "unicode/uenum.h"
00011
00012 #if !UCONFIG_NO_FORMATTING
00013
00143 typedef void* UCalendar;
00144
00148 enum UCalendarType {
00150 UCAL_TRADITIONAL,
00152 UCAL_GREGORIAN
00153 };
00154
00156 typedef enum UCalendarType UCalendarType;
00157
00161 enum UCalendarDateFields {
00163 UCAL_ERA,
00165 UCAL_YEAR,
00167 UCAL_MONTH,
00169 UCAL_WEEK_OF_YEAR,
00171 UCAL_WEEK_OF_MONTH,
00173 UCAL_DATE,
00175 UCAL_DAY_OF_YEAR,
00177 UCAL_DAY_OF_WEEK,
00179 UCAL_DAY_OF_WEEK_IN_MONTH,
00181 UCAL_AM_PM,
00183 UCAL_HOUR,
00185 UCAL_HOUR_OF_DAY,
00187 UCAL_MINUTE,
00189 UCAL_SECOND,
00191 UCAL_MILLISECOND,
00193 UCAL_ZONE_OFFSET,
00195 UCAL_DST_OFFSET,
00197 UCAL_YEAR_WOY,
00199 UCAL_DOW_LOCAL,
00201 UCAL_FIELD_COUNT
00202 };
00203
00205 typedef enum UCalendarDateFields UCalendarDateFields;
00214 enum UCalendarDaysOfWeek {
00216 UCAL_SUNDAY = 1,
00218 UCAL_MONDAY,
00220 UCAL_TUESDAY,
00222 UCAL_WEDNESDAY,
00224 UCAL_THURSDAY,
00226 UCAL_FRIDAY,
00228 UCAL_SATURDAY
00229 };
00230
00232 typedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek;
00233
00237 enum UCalendarMonths {
00239 UCAL_JANUARY,
00241 UCAL_FEBRUARY,
00243 UCAL_MARCH,
00245 UCAL_APRIL,
00247 UCAL_MAY,
00249 UCAL_JUNE,
00251 UCAL_JULY,
00253 UCAL_AUGUST,
00255 UCAL_SEPTEMBER,
00257 UCAL_OCTOBER,
00259 UCAL_NOVEMBER,
00261 UCAL_DECEMBER,
00263 UCAL_UNDECIMBER
00264 };
00265
00267 typedef enum UCalendarMonths UCalendarMonths;
00268
00272 enum UCalendarAMPMs {
00274 UCAL_AM,
00276 UCAL_PM
00277 };
00278
00280 typedef enum UCalendarAMPMs UCalendarAMPMs;
00281
00293 U_CAPI UEnumeration* U_EXPORT2
00294 ucal_openTimeZones(UErrorCode* ec);
00295
00312 U_CAPI UEnumeration* U_EXPORT2
00313 ucal_openCountryTimeZones(const char* country, UErrorCode* ec);
00314
00331 U_CAPI int32_t U_EXPORT2
00332 ucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec);
00333
00343 U_CAPI void U_EXPORT2
00344 ucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec);
00345
00362 U_CAPI int32_t U_EXPORT2
00363 ucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec);
00364
00371 U_CAPI UDate U_EXPORT2
00372 ucal_getNow(void);
00373
00386 U_CAPI UCalendar* U_EXPORT2
00387 ucal_open(const UChar* zoneID,
00388 int32_t len,
00389 const char* locale,
00390 UCalendarType type,
00391 UErrorCode* status);
00392
00399 U_CAPI void U_EXPORT2
00400 ucal_close(UCalendar *cal);
00401
00411 U_CAPI void U_EXPORT2
00412 ucal_setTimeZone(UCalendar* cal,
00413 const UChar* zoneID,
00414 int32_t len,
00415 UErrorCode* status);
00416
00421 enum UCalendarDisplayNameType {
00423 UCAL_STANDARD,
00425 UCAL_SHORT_STANDARD,
00427 UCAL_DST,
00429 UCAL_SHORT_DST
00430 };
00431
00433 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
00434
00448 U_CAPI int32_t U_EXPORT2
00449 ucal_getTimeZoneDisplayName(const UCalendar* cal,
00450 UCalendarDisplayNameType type,
00451 const char* locale,
00452 UChar* result,
00453 int32_t resultLength,
00454 UErrorCode* status);
00455
00464 U_CAPI UBool U_EXPORT2
00465 ucal_inDaylightTime(const UCalendar* cal,
00466 UErrorCode* status );
00467
00472 enum UCalendarAttribute {
00474 UCAL_LENIENT,
00476 UCAL_FIRST_DAY_OF_WEEK,
00478 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
00479 };
00480
00482 typedef enum UCalendarAttribute UCalendarAttribute;
00483
00495 U_CAPI int32_t U_EXPORT2
00496 ucal_getAttribute(const UCalendar* cal,
00497 UCalendarAttribute attr);
00498
00510 U_CAPI void U_EXPORT2
00511 ucal_setAttribute(UCalendar* cal,
00512 UCalendarAttribute attr,
00513 int32_t newValue);
00514
00524 U_CAPI const char* U_EXPORT2
00525 ucal_getAvailable(int32_t index);
00526
00535 U_CAPI int32_t U_EXPORT2
00536 ucal_countAvailable(void);
00537
00549 U_CAPI UDate U_EXPORT2
00550 ucal_getMillis(const UCalendar* cal,
00551 UErrorCode* status);
00552
00564 U_CAPI void U_EXPORT2
00565 ucal_setMillis(UCalendar* cal,
00566 UDate dateTime,
00567 UErrorCode* status );
00568
00583 U_CAPI void U_EXPORT2
00584 ucal_setDate(UCalendar* cal,
00585 int32_t year,
00586 int32_t month,
00587 int32_t date,
00588 UErrorCode* status);
00589
00607 U_CAPI void U_EXPORT2
00608 ucal_setDateTime(UCalendar* cal,
00609 int32_t year,
00610 int32_t month,
00611 int32_t date,
00612 int32_t hour,
00613 int32_t minute,
00614 int32_t second,
00615 UErrorCode* status);
00616
00626 U_CAPI UBool U_EXPORT2
00627 ucal_equivalentTo(const UCalendar* cal1,
00628 const UCalendar* cal2);
00629
00645 U_CAPI void U_EXPORT2
00646 ucal_add(UCalendar* cal,
00647 UCalendarDateFields field,
00648 int32_t amount,
00649 UErrorCode* status);
00650
00666 U_CAPI void U_EXPORT2
00667 ucal_roll(UCalendar* cal,
00668 UCalendarDateFields field,
00669 int32_t amount,
00670 UErrorCode* status);
00671
00688 U_CAPI int32_t U_EXPORT2
00689 ucal_get(const UCalendar* cal,
00690 UCalendarDateFields field,
00691 UErrorCode* status );
00692
00708 U_CAPI void U_EXPORT2
00709 ucal_set(UCalendar* cal,
00710 UCalendarDateFields field,
00711 int32_t value);
00712
00728 U_CAPI UBool U_EXPORT2
00729 ucal_isSet(const UCalendar* cal,
00730 UCalendarDateFields field);
00731
00746 U_CAPI void U_EXPORT2
00747 ucal_clearField(UCalendar* cal,
00748 UCalendarDateFields field);
00749
00760 U_CAPI void U_EXPORT2
00761 ucal_clear(UCalendar* calendar);
00762
00767 enum UCalendarLimitType {
00769 UCAL_MINIMUM,
00771 UCAL_MAXIMUM,
00773 UCAL_GREATEST_MINIMUM,
00775 UCAL_LEAST_MAXIMUM,
00777 UCAL_ACTUAL_MINIMUM,
00779 UCAL_ACTUAL_MAXIMUM
00780 };
00781
00783 typedef enum UCalendarLimitType UCalendarLimitType;
00784
00799 U_CAPI int32_t U_EXPORT2
00800 ucal_getLimit(const UCalendar* cal,
00801 UCalendarDateFields field,
00802 UCalendarLimitType type,
00803 UErrorCode* status);
00804
00815 U_CAPI const UChar* U_EXPORT2
00816 ucal_getAvailableTZIDs(int32_t rawOffset,
00817 int32_t index,
00818 UErrorCode* status);
00819
00829 U_CAPI int32_t U_EXPORT2
00830 ucal_countAvailableTZIDs(int32_t rawOffset);
00831
00832 #endif
00833
00834 #endif