ICU 49.1.1
49.1.1
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
i18n
unicode
ucal.h
Go to the documentation of this file.
1
/*
2
*******************************************************************************
3
* Copyright (C) 1996-2012, International Business Machines Corporation and
4
* others. All Rights Reserved.
5
*******************************************************************************
6
*/
7
8
#ifndef UCAL_H
9
#define UCAL_H
10
11
#include "
unicode/utypes.h
"
12
#include "
unicode/uenum.h
"
13
#include "
unicode/uloc.h
"
14
#include "
unicode/localpointer.h
"
15
16
#if !UCONFIG_NO_FORMATTING
17
147
#define UCAL_UNKNOWN_ZONE_ID "Etc/Unknown"
148
153
typedef
void
*
UCalendar
;
154
158
enum
UCalendarType
{
164
UCAL_TRADITIONAL
,
169
UCAL_DEFAULT
=
UCAL_TRADITIONAL
,
174
UCAL_GREGORIAN
175
};
176
178
typedef
enum
UCalendarType
UCalendarType
;
179
183
enum
UCalendarDateFields
{
189
UCAL_ERA
,
190
195
UCAL_YEAR
,
196
216
UCAL_MONTH
,
217
229
UCAL_WEEK_OF_YEAR
,
230
244
UCAL_WEEK_OF_MONTH
,
245
253
UCAL_DATE
,
254
260
UCAL_DAY_OF_YEAR
,
261
276
UCAL_DAY_OF_WEEK
,
277
301
UCAL_DAY_OF_WEEK_IN_MONTH
,
302
312
UCAL_AM_PM
,
313
323
UCAL_HOUR
,
324
332
UCAL_HOUR_OF_DAY
,
333
340
UCAL_MINUTE
,
341
348
UCAL_SECOND
,
349
356
UCAL_MILLISECOND
,
357
363
UCAL_ZONE_OFFSET
,
364
370
UCAL_DST_OFFSET
,
371
379
UCAL_YEAR_WOY
,
380
387
UCAL_DOW_LOCAL
,
388
395
UCAL_EXTENDED_YEAR
,
396
407
UCAL_JULIAN_DAY
,
408
418
UCAL_MILLISECONDS_IN_DAY
,
419
424
UCAL_IS_LEAP_MONTH
,
425
430
UCAL_FIELD_COUNT
,
431
440
UCAL_DAY_OF_MONTH
=
UCAL_DATE
441
};
442
444
typedef
enum
UCalendarDateFields
UCalendarDateFields
;
453
enum
UCalendarDaysOfWeek
{
455
UCAL_SUNDAY
= 1,
457
UCAL_MONDAY
,
459
UCAL_TUESDAY
,
461
UCAL_WEDNESDAY
,
463
UCAL_THURSDAY
,
465
UCAL_FRIDAY
,
467
UCAL_SATURDAY
468
};
469
471
typedef
enum
UCalendarDaysOfWeek
UCalendarDaysOfWeek
;
472
476
enum
UCalendarMonths
{
478
UCAL_JANUARY
,
480
UCAL_FEBRUARY
,
482
UCAL_MARCH
,
484
UCAL_APRIL
,
486
UCAL_MAY
,
488
UCAL_JUNE
,
490
UCAL_JULY
,
492
UCAL_AUGUST
,
494
UCAL_SEPTEMBER
,
496
UCAL_OCTOBER
,
498
UCAL_NOVEMBER
,
500
UCAL_DECEMBER
,
505
UCAL_UNDECIMBER
506
};
507
509
typedef
enum
UCalendarMonths
UCalendarMonths
;
510
514
enum
UCalendarAMPMs
{
516
UCAL_AM
,
518
UCAL_PM
519
};
520
522
typedef
enum
UCalendarAMPMs
UCalendarAMPMs
;
523
530
enum
USystemTimeZoneType
{
535
UCAL_ZONE_TYPE_ANY
,
540
UCAL_ZONE_TYPE_CANONICAL
,
545
UCAL_ZONE_TYPE_CANONICAL_LOCATION
546
};
547
549
typedef
enum
USystemTimeZoneType
USystemTimeZoneType
;
550
567
U_DRAFT
UEnumeration
* U_EXPORT2
568
ucal_openTimeZoneIDEnumeration
(
USystemTimeZoneType
zoneType,
const
char
* region,
569
const
int32_t* rawOffset,
UErrorCode
* ec);
570
582
U_STABLE
UEnumeration
* U_EXPORT2
583
ucal_openTimeZones
(
UErrorCode
* ec);
584
601
U_STABLE
UEnumeration
* U_EXPORT2
602
ucal_openCountryTimeZones
(
const
char
* country,
UErrorCode
* ec);
603
620
U_STABLE
int32_t U_EXPORT2
621
ucal_getDefaultTimeZone
(
UChar
* result, int32_t resultCapacity,
UErrorCode
* ec);
622
632
U_STABLE
void
U_EXPORT2
633
ucal_setDefaultTimeZone
(
const
UChar
* zoneID,
UErrorCode
* ec);
634
651
U_STABLE
int32_t U_EXPORT2
652
ucal_getDSTSavings
(
const
UChar
* zoneID,
UErrorCode
* ec);
653
660
U_STABLE
UDate
U_EXPORT2
661
ucal_getNow
(
void
);
662
686
U_STABLE
UCalendar
* U_EXPORT2
687
ucal_open
(
const
UChar
* zoneID,
688
int32_t len,
689
const
char
* locale,
690
UCalendarType
type,
691
UErrorCode
* status);
692
699
U_STABLE
void
U_EXPORT2
700
ucal_close
(
UCalendar
*cal);
701
702
#if U_SHOW_CPLUSPLUS_API
703
704
U_NAMESPACE_BEGIN
705
715
U_DEFINE_LOCAL_OPEN_POINTER(LocalUCalendarPointer,
UCalendar
,
ucal_close
);
716
717
U_NAMESPACE_END
718
719
#endif
720
729
U_STABLE
UCalendar
* U_EXPORT2
730
ucal_clone
(
const
UCalendar
* cal,
731
UErrorCode
* status);
732
742
U_STABLE
void
U_EXPORT2
743
ucal_setTimeZone
(
UCalendar
* cal,
744
const
UChar
* zoneID,
745
int32_t len,
746
UErrorCode
* status);
747
752
enum
UCalendarDisplayNameType
{
754
UCAL_STANDARD
,
756
UCAL_SHORT_STANDARD
,
758
UCAL_DST
,
760
UCAL_SHORT_DST
761
};
762
764
typedef
enum
UCalendarDisplayNameType
UCalendarDisplayNameType
;
765
779
U_STABLE
int32_t U_EXPORT2
780
ucal_getTimeZoneDisplayName
(
const
UCalendar
* cal,
781
UCalendarDisplayNameType
type,
782
const
char
* locale,
783
UChar
* result,
784
int32_t resultLength,
785
UErrorCode
* status);
786
795
U_STABLE
UBool
U_EXPORT2
796
ucal_inDaylightTime
(
const
UCalendar
* cal,
797
UErrorCode
* status );
798
819
U_STABLE
void
U_EXPORT2
820
ucal_setGregorianChange
(
UCalendar
*cal,
UDate
date,
UErrorCode
*pErrorCode);
821
842
U_STABLE
UDate
U_EXPORT2
843
ucal_getGregorianChange
(
const
UCalendar
*cal,
UErrorCode
*pErrorCode);
844
849
enum
UCalendarAttribute
{
854
UCAL_LENIENT
,
859
UCAL_FIRST_DAY_OF_WEEK
,
864
UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
865
#ifndef U_HIDE_DRAFT_API
866
,
872
UCAL_REPEATED_WALL_TIME
,
878
UCAL_SKIPPED_WALL_TIME
879
#endif
/* U_HIDE_DRAFT_API */
880
};
881
883
typedef
enum
UCalendarAttribute
UCalendarAttribute
;
884
890
enum
UCalendarWallTimeOption
{
897
UCAL_WALLTIME_LAST
898
#ifndef U_HIDE_DRAFT_API
899
,
906
UCAL_WALLTIME_FIRST
,
912
UCAL_WALLTIME_NEXT_VALID
913
#endif
/* U_HIDE_DRAFT_API */
914
};
916
typedef
enum
UCalendarWallTimeOption
UCalendarWallTimeOption
;
917
929
U_STABLE
int32_t U_EXPORT2
930
ucal_getAttribute
(
const
UCalendar
* cal,
931
UCalendarAttribute
attr);
932
944
U_STABLE
void
U_EXPORT2
945
ucal_setAttribute
(
UCalendar
* cal,
946
UCalendarAttribute
attr,
947
int32_t newValue);
948
958
U_STABLE
const
char
* U_EXPORT2
959
ucal_getAvailable
(int32_t localeIndex);
960
969
U_STABLE
int32_t U_EXPORT2
970
ucal_countAvailable
(
void
);
971
983
U_STABLE
UDate
U_EXPORT2
984
ucal_getMillis
(
const
UCalendar
* cal,
985
UErrorCode
* status);
986
998
U_STABLE
void
U_EXPORT2
999
ucal_setMillis
(
UCalendar
* cal,
1000
UDate
dateTime,
1001
UErrorCode
* status );
1002
1017
U_STABLE
void
U_EXPORT2
1018
ucal_setDate
(
UCalendar
* cal,
1019
int32_t year,
1020
int32_t month,
1021
int32_t date,
1022
UErrorCode
* status);
1023
1041
U_STABLE
void
U_EXPORT2
1042
ucal_setDateTime
(
UCalendar
* cal,
1043
int32_t year,
1044
int32_t month,
1045
int32_t date,
1046
int32_t hour,
1047
int32_t minute,
1048
int32_t second,
1049
UErrorCode
* status);
1050
1060
U_STABLE
UBool
U_EXPORT2
1061
ucal_equivalentTo
(
const
UCalendar
* cal1,
1062
const
UCalendar
* cal2);
1063
1079
U_STABLE
void
U_EXPORT2
1080
ucal_add
(
UCalendar
* cal,
1081
UCalendarDateFields
field,
1082
int32_t amount,
1083
UErrorCode
* status);
1084
1100
U_STABLE
void
U_EXPORT2
1101
ucal_roll
(
UCalendar
* cal,
1102
UCalendarDateFields
field,
1103
int32_t amount,
1104
UErrorCode
* status);
1105
1122
U_STABLE
int32_t U_EXPORT2
1123
ucal_get
(
const
UCalendar
* cal,
1124
UCalendarDateFields
field,
1125
UErrorCode
* status );
1126
1142
U_STABLE
void
U_EXPORT2
1143
ucal_set
(
UCalendar
* cal,
1144
UCalendarDateFields
field,
1145
int32_t value);
1146
1162
U_STABLE
UBool
U_EXPORT2
1163
ucal_isSet
(
const
UCalendar
* cal,
1164
UCalendarDateFields
field);
1165
1180
U_STABLE
void
U_EXPORT2
1181
ucal_clearField
(
UCalendar
* cal,
1182
UCalendarDateFields
field);
1183
1194
U_STABLE
void
U_EXPORT2
1195
ucal_clear
(
UCalendar
* calendar);
1196
1201
enum
UCalendarLimitType
{
1203
UCAL_MINIMUM
,
1205
UCAL_MAXIMUM
,
1207
UCAL_GREATEST_MINIMUM
,
1209
UCAL_LEAST_MAXIMUM
,
1211
UCAL_ACTUAL_MINIMUM
,
1213
UCAL_ACTUAL_MAXIMUM
1214
};
1215
1217
typedef
enum
UCalendarLimitType
UCalendarLimitType
;
1218
1233
U_STABLE
int32_t U_EXPORT2
1234
ucal_getLimit
(
const
UCalendar
* cal,
1235
UCalendarDateFields
field,
1236
UCalendarLimitType
type,
1237
UErrorCode
* status);
1238
1246
U_STABLE
const
char
* U_EXPORT2
1247
ucal_getLocaleByType
(
const
UCalendar
*cal,
ULocDataLocaleType
type,
UErrorCode
* status);
1248
1255
U_STABLE
const
char
* U_EXPORT2
1256
ucal_getTZDataVersion
(
UErrorCode
* status);
1257
1276
U_STABLE
int32_t U_EXPORT2
1277
ucal_getCanonicalTimeZoneID
(
const
UChar
*
id
, int32_t len,
1278
UChar
* result, int32_t resultCapacity,
UBool
*isSystemID,
UErrorCode
* status);
1286
U_STABLE
const
char
* U_EXPORT2
1287
ucal_getType
(
const
UCalendar
*cal,
UErrorCode
* status);
1288
1305
U_STABLE
UEnumeration
* U_EXPORT2
1306
ucal_getKeywordValuesForLocale
(
const
char
* key,
1307
const
char
* locale,
1308
UBool
commonlyUsed,
1309
UErrorCode
* status);
1310
1311
1315
enum
UCalendarWeekdayType
{
1320
UCAL_WEEKDAY
,
1325
UCAL_WEEKEND
,
1331
UCAL_WEEKEND_ONSET
,
1337
UCAL_WEEKEND_CEASE
1338
};
1339
1341
typedef
enum
UCalendarWeekdayType
UCalendarWeekdayType
;
1342
1359
U_STABLE
UCalendarWeekdayType
U_EXPORT2
1360
ucal_getDayOfWeekType
(
const
UCalendar
*cal,
UCalendarDaysOfWeek
dayOfWeek,
UErrorCode
* status);
1361
1377
U_STABLE
int32_t U_EXPORT2
1378
ucal_getWeekendTransition
(
const
UCalendar
*cal,
UCalendarDaysOfWeek
dayOfWeek,
UErrorCode
*status);
1379
1390
U_STABLE
UBool
U_EXPORT2
1391
ucal_isWeekend
(
const
UCalendar
*cal,
UDate
date,
UErrorCode
*status);
1392
1417
U_DRAFT
int32_t U_EXPORT2
1418
ucal_getFieldDifference
(
UCalendar
* cal,
1419
UDate
target,
1420
UCalendarDateFields
field,
1421
UErrorCode
* status);
1422
1423
#endif
/* #if !UCONFIG_NO_FORMATTING */
1424
1425
#endif
Generated by
1.8.1.2