00001 /* 00002 * Copyright © {1996-1999}, International Business Machines Corporation and others. All Rights Reserved. 00003 ******************************************************************************* 00004 */ 00005 00006 #ifndef UCAL_H 00007 #define UCAL_H 00008 00009 #include "unicode/utypes.h" 00129 typedef void* UCalendar; 00130 00132 enum UCalendarType { 00134 UCAL_TRADITIONAL, 00136 UCAL_GREGORIAN 00137 }; 00138 typedef enum UCalendarType UCalendarType; 00139 00141 enum UCalendarDateFields { 00143 UCAL_ERA, 00145 UCAL_YEAR, 00147 UCAL_MONTH, 00149 UCAL_WEEK_OF_YEAR, 00151 UCAL_WEEK_OF_MONTH, 00153 UCAL_DATE, 00155 UCAL_DAY_OF_YEAR, 00157 UCAL_DAY_OF_WEEK, 00159 UCAL_DAY_OF_WEEK_IN_MONTH, 00161 UCAL_AM_PM, 00163 UCAL_HOUR, 00165 UCAL_HOUR_OF_DAY, 00167 UCAL_MINUTE, 00169 UCAL_SECOND, 00171 UCAL_MILLISECOND, 00173 UCAL_ZONE_OFFSET, 00175 UCAL_DST_OFFSET, 00177 UCAL_YEAR_WOY, 00179 UCAL_DOW_LOCAL, 00181 UCAL_FIELD_COUNT 00182 }; 00183 typedef enum UCalendarDateFields UCalendarDateFields; 00190 enum UCalendarDaysOfWeek { 00192 UCAL_SUNDAY = 1, 00194 UCAL_MONDAY, 00196 UCAL_TUESDAY, 00198 UCAL_WEDNESDAY, 00200 UCAL_THURSDAY, 00202 UCAL_FRIDAY, 00204 UCAL_SATURDAY 00205 }; 00206 typedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek; 00207 00209 enum UCalendarMonths { 00211 UCAL_JANUARY, 00213 UCAL_FEBRUARY, 00215 UCAL_MARCH, 00217 UCAL_APRIL, 00219 UCAL_MAY, 00221 UCAL_JUNE, 00223 UCAL_JULY, 00225 UCAL_AUGUST, 00227 UCAL_SEPTEMBER, 00229 UCAL_OCTOBER, 00231 UCAL_NOVEMBER, 00233 UCAL_DECEMBER, 00235 UCAL_UNDECIMBER 00236 }; 00237 typedef enum UCalendarMonths UCalendarMonths; 00238 00240 enum UCalendarAMPMs { 00242 UCAL_AM, 00244 UCAL_PM 00245 }; 00246 typedef enum UCalendarAMPMs UCalendarAMPMs; 00247 00258 U_CAPI const UChar* 00259 ucal_getAvailableTZIDs( int32_t rawOffset, 00260 int32_t index, 00261 UErrorCode* status); 00262 00272 U_CAPI int32_t 00273 ucal_countAvailableTZIDs(int32_t rawOffset); 00274 00281 U_CAPI UDate 00282 ucal_getNow(void); 00283 00296 U_CAPI UCalendar* 00297 ucal_open( const UChar* zoneID, 00298 int32_t len, 00299 const char* locale, 00300 UCalendarType type, 00301 UErrorCode* status); 00302 00309 U_CAPI void 00310 ucal_close(UCalendar *cal); 00311 00321 U_CAPI void 00322 ucal_setTimeZone( UCalendar* cal, 00323 const UChar* zoneID, 00324 int32_t len, 00325 UErrorCode *status); 00326 00328 enum UCalendarDisplayNameType { 00330 UCAL_STANDARD, 00332 UCAL_SHORT_STANDARD, 00334 UCAL_DST, 00336 UCAL_SHORT_DST 00337 }; 00338 typedef enum UCalendarDisplayNameType UCalendarDisplayNameType; 00339 00355 U_CAPI int32_t 00356 ucal_getTimeZoneDisplayName( const UCalendar* cal, 00357 UCalendarDisplayNameType type, 00358 const char *locale, 00359 UChar* result, 00360 int32_t resultLength, 00361 UErrorCode* status); 00362 00371 U_CAPI UBool 00372 ucal_inDaylightTime( const UCalendar* cal, 00373 UErrorCode* status ); 00374 00376 enum UCalendarAttribute { 00378 UCAL_LENIENT, 00380 UCAL_FIRST_DAY_OF_WEEK, 00382 UCAL_MINIMAL_DAYS_IN_FIRST_WEEK 00383 }; 00384 typedef enum UCalendarAttribute UCalendarAttribute; 00385 00397 U_CAPI int32_t 00398 ucal_getAttribute( const UCalendar* cal, 00399 UCalendarAttribute attr); 00400 00412 U_CAPI void 00413 ucal_setAttribute( UCalendar* cal, 00414 UCalendarAttribute attr, 00415 int32_t newValue); 00416 00426 U_CAPI const char* 00427 ucal_getAvailable(int32_t index); 00428 00437 U_CAPI int32_t 00438 ucal_countAvailable(void); 00439 00451 U_CAPI UDate 00452 ucal_getMillis( const UCalendar* cal, 00453 UErrorCode* status); 00454 00466 U_CAPI void 00467 ucal_setMillis( UCalendar* cal, 00468 UDate dateTime, 00469 UErrorCode* status ); 00470 00485 U_CAPI void 00486 ucal_setDate( UCalendar* cal, 00487 int32_t year, 00488 int32_t month, 00489 int32_t date, 00490 UErrorCode *status); 00491 00509 U_CAPI void 00510 ucal_setDateTime( UCalendar* cal, 00511 int32_t year, 00512 int32_t month, 00513 int32_t date, 00514 int32_t hour, 00515 int32_t minute, 00516 int32_t second, 00517 UErrorCode *status); 00518 00528 U_CAPI UBool 00529 ucal_equivalentTo( const UCalendar* cal1, 00530 const UCalendar* cal2); 00531 00547 U_CAPI void 00548 ucal_add( UCalendar* cal, 00549 UCalendarDateFields field, 00550 int32_t amount, 00551 UErrorCode* status); 00552 00568 U_CAPI void 00569 ucal_roll( UCalendar* cal, 00570 UCalendarDateFields field, 00571 int32_t amount, 00572 UErrorCode* status); 00573 00590 U_CAPI int32_t 00591 ucal_get( const UCalendar* cal, 00592 UCalendarDateFields field, 00593 UErrorCode* status ); 00594 00610 U_CAPI void 00611 ucal_set( UCalendar* cal, 00612 UCalendarDateFields field, 00613 int32_t value); 00614 00630 U_CAPI UBool 00631 ucal_isSet( const UCalendar* cal, 00632 UCalendarDateFields field); 00633 00648 U_CAPI void 00649 ucal_clearField( UCalendar* cal, 00650 UCalendarDateFields field); 00651 00662 U_CAPI void 00663 ucal_clear(UCalendar* calendar); 00664 00666 enum UCalendarLimitType { 00668 UCAL_MINIMUM, 00670 UCAL_MAXIMUM, 00672 UCAL_GREATEST_MINIMUM, 00674 UCAL_LEAST_MAXIMUM, 00676 UCAL_ACTUAL_MINIMUM, 00678 UCAL_ACTUAL_MAXIMUM 00679 }; 00680 typedef enum UCalendarLimitType UCalendarLimitType; 00681 00696 U_CAPI int32_t 00697 ucal_getLimit( const UCalendar* cal, 00698 UCalendarDateFields field, 00699 UCalendarLimitType type, 00700 UErrorCode *status); 00701 00702 #endif