16f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/*
26f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *******************************************************************************
36f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Copyright (C) 1996-2013, International Business Machines Corporation and
46f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * others. All Rights Reserved.
56f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *******************************************************************************
66f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
76f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
86f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef UCAL_H
96f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define UCAL_H
106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/utypes.h"
126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/uenum.h"
136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/uloc.h"
146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/localpointer.h"
156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if !UCONFIG_NO_FORMATTING
176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \file
206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \brief C API: Calendar
216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <h2>Calendar C API</h2>
236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCalendar C API is used  for converting between a <code>UDate</code> object
256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * and a set of integer fields such as <code>UCAL_YEAR</code>, <code>UCAL_MONTH</code>,
266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>UCAL_DAY</code>, <code>UCAL_HOUR</code>, and so on.
276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * (A <code>UDate</code> object represents a specific instant in
286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * time with millisecond precision. See UDate
296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * for information about the <code>UDate</code> .)
306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Types of <code>UCalendar</code> interpret a <code>UDate</code>
336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * according to the rules of a specific calendar system. The U_STABLE
346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * provides the enum UCalendarType with UCAL_TRADITIONAL and
356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_GREGORIAN.
366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Like other locale-sensitive C API, calendar API  provides a
386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * function, <code>ucal_open()</code>, which returns a pointer to
396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>UCalendar</code> whose time fields have been initialized
406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * with the current date and time. We need to specify the type of
416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * calendar to be opened and the  timezoneId.
426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \htmlonly<blockquote>\endhtmlonly
436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <pre>
446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \code
456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCalendar *caldef;
466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UChar *tzId;
476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UErrorCode status;
486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * tzId=(UChar*)malloc(sizeof(UChar) * (strlen("PST") +1) );
496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * u_uastrcpy(tzId, "PST");
506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * caldef=ucal_open(tzID, u_strlen(tzID), NULL, UCAL_TRADITIONAL, &status);
516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \endcode
526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * </pre>
536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \htmlonly</blockquote>\endhtmlonly
546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A <code>UCalendar</code> object can produce all the time field values
576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * needed to implement the date-time formatting for a particular language
586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * When computing a <code>UDate</code> from time fields, two special circumstances
626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * may arise: there may be insufficient information to compute the
636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>UDate</code> (such as only year and month but no day in the month),
646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * or there may be inconsistent information (such as "Tuesday, July 15, 1996"
656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * -- July 15, 1996 is actually a Monday).
666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <strong>Insufficient information.</strong> The calendar will use default
696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * information to specify the missing fields. This may vary by calendar; for
706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * the Gregorian calendar, the default for a field is the same as that of the
716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * start of the epoch: i.e., UCAL_YEAR = 1970, UCAL_MONTH = JANUARY, UCAL_DATE = 1, etc.
726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <strong>Inconsistent information.</strong> If fields conflict, the calendar
756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * will give preference to fields set more recently. For example, when
766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * determining the day, the calendar will look for one of the following
776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * combinations of fields.  The most recent combination, as determined by the
786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * most recently set single field, will be used.
796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \htmlonly<blockquote>\endhtmlonly
816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <pre>
826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \code
836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MONTH + UCAL_DAY_OF_MONTH
846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MONTH + UCAL_WEEK_OF_MONTH + UCAL_DAY_OF_WEEK
856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MONTH + UCAL_DAY_OF_WEEK_IN_MONTH + UCAL_DAY_OF_WEEK
866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_YEAR
876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK + UCAL_WEEK_OF_YEAR
886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \endcode
896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * </pre>
906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \htmlonly</blockquote>\endhtmlonly
916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * For the time of day:
936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \htmlonly<blockquote>\endhtmlonly
956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <pre>
966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \code
976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_HOUR_OF_DAY
986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_AM_PM + UCAL_HOUR
996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \endcode
1006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * </pre>
1016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \htmlonly</blockquote>\endhtmlonly
1026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
1046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <strong>Note:</strong> for some non-Gregorian calendars, different
1056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * fields may be necessary for complete disambiguation. For example, a full
1066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * specification of the historial Arabic astronomical calendar requires year,
1076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * month, day-of-month <em>and</em> day-of-week in some cases.
1086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
1106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <strong>Note:</strong> There are certain possible ambiguities in
1116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * interpretation of certain singular times, which are resolved in the
1126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * following ways:
1136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <ol>
1146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *     <li> 24:00:00 "belongs" to the following day. That is,
1156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *          23:59 on Dec 31, 1969 &lt; 24:00 on Jan 1, 1970 &lt; 24:01:00 on Jan 1, 1970
1166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *     <li> Although historically not precise, midnight also belongs to "am",
1186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *          and noon belongs to "pm", so on the same day,
1196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *          12:00 am (midnight) &lt; 12:01 am, and 12:00 pm (noon) &lt; 12:01 pm
1206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * </ol>
1216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
1236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The date or time format strings are not part of the definition of a
1246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * calendar, as those must be modifiable or overridable by the user at
1256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * runtime. Use {@link icu::DateFormat}
1266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * to format dates.
1276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
1296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>Calendar</code> provides an API for field "rolling", where fields
1306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * can be incremented or decremented, but wrap around. For example, rolling the
1316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * month up in the date <code>December 12, <b>1996</b></code> results in
1326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>January 12, <b>1996</b></code>.
1336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
1356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>Calendar</code> also provides a date arithmetic function for
1366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * adding the specified (signed) amount of time to a particular time field.
1376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * For example, subtracting 5 days from the date <code>September 12, 1996</code>
1386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * results in <code>September 7, 1996</code>.
1396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
1406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
1416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
1446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The time zone ID reserved for unknown time zone.
1456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.8
1466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define UCAL_UNKNOWN_ZONE_ID "Etc/Unknown"
1486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** A calendar.
1506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *  For usage in C programs.
1516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
1526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef void* UCalendar;
1546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Possible types of UCalendars
1566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
1576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarType {
1596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
1606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Despite the name, UCAL_TRADITIONAL designates the locale's default calendar,
1616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * which may be the Gregorian calendar or some other calendar.
1626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
1636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
1646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_TRADITIONAL,
1656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
1666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * A better name for UCAL_TRADITIONAL.
1676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.2
1686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
1696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DEFAULT = UCAL_TRADITIONAL,
1706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
1716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Unambiguously designates the Gregorian calendar for the locale.
1726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
1736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
1746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_GREGORIAN
1756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
1766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
1786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarType UCalendarType;
1796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Possible fields in a UCalendar
1816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
1826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
1836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarDateFields {
1846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
1856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the era, e.g., AD or BC in the Gregorian (Julian) calendar.
1866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * This is a calendar-specific value.
1876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
1886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
1896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_ERA,
1906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
1926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the year. This is a calendar-specific value.
1936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
1946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
1956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_YEAR,
1966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
1986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the month. This is a calendar-specific value.
1996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The first month of the year is
2006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>JANUARY</code>; the last depends on the number of months in a year.
2016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_JANUARY
2026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_FEBRUARY
2036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_MARCH
2046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_APRIL
2056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_MAY
2066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_JUNE
2076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_JULY
2086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_AUGUST
2096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_SEPTEMBER
2106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_OCTOBER
2116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_NOVEMBER
2126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_DECEMBER
2136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_UNDECIMBER
2146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
2156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MONTH,
2176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
2196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
2206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * week number within the current year.  The first week of the year, as
2216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * defined by <code>UCAL_FIRST_DAY_OF_WEEK</code> and <code>UCAL_MINIMAL_DAYS_IN_FIRST_WEEK</code>
2226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * attributes, has value 1.  Subclasses define
2236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the value of <code>UCAL_WEEK_OF_YEAR</code> for days before the first week of
2246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the year.
2256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see ucal_getAttribute
2266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see ucal_setAttribute
2276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
2286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEEK_OF_YEAR,
2306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
2326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
2336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * week number within the current month.  The first week of the month, as
2346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * defined by <code>UCAL_FIRST_DAY_OF_WEEK</code> and <code>UCAL_MINIMAL_DAYS_IN_FIRST_WEEK</code>
2356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * attributes, has value 1.  Subclasses define
2366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the value of <code>WEEK_OF_MONTH</code> for days before the first week of
2376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the month.
2386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see ucal_getAttribute
2396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see ucal_setAttribute
2406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_FIRST_DAY_OF_WEEK
2416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_MINIMAL_DAYS_IN_FIRST_WEEK
2426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
2436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEEK_OF_MONTH,
2456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
2476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
2486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * day of the month. This is a synonym for <code>DAY_OF_MONTH</code>.
2496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The first day of the month has value 1.
2506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_DAY_OF_MONTH
2516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
2526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DATE,
2546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
2566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the day
2576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * number within the current year.  The first day of the year has value 1.
2586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
2596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DAY_OF_YEAR,
2616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
2636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the day
2646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of the week.  This field takes values <code>SUNDAY</code>,
2656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>MONDAY</code>, <code>TUESDAY</code>, <code>WEDNESDAY</code>,
2666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>THURSDAY</code>, <code>FRIDAY</code>, and <code>SATURDAY</code>.
2676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_SUNDAY
2686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_MONDAY
2696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_TUESDAY
2706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_WEDNESDAY
2716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_THURSDAY
2726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_FRIDAY
2736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_SATURDAY
2746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
2756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
2766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DAY_OF_WEEK,
2776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
2796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
2806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * ordinal number of the day of the week within the current month. Together
2816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * with the <code>DAY_OF_WEEK</code> field, this uniquely specifies a day
2826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * within a month.  Unlike <code>WEEK_OF_MONTH</code> and
2836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>WEEK_OF_YEAR</code>, this field's value does <em>not</em> depend on
2846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>getFirstDayOfWeek()</code> or
2856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>getMinimalDaysInFirstWeek()</code>.  <code>DAY_OF_MONTH 1</code>
2866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * through <code>7</code> always correspond to <code>DAY_OF_WEEK_IN_MONTH
2876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * 1</code>; <code>8</code> through <code>15</code> correspond to
2886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>DAY_OF_WEEK_IN_MONTH 2</code>, and so on.
2896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>DAY_OF_WEEK_IN_MONTH 0</code> indicates the week before
2906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>DAY_OF_WEEK_IN_MONTH 1</code>.  Negative values count back from the
2916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * end of the month, so the last Sunday of a month is specified as
2926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>DAY_OF_WEEK = SUNDAY, DAY_OF_WEEK_IN_MONTH = -1</code>.  Because
2936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * negative values count backward they will usually be aligned differently
2946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * within the month than positive values.  For example, if a month has 31
2956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * days, <code>DAY_OF_WEEK_IN_MONTH -1</code> will overlap
2966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>DAY_OF_WEEK_IN_MONTH 5</code> and the end of <code>4</code>.
2976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_DAY_OF_WEEK
2986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_WEEK_OF_MONTH
2996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DAY_OF_WEEK_IN_MONTH,
3026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating
3056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * whether the <code>HOUR</code> is before or after noon.
3066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * E.g., at 10:04:15.250 PM the <code>AM_PM</code> is <code>PM</code>.
3076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_AM
3086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_PM
3096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_HOUR
3106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_AM_PM,
3136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * hour of the morning or afternoon. <code>HOUR</code> is used for the 12-hour
3176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * clock.
3186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * E.g., at 10:04:15.250 PM the <code>HOUR</code> is 10.
3196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_AM_PM
3206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_HOUR_OF_DAY
3216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_HOUR,
3246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * hour of the day. <code>HOUR_OF_DAY</code> is used for the 24-hour clock.
3286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * E.g., at 10:04:15.250 PM the <code>HOUR_OF_DAY</code> is 22.
3296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_HOUR
3306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_HOUR_OF_DAY,
3336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * minute within the hour.
3376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * E.g., at 10:04:15.250 PM the <code>UCAL_MINUTE</code> is 4.
3386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MINUTE,
3416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * second within the minute.
3456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * E.g., at 10:04:15.250 PM the <code>UCAL_SECOND</code> is 15.
3466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SECOND,
3496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * millisecond within the second.
3536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * E.g., at 10:04:15.250 PM the <code>UCAL_MILLISECOND</code> is 250.
3546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MILLISECOND,
3576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * raw offset from GMT in milliseconds.
3616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_ZONE_OFFSET,
3646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
3676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * daylight savings offset in milliseconds.
3686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DST_OFFSET,
3716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number
3746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * indicating the extended year corresponding to the
3756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * <code>UCAL_WEEK_OF_YEAR</code> field.  This may be one greater or less
3766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * than the value of <code>UCAL_EXTENDED_YEAR</code>.
3776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_YEAR_WOY,
3806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number
3836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * indicating the localized day of week.  This will be a value from 1
3846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to 7 inclusive, with 1 being the localized first day of the week.
3856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
3866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DOW_LOCAL,
3886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
3906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Year of this calendar system, encompassing all supra-year fields. For example,
3916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * in Gregorian/Julian calendars, positive Extended Year values indicate years AD,
3926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   *  1 BC = 0 extended, 2 BC = -1 extended, and so on.
3936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.8
3946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
3956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_EXTENDED_YEAR,
3966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
3986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number
3996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * indicating the modified Julian day number.  This is different from
4006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the conventional Julian day number in two regards.  First, it
4016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * demarcates days at local zone midnight, rather than noon GMT.
4026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Second, it is a local number; that is, it depends on the local time
4036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * zone.  It can be thought of as a single number that encompasses all
4046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * the date-related fields.
4056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.8
4066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_JULIAN_DAY,
4086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Ranges from 0 to 23:59:59.999 (regardless of DST).  This field behaves <em>exactly</em>
4116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * like a composite of all time-related fields, not including the zone fields.  As such,
4126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * it also reflects discontinuities of those fields on DST transition days.  On a day
4136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * of DST onset, it will jump forward.  On a day of DST cessation, it will jump
4146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * backward.  This reflects the fact that it must be combined with the DST_OFFSET field
4156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * to obtain a unique local time value.
4166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.8
4176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MILLISECONDS_IN_DAY,
4196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Whether or not the current month is a leap month (0 or 1). See the Chinese calendar for
4226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * an example of this.
4236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_IS_LEAP_MONTH,
4256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
4276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field count
4286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.6
4296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
4306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_FIELD_COUNT,
4316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org /**
4336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Field number indicating the
4346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * day of the month. This is a synonym for <code>UCAL_DATE</code>.
4356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The first day of the month has value 1.
4366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @see #UCAL_DATE
4376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Synonym for UCAL_DATE
4386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.8
4396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   **/
4406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DAY_OF_MONTH=UCAL_DATE
4416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
4426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
4446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarDateFields UCalendarDateFields;
4456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
4466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients
4476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * who create locale resources for the field of first-day-of-week should be aware of
4486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * this. For instance, in US locale, first-day-of-week is set to 1, i.e., UCAL_SUNDAY.
4496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
4506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Possible days of the week in a UCalendar
4516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
4526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
4536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarDaysOfWeek {
4546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Sunday */
4556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SUNDAY = 1,
4566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Monday */
4576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MONDAY,
4586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Tuesday */
4596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_TUESDAY,
4606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Wednesday */
4616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEDNESDAY,
4626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Thursday */
4636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_THURSDAY,
4646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Friday */
4656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_FRIDAY,
4666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Saturday */
4676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SATURDAY
4686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
4696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
4716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarDaysOfWeek UCalendarDaysOfWeek;
4726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Possible months in a UCalendar. Note: Calendar month is 0-based.
4746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
4756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
4766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarMonths {
4776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** January */
4786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_JANUARY,
4796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** February */
4806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_FEBRUARY,
4816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** March */
4826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MARCH,
4836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** April */
4846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_APRIL,
4856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** May */
4866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MAY,
4876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** June */
4886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_JUNE,
4896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** July */
4906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_JULY,
4916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** August */
4926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_AUGUST,
4936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** September */
4946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SEPTEMBER,
4956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** October */
4966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_OCTOBER,
4976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** November */
4986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_NOVEMBER,
4996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** December */
5006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DECEMBER,
5016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Value of the <code>UCAL_MONTH</code> field indicating the
5026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    * thirteenth month of the year. Although the Gregorian calendar
5036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    * does not use this value, lunar calendars do.
5046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    */
5056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_UNDECIMBER
5066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
5076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
5096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarMonths UCalendarMonths;
5106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Possible AM/PM values in a UCalendar
5126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
5136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
5146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarAMPMs {
5156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /** AM */
5166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_AM,
5176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** PM */
5186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_PM
5196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
5206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
5226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarAMPMs UCalendarAMPMs;
5236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
5256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * System time zone type constants used by filtering zones
5266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * in ucal_openTimeZoneIDEnumeration.
5276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_openTimeZoneIDEnumeration
5286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.8
5296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
5306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum USystemTimeZoneType {
5316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Any system zones.
5336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 4.8
5346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_ZONE_TYPE_ANY,
5366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Canonical system zones.
5386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 4.8
5396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_ZONE_TYPE_CANONICAL,
5416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Canonical system zones associated with actual locations.
5436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 4.8
5446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_ZONE_TYPE_CANONICAL_LOCATION
5466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
5476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 4.8 */
5496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum USystemTimeZoneType USystemTimeZoneType;
5506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
5526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Create an enumeration over system time zone IDs with the given
5536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * filter conditions.
5546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param zoneType  The system time zone type.
5556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param region    The ISO 3166 two-letter country code or UN M.49
5566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  three-digit area code.  When NULL, no filtering
5576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  done by region.
5586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param rawOffset An offset from GMT in milliseconds, ignoring the
5596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  effect of daylight savings time, if any. When NULL,
5606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  no filtering done by zone offset.
5616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param ec        A pointer to an UErrorCode to receive any errors
5626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return  an enumeration object that the caller must dispose of
5636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *          using enum_close(), or NULL upon failure. In case of failure,
5646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *          *ec will indicate the error.
5656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.8
5666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
5676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UEnumeration* U_EXPORT2
5686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_openTimeZoneIDEnumeration(USystemTimeZoneType zoneType, const char* region,
5696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                const int32_t* rawOffset, UErrorCode* ec);
5706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
5726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Create an enumeration over all time zones.
5736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param ec input/output error code
5756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return an enumeration object that the caller must dispose of using
5776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * uenum_close(), or NULL upon failure. In case of failure *ec will
5786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * indicate the error.
5796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.6
5816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
5826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UEnumeration* U_EXPORT2
5836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_openTimeZones(UErrorCode* ec);
5846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
5866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Create an enumeration over all time zones associated with the given
5876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * country. Some zones are affiliated with no country (e.g., "UTC");
5886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * these may also be retrieved, as a group.
5896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param country the ISO 3166 two-letter country code, or NULL to
5916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * retrieve zones not affiliated with any country
5926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param ec input/output error code
5946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return an enumeration object that the caller must dispose of using
5966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * uenum_close(), or NULL upon failure. In case of failure *ec will
5976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * indicate the error.
5986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
5996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.6
6006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UEnumeration* U_EXPORT2
6026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_openCountryTimeZones(const char* country, UErrorCode* ec);
6036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
6056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Return the default time zone. The default is determined initially
6066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * by querying the host operating system. It may be changed with
6076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * ucal_setDefaultTimeZone() or with the C++ TimeZone API.
6086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param result A buffer to receive the result, or NULL
6106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param resultCapacity The capacity of the result buffer
6126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param ec input/output error code
6146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The result string length, not including the terminating
6166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * null
6176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.6
6196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
6216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getDefaultTimeZone(UChar* result, int32_t resultCapacity, UErrorCode* ec);
6226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
6246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set the default time zone.
6256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param zoneID null-terminated time zone ID
6276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param ec input/output error code
6296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.6
6316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
6336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setDefaultTimeZone(const UChar* zoneID, UErrorCode* ec);
6346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
6366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Return the amount of time in milliseconds that the clock is
6376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * advanced during daylight savings time for the given time zone, or
6386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * zero if the time zone does not observe daylight savings time.
6396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param zoneID null-terminated time zone ID
6416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param ec input/output error code
6436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return the number of milliseconds the time is advanced with
6456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * respect to standard time when the daylight savings rules are in
6466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * effect. This is always a non-negative number, most commonly either
6476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * 3,600,000 (one hour) or zero.
6486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.6
6506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
6526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getDSTSavings(const UChar* zoneID, UErrorCode* ec);
6536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
6556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get the current date and time.
6566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The value returned is represented as milliseconds from the epoch.
6576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The current date and time.
6586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
6596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UDate U_EXPORT2
6616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getNow(void);
6626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
6646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Open a UCalendar.
6656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A UCalendar may be used to convert a millisecond value to a year,
6666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * month, and day.
6676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <p>
6686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Note: When unknown TimeZone ID is specified or if the TimeZone ID specified is "Etc/Unknown",
6696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * the UCalendar returned by the function is initialized with GMT zone with TimeZone ID
6706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>UCAL_UNKNOWN_ZONE_ID</code> ("Etc/Unknown") without any errors/warnings.  If you want
6716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * to check if a TimeZone ID is valid prior to this function, use <code>ucal_getCanonicalTimeZoneID</code>.
6726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
6736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param zoneID The desired TimeZone ID.  If 0, use the default time zone.
6746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param len The length of zoneID, or -1 if null-terminated.
6756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param locale The desired locale
6766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param type The type of UCalendar to open. This can be UCAL_GREGORIAN to open the Gregorian
6776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * calendar for the locale, or UCAL_DEFAULT to open the default calendar for the locale (the
6786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * default calendar may also be Gregorian). To open a specific non-Gregorian calendar for the
6796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * locale, use uloc_setKeywordValue to set the value of the calendar keyword for the locale
6806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * and then pass the locale to ucal_open with UCAL_DEFAULT as the type.
6816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
6826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return A pointer to a UCalendar, or 0 if an error occurred.
6836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see #UCAL_UNKNOWN_ZONE_ID
6846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
6856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UCalendar* U_EXPORT2
6876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_open(const UChar*   zoneID,
6886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t        len,
6896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          const char*    locale,
6906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          UCalendarType  type,
6916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          UErrorCode*    status);
6926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
6946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Close a UCalendar.
6956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Once closed, a UCalendar may no longer be used.
6966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to close.
6976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
6986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
6996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
7006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_close(UCalendar *cal);
7016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if U_SHOW_CPLUSPLUS_API
7036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_NAMESPACE_BEGIN
7056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
7076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \class LocalUCalendarPointer
7086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * "Smart pointer" class, closes a UCalendar via ucal_close().
7096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * For most methods see the LocalPointerBase base class.
7106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
7116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see LocalPointerBase
7126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see LocalPointer
7136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.4
7146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
7156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_DEFINE_LOCAL_OPEN_POINTER(LocalUCalendarPointer, UCalendar, ucal_close);
7166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_NAMESPACE_END
7186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
7206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
7226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Open a copy of a UCalendar.
7236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This function performs a deep copy.
7246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The calendar to copy
7256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors.
7266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return A pointer to a UCalendar identical to cal.
7276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.0
7286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
7296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UCalendar* U_EXPORT2
7306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_clone(const UCalendar* cal,
7316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           UErrorCode*      status);
7326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
7346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set the TimeZone used by a UCalendar.
7356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A UCalendar uses a timezone for converting from Greenwich time to local time.
7366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to set.
7376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param zoneID The desired TimeZone ID.  If 0, use the default time zone.
7386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param len The length of zoneID, or -1 if null-terminated.
7396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors.
7406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
7416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
7426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
7436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setTimeZone(UCalendar*    cal,
7446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 const UChar*  zoneID,
7456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t       len,
7466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 UErrorCode*   status);
7476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef U_HIDE_DRAFT_API
7496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
7506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get the ID of the UCalendar's time zone.
7516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
7526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal           The UCalendar to query.
7536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param result        Receives the UCalendar's time zone ID.
7546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param resultLength  The maximum size of result.
7556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status        Receives the status.
7566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return              The total buffer size needed; if greater than resultLength, the output was truncated.
7576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @draft ICU 51
7586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
7596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_DRAFT int32_t U_EXPORT2
7606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getTimeZoneID(const UCalendar *cal,
7616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   UChar *result,
7626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   int32_t resultLength,
7636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   UErrorCode *status);
7646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif /* U_HIDE_DRAFT_API */
7656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
7676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Possible formats for a UCalendar's display name
7686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
7696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
7706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarDisplayNameType {
7716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Standard display name */
7726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_STANDARD,
7736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Short standard display name */
7746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SHORT_STANDARD,
7756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Daylight savings display name */
7766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_DST,
7776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Short daylight savings display name */
7786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SHORT_DST
7796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
7806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
7826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarDisplayNameType UCalendarDisplayNameType;
7836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
7856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get the display name for a UCalendar's TimeZone.
7866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A display name is suitable for presentation to a user.
7876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal          The UCalendar to query.
7886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param type         The desired display name format; one of UCAL_STANDARD, UCAL_SHORT_STANDARD,
7896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                     UCAL_DST, UCAL_SHORT_DST
7906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param locale       The desired locale for the display name.
7916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param result       A pointer to a buffer to receive the formatted number.
7926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param resultLength The maximum size of result.
7936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status       A pointer to an UErrorCode to receive any errors
7946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return             The total buffer size needed; if greater than resultLength, the output was truncated.
7956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
7966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
7976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
7986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getTimeZoneDisplayName(const UCalendar*          cal,
7996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            UCalendarDisplayNameType  type,
8006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            const char*               locale,
8016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            UChar*                    result,
8026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            int32_t                   resultLength,
8036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            UErrorCode*               status);
8046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
8066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Determine if a UCalendar is currently in daylight savings time.
8076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Daylight savings time is not used in all parts of the world.
8086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
8096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
8106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return TRUE if cal is currently in daylight savings time, FALSE otherwise
8116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
8126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
8136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UBool U_EXPORT2
8146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_inDaylightTime(const UCalendar*  cal,
8156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    UErrorCode*       status );
8166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
8186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Sets the GregorianCalendar change date. This is the point when the switch from
8196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October
8206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * 15, 1582. Previous to this time and date will be Julian dates.
8216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
8226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This function works only for Gregorian calendars. If the UCalendar is not
8236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR
8246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * error code is set.
8256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
8266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal        The calendar object.
8276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param date       The given Gregorian cutover date.
8286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param pErrorCode Pointer to a standard ICU error code. Its input value must
8296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                   pass the U_SUCCESS() test, or else the function returns
8306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                   immediately. Check for U_FAILURE() on output or use with
8316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                   function chaining. (See User Guide for details.)
8326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
8336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see GregorianCalendar::setGregorianChange
8346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_getGregorianChange
8356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 3.6
8366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
8376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
8386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setGregorianChange(UCalendar *cal, UDate date, UErrorCode *pErrorCode);
8396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
8416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Gets the Gregorian Calendar change date. This is the point when the switch from
8426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Julian dates to Gregorian dates occurred. Default is 00:00:00 local time, October
8436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * 15, 1582. Previous to this time and date will be Julian dates.
8446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
8456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This function works only for Gregorian calendars. If the UCalendar is not
8466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * an instance of a Gregorian calendar, then a U_UNSUPPORTED_ERROR
8476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * error code is set.
8486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
8496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal        The calendar object.
8506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param pErrorCode Pointer to a standard ICU error code. Its input value must
8516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                   pass the U_SUCCESS() test, or else the function returns
8526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                   immediately. Check for U_FAILURE() on output or use with
8536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                   function chaining. (See User Guide for details.)
8546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return   The Gregorian cutover time for this calendar.
8556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
8566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see GregorianCalendar::getGregorianChange
8576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setGregorianChange
8586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 3.6
8596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
8606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UDate U_EXPORT2
8616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getGregorianChange(const UCalendar *cal, UErrorCode *pErrorCode);
8626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
8646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Types of UCalendar attributes
8656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
8666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
8676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarAttribute {
8686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Lenient parsing
8706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_LENIENT,
8736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * First day of week
8756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_FIRST_DAY_OF_WEEK,
8786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Minimum number of days in first week
8806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 2.0
8816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MINIMAL_DAYS_IN_FIRST_WEEK,
8836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The behavior for handling wall time repeating multiple times
8856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * at negative time zone offset transitions
8866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 49
8876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_REPEATED_WALL_TIME,
8896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
8906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * The behavior for handling skipped wall time at positive time
8916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * zone offset transitions.
8926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 49
8936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
8946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_SKIPPED_WALL_TIME
8956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
8966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
8986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarAttribute UCalendarAttribute;
8996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
9016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Options for handling ambiguous wall time at time zone
9026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * offset transitions.
9036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 49
9046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
9056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarWallTimeOption {
9066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
9076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * An ambiguous wall time to be interpreted as the latest.
9086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * This option is valid for UCAL_REPEATED_WALL_TIME and
9096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * UCAL_SKIPPED_WALL_TIME.
9106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 49
9116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
9126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_WALLTIME_LAST,
9136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
9146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * An ambiguous wall time to be interpreted as the earliest.
9156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * This option is valid for UCAL_REPEATED_WALL_TIME and
9166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * UCAL_SKIPPED_WALL_TIME.
9176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 49
9186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
9196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_WALLTIME_FIRST,
9206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
9216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * An ambiguous wall time to be interpreted as the next valid
9226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * wall time. This option is valid for UCAL_SKIPPED_WALL_TIME.
9236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 49
9246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
9256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_WALLTIME_NEXT_VALID
9266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
9276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 49 */
9286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarWallTimeOption UCalendarWallTimeOption;
9296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
9316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get a numeric attribute associated with a UCalendar.
9326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Numeric attributes include the first day of the week, or the minimal numbers
9336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * of days in the first week of the month.
9346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
9356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK,
9366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, UCAL_REPEATED_WALL_TIME or UCAL_SKIPPED_WALL_TIME
9376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The value of attr.
9386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setAttribute
9396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
9406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
9416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
9426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getAttribute(const UCalendar*    cal,
9436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  UCalendarAttribute  attr);
9446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
9466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set a numeric attribute associated with a UCalendar.
9476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Numeric attributes include the first day of the week, or the minimal numbers
9486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * of days in the first week of the month.
9496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to set.
9506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param attr The desired attribute; one of UCAL_LENIENT, UCAL_FIRST_DAY_OF_WEEK,
9516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MINIMAL_DAYS_IN_FIRST_WEEK, UCAL_REPEATED_WALL_TIME or UCAL_SKIPPED_WALL_TIME
9526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param newValue The new value of attr.
9536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_getAttribute
9546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
9556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
9566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
9576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setAttribute(UCalendar*          cal,
9586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  UCalendarAttribute  attr,
9596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  int32_t             newValue);
9606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
9626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get a locale for which calendars are available.
9636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A UCalendar in a locale returned by this function will contain the correct
9646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * day and month names for the locale.
9656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param localeIndex The index of the desired locale.
9666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return A locale for which calendars are available, or 0 if none.
9676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_countAvailable
9686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
9696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
9706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE const char* U_EXPORT2
9716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getAvailable(int32_t localeIndex);
9726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
9746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Determine how many locales have calendars available.
9756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This function is most useful as determining the loop ending condition for
9766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * calls to \ref ucal_getAvailable.
9776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The number of locales for which calendars are available.
9786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_getAvailable
9796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
9806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
9816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
9826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_countAvailable(void);
9836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
9856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get a UCalendar's current time in millis.
9866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The time is represented as milliseconds from the epoch.
9876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
9886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
9896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The calendar's current time in millis.
9906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setMillis
9916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setDate
9926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setDateTime
9936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
9946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
9956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UDate U_EXPORT2
9966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getMillis(const UCalendar*  cal,
9976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               UErrorCode*       status);
9986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
10006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set a UCalendar's current time in millis.
10016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The time is represented as milliseconds from the epoch.
10026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to set.
10036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param dateTime The desired date and time.
10046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
10056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_getMillis
10066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setDate
10076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setDateTime
10086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
10096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
10106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
10116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setMillis(UCalendar*   cal,
10126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               UDate        dateTime,
10136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org               UErrorCode*  status );
10146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
10166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set a UCalendar's current date.
10176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The date is represented as a series of 32-bit integers.
10186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to set.
10196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param year The desired year.
10206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY,
10216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER
10226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param date The desired day of the month.
10236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
10246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_getMillis
10256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setMillis
10266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setDateTime
10276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
10286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
10296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
10306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setDate(UCalendar*   cal,
10316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t      year,
10326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t      month,
10336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             int32_t      date,
10346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org             UErrorCode*  status);
10356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
10376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set a UCalendar's current date.
10386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The date is represented as a series of 32-bit integers.
10396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to set.
10406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param year The desired year.
10416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param month The desired month; one of UCAL_JANUARY, UCAL_FEBRUARY, UCAL_MARCH, UCAL_APRIL, UCAL_MAY,
10426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_JUNE, UCAL_JULY, UCAL_AUGUST, UCAL_SEPTEMBER, UCAL_OCTOBER, UCAL_NOVEMBER, UCAL_DECEMBER, UCAL_UNDECIMBER
10436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param date The desired day of the month.
10446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param hour The desired hour of day.
10456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param minute The desired minute.
10466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param second The desirec second.
10476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
10486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_getMillis
10496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setMillis
10506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_setDate
10516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
10526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
10536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
10546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_setDateTime(UCalendar*   cal,
10556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t      year,
10566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t      month,
10576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t      date,
10586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t      hour,
10596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t      minute,
10606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 int32_t      second,
10616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                 UErrorCode*  status);
10626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
10646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Returns TRUE if two UCalendars are equivalent.  Equivalent
10656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCalendars will behave identically, but they may be set to
10666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * different times.
10676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal1 The first of the UCalendars to compare.
10686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal2 The second of the UCalendars to compare.
10696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return TRUE if cal1 and cal2 are equivalent, FALSE otherwise.
10706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
10716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
10726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UBool U_EXPORT2
10736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_equivalentTo(const UCalendar*  cal1,
10746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                  const UCalendar*  cal2);
10756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
10766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
10776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Add a specified signed amount to a particular field in a UCalendar.
10786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This can modify more significant fields in the calendar.
10796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Adding a positive value always means moving forward in time, so for the Gregorian calendar,
10806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * starting with 100 BC and adding +1 to year results in 99 BC (even though this actually reduces
10816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * the numeric value of the field itself).
10826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to which to add.
10836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
10846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
10856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
10866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
10876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param amount The signed amount to add to field. If the amount causes the value
10886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * to exceed to maximum or minimum values for that field, other fields are modified
10896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * to preserve the magnitude of the change.
10906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
10916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_roll
10926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
10936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
10946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
10956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_add(UCalendar*           cal,
10966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         UCalendarDateFields  field,
10976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t              amount,
10986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         UErrorCode*          status);
10996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
11016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Add a specified signed amount to a particular field in a UCalendar.
11026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * This will not modify more significant fields in the calendar.
11036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Rolling by a positive value always means moving forward in time (unless the limit of the
11046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * field is reached, in which case it may pin or wrap), so for Gregorian calendar,
11056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * starting with 100 BC and rolling the year by +1 results in 99 BC.
11066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * When eras have a definite beginning and end (as in the Chinese calendar, or as in most eras in the
11076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Japanese calendar) then rolling the year past either limit of the era will cause the year to wrap around.
11086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * When eras only have a limit at one end, then attempting to roll the year past that limit will result in
11096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * pinning the year at that limit. Note that for most calendars in which era 0 years move forward in time
11106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * (such as Buddhist, Hebrew, or Islamic), it is possible for add or roll to result in negative years for
11116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * era 0 (that is the only way to represent years before the calendar epoch).
11126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to which to add.
11136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The field to which to add the signed value; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
11146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
11156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
11166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
11176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param amount The signed amount to add to field. If the amount causes the value
11186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * to exceed to maximum or minimum values for that field, the field is pinned to a permissible
11196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * value.
11206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
11216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_add
11226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
11236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
11246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
11256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_roll(UCalendar*           cal,
11266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          UCalendarDateFields  field,
11276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          int32_t              amount,
11286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org          UErrorCode*          status);
11296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
11316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get the current value of a field from a UCalendar.
11326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * All fields are represented as 32-bit integers.
11336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
11346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
11356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
11366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
11376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
11386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
11396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The value of the desired field.
11406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_set
11416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_isSet
11426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clearField
11436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clear
11446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
11456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
11466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
11476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_get(const UCalendar*     cal,
11486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         UCalendarDateFields  field,
11496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         UErrorCode*          status );
11506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
11526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Set the value of a field in a UCalendar.
11536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * All fields are represented as 32-bit integers.
11546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to set.
11556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The field to set; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
11566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
11576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
11586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
11596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param value The desired value of field.
11606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_get
11616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_isSet
11626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clearField
11636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clear
11646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
11656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
11666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
11676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_set(UCalendar*           cal,
11686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         UCalendarDateFields  field,
11696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org         int32_t              value);
11706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
11726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Determine if a field in a UCalendar is set.
11736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * All fields are represented as 32-bit integers.
11746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
11756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
11766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
11776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
11786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
11796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return TRUE if field is set, FALSE otherwise.
11806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_get
11816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_set
11826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clearField
11836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clear
11846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
11856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
11866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UBool U_EXPORT2
11876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_isSet(const UCalendar*     cal,
11886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org           UCalendarDateFields  field);
11896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
11906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
11916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Clear a field in a UCalendar.
11926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * All fields are represented as 32-bit integers.
11936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar containing the field to clear.
11946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The field to clear; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
11956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
11966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
11976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
11986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_get
11996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_set
12006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_isSet
12016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clear
12026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
12036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
12046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
12056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_clearField(UCalendar*           cal,
12066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                UCalendarDateFields  field);
12076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
12096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Clear all fields in a UCalendar.
12106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * All fields are represented as 32-bit integers.
12116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param calendar The UCalendar to clear.
12126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_get
12136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_set
12146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_isSet
12156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see ucal_clearField
12166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
12176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
12186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE void U_EXPORT2
12196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_clear(UCalendar* calendar);
12206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
12226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Possible limit values for a UCalendar
12236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
12246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
12256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarLimitType {
12266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Minimum value */
12276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MINIMUM,
12286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Maximum value */
12296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_MAXIMUM,
12306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Greatest minimum value */
12316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_GREATEST_MINIMUM,
12326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Leaest maximum value */
12336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_LEAST_MAXIMUM,
12346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Actual minimum value */
12356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_ACTUAL_MINIMUM,
12366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /** Actual maximum value */
12376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_ACTUAL_MAXIMUM
12386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
12396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 2.0 */
12416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarLimitType UCalendarLimitType;
12426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
12446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Determine a limit for a field in a UCalendar.
12456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A limit is a maximum or minimum value for a field.
12466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
12476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The desired field; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
12486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
12496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
12506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
12516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param type The desired critical point; one of UCAL_MINIMUM, UCAL_MAXIMUM, UCAL_GREATEST_MINIMUM,
12526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_LEAST_MAXIMUM, UCAL_ACTUAL_MINIMUM, UCAL_ACTUAL_MAXIMUM
12536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors.
12546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The requested value.
12556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 2.0
12566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
12576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
12586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getLimit(const UCalendar*     cal,
12596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              UCalendarDateFields  field,
12606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              UCalendarLimitType   type,
12616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org              UErrorCode*          status);
12626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Get the locale for this calendar object. You can choose between valid and actual locale.
12646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *  @param cal The calendar object
12656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *  @param type type of the locale we're looking for (valid or actual)
12666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *  @param status error code for the operation
12676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *  @return the locale name
12686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *  @stable ICU 2.8
12696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
12706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE const char * U_EXPORT2
12716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getLocaleByType(const UCalendar *cal, ULocDataLocaleType type, UErrorCode* status);
12726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
12746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Returns the timezone data version currently used by ICU.
12756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status error code for the operation
12766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return the version string, such as "2007f"
12776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 3.8
12786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
12796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE const char * U_EXPORT2
12806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getTZDataVersion(UErrorCode* status);
12816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
12826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
12836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Returns the canonical system timezone ID or the normalized
12846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * custom time zone ID for the given time zone ID.
12856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param id        The input timezone ID to be canonicalized.
12866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param len       The length of id, or -1 if null-terminated.
12876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param result    The buffer receives the canonical system timezone ID
12886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  or the custom timezone ID in normalized format.
12896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param resultCapacity    The capacity of the result buffer.
12906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param isSystemID        Receives if the given ID is a known system
12916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      timezone ID.
12926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status    Recevies the status.  When the given timezone ID
12936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  is neither a known system time zone ID nor a
12946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  valid custom timezone ID, U_ILLEGAL_ARGUMENT_ERROR
12956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  is set.
12966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return          The result string length, not including the terminating
12976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                  null.
12986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.0
12996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
13006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
13016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getCanonicalTimeZoneID(const UChar* id, int32_t len,
13026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            UChar* result, int32_t resultCapacity, UBool *isSystemID, UErrorCode* status);
13036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
13046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Get the resource keyword value string designating the calendar type for the UCalendar.
13056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
13066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status The error code for the operation.
13076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The resource keyword value string.
13086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.2
13096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
13106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE const char * U_EXPORT2
13116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getType(const UCalendar *cal, UErrorCode* status);
13126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
13146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Given a key and a locale, returns an array of string values in a preferred
13156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * order that would make a difference. These are all and only those values where
13166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * the open (creation) of the service with the locale formed from the input locale
13176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * plus input keyword and that value has different behavior than creation with the
13186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * input locale alone.
13196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param key           one of the keys supported by this service.  For now, only
13206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                      "calendar" is supported.
13216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param locale        the locale
13226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param commonlyUsed  if set to true it will return only commonly used values
13236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                      with the given locale in preferred order.  Otherwise,
13246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                      it will return all the available values for the locale.
13256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status error status
13266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return a string enumeration over keyword values for the given key and the locale.
13276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.2
13286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
13296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UEnumeration* U_EXPORT2
13306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getKeywordValuesForLocale(const char* key,
13316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                               const char* locale,
13326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                               UBool commonlyUsed,
13336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                               UErrorCode* status);
13346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** Weekday types, as returned by ucal_getDayOfWeekType().
13376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.4
13386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
13396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UCalendarWeekdayType {
13406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Designates a full weekday (no part of the day is included in the weekend).
13426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
13436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEEKDAY,
13456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Designates a full weekend day (the entire day is included in the weekend).
13476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
13486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEEKEND,
13506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Designates a day that starts as a weekday and transitions to the weekend.
13526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Call ucal_getWeekendTransition() to get the time of transition.
13536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
13546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEEKEND_ONSET,
13566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  /**
13576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Designates a day that starts as the weekend and transitions to a weekday.
13586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * Call ucal_getWeekendTransition() to get the time of transition.
13596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   * @stable ICU 4.4
13606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org   */
13616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org  UCAL_WEEKEND_CEASE
13626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
13636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/** @stable ICU 4.4 */
13656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UCalendarWeekdayType UCalendarWeekdayType;
13666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
13686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Returns whether the given day of the week is a weekday, a weekend day,
13696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * or a day that transitions from one to the other, for the locale and
13706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * calendar system associated with this UCalendar (the locale's region is
13716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * often the most determinant factor). If a transition occurs at midnight,
13726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * then the days before and after the transition will have the
13736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * type UCAL_WEEKDAY or UCAL_WEEKEND. If a transition occurs at a time
13746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * other than midnight, then the day of the transition will have
13756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * the type UCAL_WEEKEND_ONSET or UCAL_WEEKEND_CEASE. In this case, the
13766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * function ucal_getWeekendTransition() will return the point of
13776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * transition.
13786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
13796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param dayOfWeek The day of the week whose type is desired (UCAL_SUNDAY..UCAL_SATURDAY).
13806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status The error code for the operation.
13816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The UCalendarWeekdayType for the day of the week.
13826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.4
13836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
13846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UCalendarWeekdayType U_EXPORT2
13856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getDayOfWeekType(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode* status);
13866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
13876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
13886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Returns the time during the day at which the weekend begins or ends in
13896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * this calendar system.  If ucal_getDayOfWeekType() returns UCAL_WEEKEND_ONSET
13906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * for the specified dayOfWeek, return the time at which the weekend begins.
13916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * If ucal_getDayOfWeekType() returns UCAL_WEEKEND_CEASE for the specified dayOfWeek,
13926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * return the time at which the weekend ends. If ucal_getDayOfWeekType() returns
13936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * some other UCalendarWeekdayType for the specified dayOfWeek, is it an error condition
13946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * (U_ILLEGAL_ARGUMENT_ERROR).
13956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
13966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param dayOfWeek The day of the week for which the weekend transition time is
13976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * desired (UCAL_SUNDAY..UCAL_SATURDAY).
13986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status The error code for the operation.
13996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The milliseconds after midnight at which the weekend begins or ends.
14006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.4
14016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
14026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
14036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getWeekendTransition(const UCalendar *cal, UCalendarDaysOfWeek dayOfWeek, UErrorCode *status);
14046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
14066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Returns TRUE if the given UDate is in the weekend in
14076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * this calendar system.
14086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to query.
14096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param date The UDate in question.
14106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status The error code for the operation.
14116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return TRUE if the given UDate is in the weekend in
14126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * this calendar system, FALSE otherwise.
14136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.4
14146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
14156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE UBool U_EXPORT2
14166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_isWeekend(const UCalendar *cal, UDate date, UErrorCode *status);
14176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
14196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Return the difference between the target time and the time this calendar object is currently set to.
14206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * If the target time is after the current calendar setting, the the returned value will be positive.
14216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * The field parameter specifies the units of the return value. For example, if field is UCAL_MONTH
14226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * and ucal_getFieldDifference returns 3, then the target time is 3 to less than 4 months after the
14236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * current calendar setting.
14246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
14256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * As a side effect of this call, this calendar is advanced toward target by the given amount. That is,
14266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * calling this function has the side effect of calling ucal_add on this calendar with the specified
14276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * field and an amount equal to the return value from this function.
14286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
14296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * A typical way of using this function is to call it first with the largest field of interest, then
14306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * with progressively smaller fields.
14316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
14326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param cal The UCalendar to compare and update.
14336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param target The target date to compare to the current calendar setting.
14346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param field The field to compare; one of UCAL_ERA, UCAL_YEAR, UCAL_MONTH,
14356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_WEEK_OF_YEAR, UCAL_WEEK_OF_MONTH, UCAL_DATE, UCAL_DAY_OF_YEAR, UCAL_DAY_OF_WEEK,
14366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_DAY_OF_WEEK_IN_MONTH, UCAL_AM_PM, UCAL_HOUR, UCAL_HOUR_OF_DAY, UCAL_MINUTE, UCAL_SECOND,
14376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * UCAL_MILLISECOND, UCAL_ZONE_OFFSET, UCAL_DST_OFFSET.
14386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @param status A pointer to an UErrorCode to receive any errors
14396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @return The date difference for the specified field.
14406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 4.8
14416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
14426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_STABLE int32_t U_EXPORT2
14436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getFieldDifference(UCalendar* cal,
14446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                        UDate target,
14456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                        UCalendarDateFields field,
14466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                        UErrorCode* status);
14476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
14496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Time zone transition types for ucal_getTimeZoneTransitionDate
14506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @stable ICU 50
14516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
14526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgenum UTimeZoneTransitionType {
14536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
14546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Get the next transition after the current date,
14556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * i.e. excludes the current date
14566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 50
14576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
14586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_TZ_TRANSITION_NEXT,
14596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
14606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Get the next transition on or after the current date,
14616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * i.e. may include the current date
14626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 50
14636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
14646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_TZ_TRANSITION_NEXT_INCLUSIVE,
14656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
14666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Get the previous transition before the current date,
14676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * i.e. excludes the current date
14686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 50
14696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
14706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_TZ_TRANSITION_PREVIOUS,
14716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
14726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Get the previous transition on or before the current date,
14736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * i.e. may include the current date
14746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 50
14756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
14766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UCAL_TZ_TRANSITION_PREVIOUS_INCLUSIVE
14776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
14786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgtypedef enum UTimeZoneTransitionType UTimeZoneTransitionType; /**< @stable ICU 50 */
14806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
14816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
14826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Get the UDate for the next/previous time zone transition relative to
14836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* the calendar's current date, in the time zone to which the calendar
14846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* is currently set. If there is no known time zone transition of the
14856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* requested type relative to the calendar's date, the function returns
14866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* FALSE.
14876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param cal The UCalendar to query.
14886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param type The type of transition desired.
14896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param transition A pointer to a UDate to be set to the transition time.
14906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*         If the function returns FALSE, the value set is unspecified.
14916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param status A pointer to a UErrorCode to receive any errors.
14926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @return TRUE if a valid transition time is set in *transition, FALSE
14936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*         otherwise.
14946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @stable ICU 50
14956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*/
14966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_DRAFT UBool U_EXPORT2
14976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getTimeZoneTransitionDate(const UCalendar* cal, UTimeZoneTransitionType type,
14986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                               UDate* transition, UErrorCode* status);
14996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef U_HIDE_DRAFT_API
15016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
15026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Converts a system time zone ID to an equivalent Windows time zone ID. For example,
15036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Windows time zone ID "Pacific Standard Time" is returned for input "America/Los_Angeles".
15046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* <p>There are system time zones that cannot be mapped to Windows zones. When the input
15066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* system time zone ID is unknown or unmappable to a Windows time zone, then this
15076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* function returns 0 as the result length, but the operation itself remains successful
15086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* (no error status set on return).
15096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supplemental/zone_tzid.html">
15116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get the latest changes,
15126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* please read the ICU user guide section <a href="http://userguide.icu-project.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data">
15136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Updating the Time Zone Data</a>.
15146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param id            A system time zone ID.
15166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param len           The length of <code>id</code>, or -1 if null-terminated.
15176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param winid         A buffer to receive a Windows time zone ID.
15186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param winidCapacity The capacity of the result buffer <code>winid</code>.
15196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param status        Receives the status.
15206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @return              The result string length, not including the terminating null.
15216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @see ucal_getTimeZoneIDForWindowsID
15226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @draft ICU 52
15246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*/
15256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_DRAFT int32_t U_EXPORT2
15266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getWindowsTimeZoneID(const UChar* id, int32_t len,
15276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                            UChar* winid, int32_t winidCapacity, UErrorCode* status);
15286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
15306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Converts a Windows time zone ID to an equivalent system time zone ID
15316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* for a region. For example, system time zone ID "America/Los_Angeles" is returned
15326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* for input Windows ID "Pacific Standard Time" and region "US" (or <code>null</code>),
15336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* "America/Vancouver" is returned for the same Windows ID "Pacific Standard Time" and
15346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* region "CA".
15356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* <p>Not all Windows time zones can be mapped to system time zones. When the input
15376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Windows time zone ID is unknown or unmappable to a system time zone, then this
15386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* function returns 0 as the result length, but the operation itself remains successful
15396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* (no error status set on return).
15406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* <p>This implementation utilizes <a href="http://unicode.org/cldr/charts/supplemental/zone_tzid.html">
15426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Zone-Tzid mapping data</a>. The mapping data is updated time to time. To get the latest changes,
15436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* please read the ICU user guide section <a href="http://userguide.icu-project.org/datetime/timezone#TOC-Updating-the-Time-Zone-Data">
15446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* Updating the Time Zone Data</a>.
15456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param winid         A Windows time zone ID.
15476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param len           The length of <code>winid</code>, or -1 if null-terminated.
15486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param region        A null-terminated region code, or <code>NULL</code> if no regional preference.
15496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param id            A buffer to receive a system time zone ID.
15506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param idCapacity    The capacity of the result buffer <code>id</code>.
15516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @param status        Receives the status.
15526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @return              The result string length, not including the terminating null.
15536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @see ucal_getWindowsTimeZoneID
15546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*
15556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org* @draft ICU 52
15566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org*/
15576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_DRAFT int32_t U_EXPORT2
15586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgucal_getTimeZoneIDForWindowsID(const UChar* winid, int32_t len, const char* region,
15596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                UChar* id, int32_t idCapacity, UErrorCode* status);
15606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif  /* U_HIDE_DRAFT_API */
15626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif /* #if !UCONFIG_NO_FORMATTING */
15646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
15656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif
1566