00001
00002
00003
00004
00005
00006 #ifndef UCAL_H
00007 #define UCAL_H
00008
00009 #include "unicode/utypes.h"
00140 typedef void* UCalendar;
00141
00145 enum UCalendarType {
00147 UCAL_TRADITIONAL,
00149 UCAL_GREGORIAN
00150 };
00151
00153 typedef enum UCalendarType UCalendarType;
00154
00158 enum UCalendarDateFields {
00160 UCAL_ERA,
00162 UCAL_YEAR,
00164 UCAL_MONTH,
00166 UCAL_WEEK_OF_YEAR,
00168 UCAL_WEEK_OF_MONTH,
00170 UCAL_DATE,
00172 UCAL_DAY_OF_YEAR,
00174 UCAL_DAY_OF_WEEK,
00176 UCAL_DAY_OF_WEEK_IN_MONTH,
00178 UCAL_AM_PM,
00180 UCAL_HOUR,
00182 UCAL_HOUR_OF_DAY,
00184 UCAL_MINUTE,
00186 UCAL_SECOND,
00188 UCAL_MILLISECOND,
00190 UCAL_ZONE_OFFSET,
00192 UCAL_DST_OFFSET,
00194 UCAL_YEAR_WOY,
00196 UCAL_DOW_LOCAL,
00198 UCAL_FIELD_COUNT
00199 };
00200
00202 typedef enum UCalendarDateFields UCalendarDateFields;
00211 enum UCalendarDaysOfWeek {
00213 UCAL_SUNDAY = 1,
00215 UCAL_MONDAY,
00217 UCAL_TUESDAY,
00219 UCAL_WEDNESDAY,
00221 UCAL_THURSDAY,
00223 UCAL_FRIDAY,
00225 UCAL_SATURDAY
00226 };
00227
00229 typedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek;
00230
00234 enum UCalendarMonths {
00236 UCAL_JANUARY,
00238 UCAL_FEBRUARY,
00240 UCAL_MARCH,
00242 UCAL_APRIL,
00244 UCAL_MAY,
00246 UCAL_JUNE,
00248 UCAL_JULY,
00250 UCAL_AUGUST,
00252 UCAL_SEPTEMBER,
00254 UCAL_OCTOBER,
00256 UCAL_NOVEMBER,
00258 UCAL_DECEMBER,
00260 UCAL_UNDECIMBER
00261 };
00262
00264 typedef enum UCalendarMonths UCalendarMonths;
00265
00269 enum UCalendarAMPMs {
00271 UCAL_AM,
00273 UCAL_PM
00274 };
00275
00277 typedef enum UCalendarAMPMs UCalendarAMPMs;
00278
00289 U_CAPI const UChar* U_EXPORT2
00290 ucal_getAvailableTZIDs( int32_t rawOffset,
00291 int32_t index,
00292 UErrorCode* status);
00293
00303 U_CAPI int32_t U_EXPORT2
00304 ucal_countAvailableTZIDs(int32_t rawOffset);
00305
00312 U_CAPI UDate U_EXPORT2
00313 ucal_getNow(void);
00314
00327 U_CAPI UCalendar* U_EXPORT2
00328 ucal_open( const UChar* zoneID,
00329 int32_t len,
00330 const char* locale,
00331 UCalendarType type,
00332 UErrorCode* status);
00333
00340 U_CAPI void U_EXPORT2
00341 ucal_close(UCalendar *cal);
00342
00352 U_CAPI void U_EXPORT2
00353 ucal_setTimeZone( UCalendar* cal,
00354 const UChar* zoneID,
00355 int32_t len,
00356 UErrorCode *status);
00357
00361 enum UCalendarDisplayNameType {
00363 UCAL_STANDARD,
00365 UCAL_SHORT_STANDARD,
00367 UCAL_DST,
00369 UCAL_SHORT_DST
00370 };
00371
00373 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
00374
00388 U_CAPI int32_t U_EXPORT2
00389 ucal_getTimeZoneDisplayName( const UCalendar* cal,
00390 UCalendarDisplayNameType type,
00391 const char *locale,
00392 UChar* result,
00393 int32_t resultLength,
00394 UErrorCode* status);
00395
00404 U_CAPI UBool U_EXPORT2
00405 ucal_inDaylightTime( const UCalendar* cal,
00406 UErrorCode* status );
00407
00411 enum UCalendarAttribute {
00413 UCAL_LENIENT,
00415 UCAL_FIRST_DAY_OF_WEEK,
00417 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
00418 };
00419
00421 typedef enum UCalendarAttribute UCalendarAttribute;
00422
00434 U_CAPI int32_t U_EXPORT2
00435 ucal_getAttribute( const UCalendar* cal,
00436 UCalendarAttribute attr);
00437
00449 U_CAPI void U_EXPORT2
00450 ucal_setAttribute( UCalendar* cal,
00451 UCalendarAttribute attr,
00452 int32_t newValue);
00453
00463 U_CAPI const char* U_EXPORT2
00464 ucal_getAvailable(int32_t index);
00465
00474 U_CAPI int32_t U_EXPORT2
00475 ucal_countAvailable(void);
00476
00488 U_CAPI UDate U_EXPORT2
00489 ucal_getMillis( const UCalendar* cal,
00490 UErrorCode* status);
00491
00503 U_CAPI void U_EXPORT2
00504 ucal_setMillis( UCalendar* cal,
00505 UDate dateTime,
00506 UErrorCode* status );
00507
00522 U_CAPI void U_EXPORT2
00523 ucal_setDate( UCalendar* cal,
00524 int32_t year,
00525 int32_t month,
00526 int32_t date,
00527 UErrorCode *status);
00528
00546 U_CAPI void U_EXPORT2
00547 ucal_setDateTime( UCalendar* cal,
00548 int32_t year,
00549 int32_t month,
00550 int32_t date,
00551 int32_t hour,
00552 int32_t minute,
00553 int32_t second,
00554 UErrorCode *status);
00555
00565 U_CAPI UBool U_EXPORT2
00566 ucal_equivalentTo( const UCalendar* cal1,
00567 const UCalendar* cal2);
00568
00584 U_CAPI void U_EXPORT2
00585 ucal_add( UCalendar* cal,
00586 UCalendarDateFields field,
00587 int32_t amount,
00588 UErrorCode* status);
00589
00605 U_CAPI void U_EXPORT2
00606 ucal_roll( UCalendar* cal,
00607 UCalendarDateFields field,
00608 int32_t amount,
00609 UErrorCode* status);
00610
00627 U_CAPI int32_t U_EXPORT2
00628 ucal_get( const UCalendar* cal,
00629 UCalendarDateFields field,
00630 UErrorCode* status );
00631
00647 U_CAPI void U_EXPORT2
00648 ucal_set( UCalendar* cal,
00649 UCalendarDateFields field,
00650 int32_t value);
00651
00667 U_CAPI UBool U_EXPORT2
00668 ucal_isSet( const UCalendar* cal,
00669 UCalendarDateFields field);
00670
00685 U_CAPI void U_EXPORT2
00686 ucal_clearField( UCalendar* cal,
00687 UCalendarDateFields field);
00688
00699 U_CAPI void U_EXPORT2
00700 ucal_clear(UCalendar* calendar);
00701
00705 enum UCalendarLimitType {
00707 UCAL_MINIMUM,
00709 UCAL_MAXIMUM,
00711 UCAL_GREATEST_MINIMUM,
00713 UCAL_LEAST_MAXIMUM,
00715 UCAL_ACTUAL_MINIMUM,
00717 UCAL_ACTUAL_MAXIMUM
00718 };
00719
00721 typedef enum UCalendarLimitType UCalendarLimitType;
00722
00737 U_CAPI int32_t U_EXPORT2
00738 ucal_getLimit( const UCalendar* cal,
00739 UCalendarDateFields field,
00740 UCalendarLimitType type,
00741 UErrorCode *status);
00742
00743 #endif