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
00390 U_CAPI int32_t U_EXPORT2
00391
ucal_getTimeZoneDisplayName(
const UCalendar* cal,
00392 UCalendarDisplayNameType type,
00393
const char *locale,
00394 UChar* result,
00395 int32_t resultLength,
00396 UErrorCode* status);
00397
00406 U_CAPI UBool U_EXPORT2
00407
ucal_inDaylightTime(
const UCalendar* cal,
00408 UErrorCode* status );
00409
00413 enum UCalendarAttribute {
00415
UCAL_LENIENT,
00417
UCAL_FIRST_DAY_OF_WEEK,
00419
UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
00420 };
00421
00423 typedef enum UCalendarAttribute UCalendarAttribute;
00424
00436 U_CAPI int32_t U_EXPORT2
00437
ucal_getAttribute(
const UCalendar* cal,
00438 UCalendarAttribute attr);
00439
00451 U_CAPI
void U_EXPORT2
00452
ucal_setAttribute( UCalendar* cal,
00453 UCalendarAttribute attr,
00454 int32_t newValue);
00455
00465 U_CAPI
const char* U_EXPORT2
00466
ucal_getAvailable(int32_t index);
00467
00476 U_CAPI int32_t U_EXPORT2
00477
ucal_countAvailable(
void);
00478
00490 U_CAPI
UDate U_EXPORT2
00491
ucal_getMillis(
const UCalendar* cal,
00492 UErrorCode* status);
00493
00505 U_CAPI
void U_EXPORT2
00506
ucal_setMillis( UCalendar* cal,
00507 UDate dateTime,
00508 UErrorCode* status );
00509
00524 U_CAPI
void U_EXPORT2
00525
ucal_setDate( UCalendar* cal,
00526 int32_t year,
00527 int32_t month,
00528 int32_t date,
00529 UErrorCode *status);
00530
00548 U_CAPI
void U_EXPORT2
00549
ucal_setDateTime( UCalendar* cal,
00550 int32_t year,
00551 int32_t month,
00552 int32_t date,
00553 int32_t hour,
00554 int32_t minute,
00555 int32_t second,
00556 UErrorCode *status);
00557
00567 U_CAPI UBool U_EXPORT2
00568
ucal_equivalentTo(
const UCalendar* cal1,
00569
const UCalendar* cal2);
00570
00586 U_CAPI
void U_EXPORT2
00587
ucal_add( UCalendar* cal,
00588 UCalendarDateFields field,
00589 int32_t amount,
00590 UErrorCode* status);
00591
00607 U_CAPI
void U_EXPORT2
00608
ucal_roll( UCalendar* cal,
00609 UCalendarDateFields field,
00610 int32_t amount,
00611 UErrorCode* status);
00612
00629 U_CAPI int32_t U_EXPORT2
00630
ucal_get(
const UCalendar* cal,
00631 UCalendarDateFields field,
00632 UErrorCode* status );
00633
00649 U_CAPI
void U_EXPORT2
00650
ucal_set( UCalendar* cal,
00651 UCalendarDateFields field,
00652 int32_t value);
00653
00669 U_CAPI UBool U_EXPORT2
00670
ucal_isSet(
const UCalendar* cal,
00671 UCalendarDateFields field);
00672
00687 U_CAPI
void U_EXPORT2
00688
ucal_clearField( UCalendar* cal,
00689 UCalendarDateFields field);
00690
00701 U_CAPI
void U_EXPORT2
00702
ucal_clear(UCalendar* calendar);
00703
00707 enum UCalendarLimitType {
00709
UCAL_MINIMUM,
00711
UCAL_MAXIMUM,
00713
UCAL_GREATEST_MINIMUM,
00715
UCAL_LEAST_MAXIMUM,
00717
UCAL_ACTUAL_MINIMUM,
00719
UCAL_ACTUAL_MAXIMUM
00720 };
00721
00723 typedef enum UCalendarLimitType UCalendarLimitType;
00724
00739 U_CAPI int32_t U_EXPORT2
00740
ucal_getLimit(
const UCalendar* cal,
00741 UCalendarDateFields field,
00742 UCalendarLimitType type,
00743 UErrorCode *status);
00744
00745
#endif