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
00291 U_CAPI UEnumeration* U_EXPORT2
00292 ucal_openTimeZoneEnumeration(int32_t rawOffset,
00293 UErrorCode* status);
00294
00305 U_CAPI const UChar* U_EXPORT2
00306 ucal_getAvailableTZIDs( int32_t rawOffset,
00307 int32_t index,
00308 UErrorCode* status);
00309
00319 U_CAPI int32_t U_EXPORT2
00320 ucal_countAvailableTZIDs(int32_t rawOffset);
00321
00328 U_CAPI UDate U_EXPORT2
00329 ucal_getNow(void);
00330
00343 U_CAPI UCalendar* U_EXPORT2
00344 ucal_open( const UChar* zoneID,
00345 int32_t len,
00346 const char* locale,
00347 UCalendarType type,
00348 UErrorCode* status);
00349
00356 U_CAPI void U_EXPORT2
00357 ucal_close(UCalendar *cal);
00358
00368 U_CAPI void U_EXPORT2
00369 ucal_setTimeZone( UCalendar* cal,
00370 const UChar* zoneID,
00371 int32_t len,
00372 UErrorCode *status);
00373
00377 enum UCalendarDisplayNameType {
00379 UCAL_STANDARD,
00381 UCAL_SHORT_STANDARD,
00383 UCAL_DST,
00385 UCAL_SHORT_DST
00386 };
00387
00389 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
00390
00404 U_CAPI int32_t U_EXPORT2
00405 ucal_getTimeZoneDisplayName( const UCalendar* cal,
00406 UCalendarDisplayNameType type,
00407 const char *locale,
00408 UChar* result,
00409 int32_t resultLength,
00410 UErrorCode* status);
00411
00420 U_CAPI UBool U_EXPORT2
00421 ucal_inDaylightTime( const UCalendar* cal,
00422 UErrorCode* status );
00423
00427 enum UCalendarAttribute {
00429 UCAL_LENIENT,
00431 UCAL_FIRST_DAY_OF_WEEK,
00433 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
00434 };
00435
00437 typedef enum UCalendarAttribute UCalendarAttribute;
00438
00450 U_CAPI int32_t U_EXPORT2
00451 ucal_getAttribute( const UCalendar* cal,
00452 UCalendarAttribute attr);
00453
00465 U_CAPI void U_EXPORT2
00466 ucal_setAttribute( UCalendar* cal,
00467 UCalendarAttribute attr,
00468 int32_t newValue);
00469
00479 U_CAPI const char* U_EXPORT2
00480 ucal_getAvailable(int32_t index);
00481
00490 U_CAPI int32_t U_EXPORT2
00491 ucal_countAvailable(void);
00492
00504 U_CAPI UDate U_EXPORT2
00505 ucal_getMillis( const UCalendar* cal,
00506 UErrorCode* status);
00507
00519 U_CAPI void U_EXPORT2
00520 ucal_setMillis( UCalendar* cal,
00521 UDate dateTime,
00522 UErrorCode* status );
00523
00538 U_CAPI void U_EXPORT2
00539 ucal_setDate( UCalendar* cal,
00540 int32_t year,
00541 int32_t month,
00542 int32_t date,
00543 UErrorCode *status);
00544
00562 U_CAPI void U_EXPORT2
00563 ucal_setDateTime( UCalendar* cal,
00564 int32_t year,
00565 int32_t month,
00566 int32_t date,
00567 int32_t hour,
00568 int32_t minute,
00569 int32_t second,
00570 UErrorCode *status);
00571
00581 U_CAPI UBool U_EXPORT2
00582 ucal_equivalentTo(const UCalendar* cal1,
00583 const UCalendar* cal2);
00584
00600 U_CAPI void U_EXPORT2
00601 ucal_add( UCalendar* cal,
00602 UCalendarDateFields field,
00603 int32_t amount,
00604 UErrorCode* status);
00605
00621 U_CAPI void U_EXPORT2
00622 ucal_roll( UCalendar* cal,
00623 UCalendarDateFields field,
00624 int32_t amount,
00625 UErrorCode* status);
00626
00643 U_CAPI int32_t U_EXPORT2
00644 ucal_get( const UCalendar* cal,
00645 UCalendarDateFields field,
00646 UErrorCode* status );
00647
00663 U_CAPI void U_EXPORT2
00664 ucal_set( UCalendar* cal,
00665 UCalendarDateFields field,
00666 int32_t value);
00667
00683 U_CAPI UBool U_EXPORT2
00684 ucal_isSet( const UCalendar* cal,
00685 UCalendarDateFields field);
00686
00701 U_CAPI void U_EXPORT2
00702 ucal_clearField( UCalendar* cal,
00703 UCalendarDateFields field);
00704
00715 U_CAPI void U_EXPORT2
00716 ucal_clear(UCalendar* calendar);
00717
00721 enum UCalendarLimitType {
00723 UCAL_MINIMUM,
00725 UCAL_MAXIMUM,
00727 UCAL_GREATEST_MINIMUM,
00729 UCAL_LEAST_MAXIMUM,
00731 UCAL_ACTUAL_MINIMUM,
00733 UCAL_ACTUAL_MAXIMUM
00734 };
00735
00737 typedef enum UCalendarLimitType UCalendarLimitType;
00738
00753 U_CAPI int32_t U_EXPORT2
00754 ucal_getLimit( const UCalendar* cal,
00755 UCalendarDateFields field,
00756 UCalendarLimitType type,
00757 UErrorCode *status);
00758
00759 #endif
00760
00761 #endif