16f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/*
26f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org ********************************************************************************
36f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Copyright (C) 1997-2013, International Business Machines                     *
46f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Corporation and others. All Rights Reserved.                                 *
56f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org ********************************************************************************
66f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
76f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * File SIMPLETZ.H
86f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
96f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Modification History:
106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   Date        Name        Description
126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   04/21/97    aliu        Overhauled header.
136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   08/10/98    stephen     JDK 1.2 sync
146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                           Added setStartRule() / setEndRule() overloads
156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                           Added hasSameRules()
166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   09/02/98    stephen     Added getOffset(monthLen)
176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                           Changed getOffset() to take UErrorCode
186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   07/09/99    stephen     Removed millisPerHour (unused, for HP compiler)
196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *   12/02/99    aliu        Added TimeMode and constructor and setStart/EndRule
206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *                           methods that take TimeMode. Added to docs.
216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org ********************************************************************************
226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#ifndef SIMPLETZ_H
256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#define SIMPLETZ_H
266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/utypes.h"
286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \file
316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * \brief C++ API: SimpleTimeZone is a concrete subclass of TimeZone.
326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#if !UCONFIG_NO_FORMATTING
356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#include "unicode/basictz.h"
376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_NAMESPACE_BEGIN
396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org// forward declaration
416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass InitialTimeZoneRule;
426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass TimeZoneTransition;
436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass AnnualTimeZoneRule;
446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org/**
466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>SimpleTimeZone</code> is a concrete subclass of <code>TimeZone</code>
476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * that represents a time zone for use with a Gregorian calendar. This
486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * class does not handle historical changes.
496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <P>
506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * When specifying daylight-savings-time begin and end dates, use a negative value for
516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * <code>dayOfWeekInMonth</code> to indicate that <code>SimpleTimeZone</code> should
526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * count from the end of the month backwards. For example, if Daylight Savings
536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * Time starts or ends at the last Sunday a month, use <code>dayOfWeekInMonth = -1</code>
546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * along with <code>dayOfWeek = UCAL_SUNDAY</code> to specify the rule.
556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org *
566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see      Calendar
576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see      GregorianCalendar
586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @see      TimeZone
596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org * @author   D. Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu
606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org */
616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgclass U_I18N_API SimpleTimeZone: public BasicTimeZone {
626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgpublic:
636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * TimeMode is used, together with a millisecond offset after
666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * midnight, to specify a rule transition time.  Most rules
676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * transition at a local wall time, that is, according to the
686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * current time in effect, either standard, or DST.  However, some
696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * rules transition at local standard time, and some at a specific
706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * UTC time.  Although it might seem that all times could be
716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * converted to wall time, thus eliminating the need for this
726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * parameter, this is not the case.
736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    enum TimeMode {
766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        WALL_TIME = 0,
776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        STANDARD_TIME,
786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        UTC_TIME
796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    };
806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Copy constructor
836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param source the object to be copied.
846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone(const SimpleTimeZone& source);
876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Default assignment operator
906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param right    the object to be copied.
916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone& operator=(const SimpleTimeZone& right);
946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Destructor
976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual ~SimpleTimeZone();
1006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
1026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Returns true if the two TimeZone objects are equal; that is, they have
1036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the same ID, raw GMT offset, and DST rules.
1046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
1056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param that  The SimpleTimeZone object to be compared with.
1066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return      True if the given time zone is equal to this time zone; false
1076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *              otherwise.
1086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
1096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
1106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual UBool operator==(const TimeZone& that) const;
1116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
1136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Constructs a SimpleTimeZone with the given raw GMT offset and time zone ID,
1146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and which doesn't observe daylight savings time.  Normally you should use
1156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * TimeZone::createInstance() to create a TimeZone instead of creating a
1166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone directly with this constructor.
1176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
1186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param rawOffsetGMT  The given base time zone offset to GMT.
1196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param ID         The timezone ID which is obtained from
1206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                   TimeZone.getAvailableIDs.
1216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
1226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
1236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID);
1246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
1256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
1266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Construct a SimpleTimeZone with the given raw GMT offset, time zone ID,
1276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and times to start and end daylight savings time. To create a TimeZone that
1286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * doesn't observe daylight savings time, don't use this constructor; use
1296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone(rawOffset, ID) instead. Normally, you should use
1306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * TimeZone.createInstance() to create a TimeZone instead of creating a
1316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone directly with this constructor.
1326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <P>
1336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Various types of daylight-savings time rules can be specfied by using different
1346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * values for startDay and startDayOfWeek and endDay and endDayOfWeek.  For a
1356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * complete explanation of how these parameters work, see the documentation for
1366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * setStartRule().
1376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
1386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param rawOffsetGMT      The new SimpleTimeZone's raw GMT offset
1396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param ID                The new SimpleTimeZone's time zone ID.
1406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartMonth The daylight savings starting month. Month is
1416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          0-based. eg, 0 for January.
1426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartDayOfWeekInMonth   The daylight savings starting
1436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          day-of-week-in-month. See setStartRule() for a
1446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          complete explanation.
1456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartDayOfWeek The daylight savings starting day-of-week.
1466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
1476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartTime  The daylight savings starting time, expressed as the
1486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          number of milliseconds after midnight.
1496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndMonth   The daylight savings ending month. Month is
1506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          0-based. eg, 0 for January.
1516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndDayOfWeekInMonth     The daylight savings ending day-of-week-in-month.
1526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
1536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndDayOfWeek The daylight savings ending day-of-week.
1546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
1556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndTime    The daylight savings ending time, expressed as the
1566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          number of milliseconds after midnight.
1576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status            An UErrorCode to receive the status.
1586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
1596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
1606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID,
1616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth,
1626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsStartDayOfWeek, int32_t savingsStartTime,
1636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth,
1646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsEndDayOfWeek, int32_t savingsEndTime,
1656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        UErrorCode& status);
1666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
1676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Construct a SimpleTimeZone with the given raw GMT offset, time zone ID,
1686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and times to start and end daylight savings time. To create a TimeZone that
1696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * doesn't observe daylight savings time, don't use this constructor; use
1706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone(rawOffset, ID) instead. Normally, you should use
1716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * TimeZone.createInstance() to create a TimeZone instead of creating a
1726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone directly with this constructor.
1736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <P>
1746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Various types of daylight-savings time rules can be specfied by using different
1756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * values for startDay and startDayOfWeek and endDay and endDayOfWeek.  For a
1766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * complete explanation of how these parameters work, see the documentation for
1776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * setStartRule().
1786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
1796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param rawOffsetGMT      The new SimpleTimeZone's raw GMT offset
1806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param ID                The new SimpleTimeZone's time zone ID.
1816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartMonth The daylight savings starting month. Month is
1826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          0-based. eg, 0 for January.
1836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartDayOfWeekInMonth   The daylight savings starting
1846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          day-of-week-in-month. See setStartRule() for a
1856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          complete explanation.
1866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartDayOfWeek The daylight savings starting day-of-week.
1876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
1886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartTime  The daylight savings starting time, expressed as the
1896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          number of milliseconds after midnight.
1906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndMonth   The daylight savings ending month. Month is
1916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          0-based. eg, 0 for January.
1926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndDayOfWeekInMonth     The daylight savings ending day-of-week-in-month.
1936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
1946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndDayOfWeek The daylight savings ending day-of-week.
1956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
1966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndTime    The daylight savings ending time, expressed as the
1976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          number of milliseconds after midnight.
1986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsDST        The number of milliseconds added to standard time
1996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          to get DST time. Default is one hour.
2006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status            An UErrorCode to receive the status.
2016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
2026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
2036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID,
2046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth,
2056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsStartDayOfWeek, int32_t savingsStartTime,
2066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth,
2076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsEndDayOfWeek, int32_t savingsEndTime,
2086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int32_t savingsDST, UErrorCode& status);
2096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
2116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Construct a SimpleTimeZone with the given raw GMT offset, time zone ID,
2126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and times to start and end daylight savings time. To create a TimeZone that
2136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * doesn't observe daylight savings time, don't use this constructor; use
2146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone(rawOffset, ID) instead. Normally, you should use
2156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * TimeZone.createInstance() to create a TimeZone instead of creating a
2166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * SimpleTimeZone directly with this constructor.
2176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <P>
2186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Various types of daylight-savings time rules can be specfied by using different
2196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * values for startDay and startDayOfWeek and endDay and endDayOfWeek.  For a
2206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * complete explanation of how these parameters work, see the documentation for
2216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * setStartRule().
2226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
2236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param rawOffsetGMT      The new SimpleTimeZone's raw GMT offset
2246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param ID                The new SimpleTimeZone's time zone ID.
2256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartMonth The daylight savings starting month. Month is
2266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          0-based. eg, 0 for January.
2276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartDayOfWeekInMonth   The daylight savings starting
2286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          day-of-week-in-month. See setStartRule() for a
2296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          complete explanation.
2306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartDayOfWeek The daylight savings starting day-of-week.
2316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
2326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartTime  The daylight savings starting time, expressed as the
2336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          number of milliseconds after midnight.
2346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsStartTimeMode Whether the start time is local wall time, local
2356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          standard time, or UTC time. Default is local wall time.
2366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndMonth   The daylight savings ending month. Month is
2376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          0-based. eg, 0 for January.
2386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndDayOfWeekInMonth     The daylight savings ending day-of-week-in-month.
2396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
2406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndDayOfWeek The daylight savings ending day-of-week.
2416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          See setStartRule() for a complete explanation.
2426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndTime    The daylight savings ending time, expressed as the
2436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          number of milliseconds after midnight.
2446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsEndTimeMode Whether the end time is local wall time, local
2456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          standard time, or UTC time. Default is local wall time.
2466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param savingsDST        The number of milliseconds added to standard time
2476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                          to get DST time. Default is one hour.
2486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status            An UErrorCode to receive the status.
2496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
2506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
2516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID,
2526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth,
2536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsStartDayOfWeek, int32_t savingsStartTime,
2546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        TimeMode savingsStartTimeMode,
2556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth,
2566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int8_t savingsEndDayOfWeek, int32_t savingsEndTime, TimeMode savingsEndTimeMode,
2576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int32_t savingsDST, UErrorCode& status);
2586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
2606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the daylight savings starting year, that is, the year this time zone began
2616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * observing its specified daylight savings time rules.  The time zone is considered
2626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * not to observe daylight savings time prior to that year; SimpleTimeZone doesn't
2636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * support historical daylight-savings-time rules.
2646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param year the daylight savings starting year.
2656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
2666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
2676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartYear(int32_t year);
2686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
2696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
2706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the daylight savings starting rule. For example, in the U.S., Daylight Savings
2716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Time starts at the second Sunday in March, at 2 AM in standard time.
2726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Therefore, you can set the start rule by calling:
2736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * setStartRule(UCAL_MARCH, 2, UCAL_SUNDAY, 2*60*60*1000);
2746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * The dayOfWeekInMonth and dayOfWeek parameters together specify how to calculate
2756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the exact starting date.  Their exact meaning depend on their respective signs,
2766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * allowing various types of rules to be constructed, as follows:
2776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <ul>
2786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If both dayOfWeekInMonth and dayOfWeek are positive, they specify the
2796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       day of week in the month (e.g., (2, WEDNESDAY) is the second Wednesday
2806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       of the month).</li>
2816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is positive and dayOfWeekInMonth is negative, they specify
2826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       the day of week in the month counting backward from the end of the month.
2836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (-1, MONDAY) is the last Monday in the month)</li>
2846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is zero and dayOfWeekInMonth is positive, dayOfWeekInMonth
2856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       specifies the day of the month, regardless of what day of the week it is.
2866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (10, 0) is the tenth day of the month)</li>
2876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is zero and dayOfWeekInMonth is negative, dayOfWeekInMonth
2886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       specifies the day of the month counting backward from the end of the
2896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       month, regardless of what day of the week it is (e.g., (-2, 0) is the
2906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       next-to-last day of the month).</li>
2916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is negative and dayOfWeekInMonth is positive, they specify the
2926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       first specified day of the week on or after the specfied day of the month.
2936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (15, -SUNDAY) is the first Sunday after the 15th of the month
2946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       [or the 15th itself if the 15th is a Sunday].)</li>
2956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek and DayOfWeekInMonth are both negative, they specify the
2966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       last specified day of the week on or before the specified day of the month.
2976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (-20, -TUESDAY) is the last Tuesday before the 20th of the month
2986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       [or the 20th itself if the 20th is a Tuesday].)</li>
2996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * </ul>
3006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month the daylight savings starting month. Month is 0-based.
3016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * eg, 0 for January.
3026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeekInMonth the daylight savings starting
3036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * day-of-week-in-month. Please see the member description for an example.
3046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek the daylight savings starting day-of-week. Please see
3056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the member description for an example.
3066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time the daylight savings starting time. Please see the member
3076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * description for an example.
3086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
3096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
3106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
3116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek,
3126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                      int32_t time, UErrorCode& status);
3136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
3146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the daylight savings starting rule. For example, in the U.S., Daylight Savings
3156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Time starts at the second Sunday in March, at 2 AM in standard time.
3166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Therefore, you can set the start rule by calling:
3176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * setStartRule(UCAL_MARCH, 2, UCAL_SUNDAY, 2*60*60*1000);
3186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * The dayOfWeekInMonth and dayOfWeek parameters together specify how to calculate
3196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the exact starting date.  Their exact meaning depend on their respective signs,
3206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * allowing various types of rules to be constructed, as follows:
3216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <ul>
3226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If both dayOfWeekInMonth and dayOfWeek are positive, they specify the
3236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       day of week in the month (e.g., (2, WEDNESDAY) is the second Wednesday
3246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       of the month).</li>
3256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is positive and dayOfWeekInMonth is negative, they specify
3266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       the day of week in the month counting backward from the end of the month.
3276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (-1, MONDAY) is the last Monday in the month)</li>
3286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is zero and dayOfWeekInMonth is positive, dayOfWeekInMonth
3296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       specifies the day of the month, regardless of what day of the week it is.
3306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (10, 0) is the tenth day of the month)</li>
3316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is zero and dayOfWeekInMonth is negative, dayOfWeekInMonth
3326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       specifies the day of the month counting backward from the end of the
3336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       month, regardless of what day of the week it is (e.g., (-2, 0) is the
3346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       next-to-last day of the month).</li>
3356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek is negative and dayOfWeekInMonth is positive, they specify the
3366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       first specified day of the week on or after the specfied day of the month.
3376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (15, -SUNDAY) is the first Sunday after the 15th of the month
3386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       [or the 15th itself if the 15th is a Sunday].)</li>
3396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *   <li>If dayOfWeek and DayOfWeekInMonth are both negative, they specify the
3406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       last specified day of the week on or before the specified day of the month.
3416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       (e.g., (-20, -TUESDAY) is the last Tuesday before the 20th of the month
3426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *       [or the 20th itself if the 20th is a Tuesday].)</li>
3436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * </ul>
3446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month the daylight savings starting month. Month is 0-based.
3456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * eg, 0 for January.
3466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeekInMonth the daylight savings starting
3476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * day-of-week-in-month. Please see the member description for an example.
3486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek the daylight savings starting day-of-week. Please see
3496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the member description for an example.
3506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time the daylight savings starting time. Please see the member
3516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * description for an example.
3526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param mode whether the time is local wall time, local standard time,
3536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * or UTC time. Default is local wall time.
3546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
3556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
3566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
3576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek,
3586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                      int32_t time, TimeMode mode, UErrorCode& status);
3596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
3616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST start rule to a fixed date within a month.
3626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
3636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
3646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    The date in that month (1-based).
3656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
3666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST takes effect in local wall time, which is
3676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      standard time in this case.
3686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
3696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
3706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
3716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time,
3726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                      UErrorCode& status);
3736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
3746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST start rule to a fixed date within a month.
3756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
3766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
3776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    The date in that month (1-based).
3786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
3796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST takes effect in local wall time, which is
3806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      standard time in this case.
3816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param mode whether the time is local wall time, local standard time,
3826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * or UTC time. Default is local wall time.
3836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
3846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
3856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
3866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartRule(int32_t month, int32_t dayOfMonth, int32_t time,
3876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                      TimeMode mode, UErrorCode& status);
3886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
3896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
3906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST start rule to a weekday before or after a give date within
3916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * a month, e.g., the first Monday on or after the 8th.
3926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
3936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
3946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    A date within that month (1-based).
3956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek     The day of the week on which this rule occurs.
3966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
3976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST takes effect in local wall time, which is
3986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      standard time in this case.
3996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param after         If true, this rule selects the first dayOfWeek on
4006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      or after dayOfMonth.  If false, this rule selects
4016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      the last dayOfWeek on or before dayOfMonth.
4026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
4036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
4046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
4056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
4066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                      int32_t time, UBool after, UErrorCode& status);
4076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
4086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST start rule to a weekday before or after a give date within
4096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * a month, e.g., the first Monday on or after the 8th.
4106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
4116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
4126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    A date within that month (1-based).
4136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek     The day of the week on which this rule occurs.
4146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
4156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST takes effect in local wall time, which is
4166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      standard time in this case.
4176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param mode whether the time is local wall time, local standard time,
4186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * or UTC time. Default is local wall time.
4196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param after         If true, this rule selects the first dayOfWeek on
4206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      or after dayOfMonth.  If false, this rule selects
4216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      the last dayOfWeek on or before dayOfMonth.
4226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
4236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
4246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
4256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setStartRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
4266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                      int32_t time, TimeMode mode, UBool after, UErrorCode& status);
4276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
4296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the daylight savings ending rule. For example, if Daylight
4306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Savings Time ends at the last (-1) Sunday in October, at 2 AM in standard time.
4316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Therefore, you can set the end rule by calling:
4326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <pre>
4336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *    setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2*60*60*1000);
4346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * </pre>
4356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Various other types of rules can be specified by manipulating the dayOfWeek
4366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and dayOfWeekInMonth parameters.  For complete details, see the documentation
4376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * for setStartRule().
4386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
4396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month the daylight savings ending month. Month is 0-based.
4406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * eg, 0 for January.
4416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeekInMonth the daylight savings ending
4426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * day-of-week-in-month. See setStartRule() for a complete explanation.
4436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek the daylight savings ending day-of-week. See setStartRule()
4446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * for a complete explanation.
4456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time the daylight savings ending time. Please see the member
4466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * description for an example.
4476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
4486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
4496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
4506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setEndRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek,
4516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    int32_t time, UErrorCode& status);
4526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
4546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the daylight savings ending rule. For example, if Daylight
4556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Savings Time ends at the last (-1) Sunday in October, at 2 AM in standard time.
4566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Therefore, you can set the end rule by calling:
4576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <pre>
4586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *    setEndRule(UCAL_OCTOBER, -1, UCAL_SUNDAY, 2*60*60*1000);
4596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * </pre>
4606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Various other types of rules can be specified by manipulating the dayOfWeek
4616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and dayOfWeekInMonth parameters.  For complete details, see the documentation
4626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * for setStartRule().
4636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
4646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month the daylight savings ending month. Month is 0-based.
4656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * eg, 0 for January.
4666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeekInMonth the daylight savings ending
4676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * day-of-week-in-month. See setStartRule() for a complete explanation.
4686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek the daylight savings ending day-of-week. See setStartRule()
4696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * for a complete explanation.
4706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time the daylight savings ending time. Please see the member
4716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * description for an example.
4726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param mode whether the time is local wall time, local standard time,
4736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * or UTC time. Default is local wall time.
4746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
4756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
4766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
4776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setEndRule(int32_t month, int32_t dayOfWeekInMonth, int32_t dayOfWeek,
4786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    int32_t time, TimeMode mode, UErrorCode& status);
4796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
4816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST end rule to a fixed date within a month.
4826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
4836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
4846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    The date in that month (1-based).
4856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
4866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST ends in local wall time, which is daylight
4876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      time in this case.
4886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
4896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
4906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
4916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setEndRule(int32_t month, int32_t dayOfMonth, int32_t time, UErrorCode& status);
4926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
4936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
4946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST end rule to a fixed date within a month.
4956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
4966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
4976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    The date in that month (1-based).
4986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
4996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST ends in local wall time, which is daylight
5006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      time in this case.
5016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param mode whether the time is local wall time, local standard time,
5026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * or UTC time. Default is local wall time.
5036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
5046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
5056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setEndRule(int32_t month, int32_t dayOfMonth, int32_t time,
5076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    TimeMode mode, UErrorCode& status);
5086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST end rule to a weekday before or after a give date within
5116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * a month, e.g., the first Monday on or after the 8th.
5126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
5136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
5146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    A date within that month (1-based).
5156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek     The day of the week on which this rule occurs.
5166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
5176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST ends in local wall time, which is daylight
5186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      time in this case.
5196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param after         If true, this rule selects the first dayOfWeek on
5206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      or after dayOfMonth.  If false, this rule selects
5216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      the last dayOfWeek on or before dayOfMonth.
5226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
5236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
5246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
5266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    int32_t time, UBool after, UErrorCode& status);
5276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the DST end rule to a weekday before or after a give date within
5306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * a month, e.g., the first Monday on or after the 8th.
5316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
5326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month         The month in which this rule occurs (0-based).
5336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfMonth    A date within that month (1-based).
5346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek     The day of the week on which this rule occurs.
5356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param time          The time of that day (number of millis after midnight)
5366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      when DST ends in local wall time, which is daylight
5376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      time in this case.
5386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param mode whether the time is local wall time, local standard time,
5396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * or UTC time. Default is local wall time.
5406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param after         If true, this rule selects the first dayOfWeek on
5416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      or after dayOfMonth.  If false, this rule selects
5426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      the last dayOfWeek on or before dayOfMonth.
5436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status An UErrorCode
5446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
5456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
5476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                    int32_t time, TimeMode mode, UBool after, UErrorCode& status);
5486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add
5516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * to GMT to get local time in this time zone, taking daylight savings time into
5526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * account) as of a particular reference date.  The reference date is used to determine
5536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * whether daylight savings time is in effect and needs to be figured into the offset
5546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * that is returned (in other words, what is the adjusted GMT offset in this time zone
5556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * at this particular date and time?).  For the time zones produced by createTimeZone(),
5566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the reference data is specified according to the Gregorian calendar, and the date
5576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and time fields are in GMT, NOT local time.
5586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
5596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param era        The reference date's era
5606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param year       The reference date's year
5616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month      The reference date's month (0-based; 0 is January)
5626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param day        The reference date's day-in-month (1-based)
5636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek  The reference date's day-of-week (1-based; 1 is Sunday)
5646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param millis     The reference date's milliseconds in day, UTT (NOT local time).
5656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status     An UErrorCode to receive the status.
5666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return           The offset in milliseconds to add to GMT to get local time.
5676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
5686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
5706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                              uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const;
5716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
5726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Gets the time zone offset, for current date, modified in case of
5746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * daylight savings. This is the offset to add *to* UTC to get local time.
5756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param era the era of the given date.
5766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param year the year in the given date.
5776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month the month in the given date.
5786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Month is 0-based. e.g., 0 for January.
5796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param day the day-in-month of the given date.
5806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek the day-of-week of the given date.
5816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param milliseconds the millis in day in <em>standard</em> local time.
5826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param monthLength the length of the given month in days.
5836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status     An UErrorCode to receive the status.
5846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return the offset to add *to* GMT to get local time.
5856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
5866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
5876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
5886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                           uint8_t dayOfWeek, int32_t milliseconds,
5896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                           int32_t monthLength, UErrorCode& status) const;
5906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
5916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Gets the time zone offset, for current date, modified in case of
5926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * daylight savings. This is the offset to add *to* UTC to get local time.
5936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param era the era of the given date.
5946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param year the year in the given date.
5956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param month the month in the given date.
5966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Month is 0-based. e.g., 0 for January.
5976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param day the day-in-month of the given date.
5986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dayOfWeek the day-of-week of the given date.
5996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param milliseconds the millis in day in <em>standard</em> local time.
6006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param monthLength the length of the given month in days.
6016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param prevMonthLength length of the previous month in days.
6026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status     An UErrorCode to receive the status.
6036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return the offset to add *to* GMT to get local time.
6046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
6076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                              uint8_t dayOfWeek, int32_t milliseconds,
6086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                              int32_t monthLength, int32_t prevMonthLength,
6096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                              UErrorCode& status) const;
6106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Redeclared TimeZone method.  This implementation simply calls
6136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the base class method, which otherwise would be hidden.
6146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.8
6156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual void getOffset(UDate date, UBool local, int32_t& rawOffset,
6176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                           int32_t& dstOffset, UErrorCode& ec) const;
6186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Get time zone offsets from local wall time.
6216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @internal
6226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual void getOffsetFromLocal(UDate date, int32_t nonExistingTimeOpt, int32_t duplicatedTimeOpt,
6246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const;
6256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
6286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * to GMT to get local time, before taking daylight savings time into account).
6296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
6306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return   The TimeZone's raw GMT offset.
6316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual int32_t getRawOffset(void) const;
6346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
6376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * to GMT to get local time, before taking daylight savings time into account).
6386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
6396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param offsetMillis  The new raw GMT offset for this time zone.
6406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual void setRawOffset(int32_t offsetMillis);
6436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Sets the amount of time in ms that the clock is advanced during DST.
6466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param millisSavedDuringDST the number of milliseconds the time is
6476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * advanced with respect to standard time when the daylight savings rules
6486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * are in effect. A positive number, typically one hour (3600000).
6496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status  An UErrorCode to receive the status.
6506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void setDSTSavings(int32_t millisSavedDuringDST, UErrorCode& status);
6536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Returns the amount of time in ms that the clock is advanced during DST.
6566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return the number of milliseconds the time is
6576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * advanced with respect to standard time when the daylight savings rules
6586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * are in effect. A positive number, typically one hour (3600000).
6596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual int32_t getDSTSavings(void) const;
6626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Queries if this TimeZone uses Daylight Savings Time.
6656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
6666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return   True if this TimeZone uses Daylight Savings Time; false otherwise.
6676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual UBool useDaylightTime(void) const;
6706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Returns true if the given date is within the period when daylight savings time
6736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * is in effect; false otherwise.  If the TimeZone doesn't observe daylight savings
6746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * time, this functions always returns false.
6756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * This method is wasteful since it creates a new GregorianCalendar and
6766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * deletes it each time it is called. This is a deprecated method
6776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * and provided only for Java compatibility.
6786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
6796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param date The date to test.
6806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status  An UErrorCode to receive the status.
6816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return true if the given date is in Daylight Savings Time;
6826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * false otherwise.
6836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead.
6846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual UBool inDaylightTime(UDate date, UErrorCode& status) const;
6866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Return true if this zone has the same rules and offset as another zone.
6896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param other the TimeZone object to be compared with
6906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return true if the given zone has the same rules and offset as this one
6916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
6926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
6936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UBool hasSameRules(const TimeZone& other) const;
6946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
6956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
6966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Clones TimeZone objects polymorphically. Clients are responsible for deleting
6976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the TimeZone object cloned.
6986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
6996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return   A new copy of this TimeZone object.
7006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
7016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual TimeZone* clone(void) const;
7036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Gets the first time zone transition after the base time.
7066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param base      The base time.
7076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param inclusive Whether the base time is inclusive or not.
7086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param result    Receives the first transition after the base time.
7096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return  TRUE if the transition is found.
7106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 3.8
7116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const;
7136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Gets the most recent time zone transition before the base time.
7166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param base      The base time.
7176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param inclusive Whether the base time is inclusive or not.
7186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param result    Receives the most recent transition before the base time.
7196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return  TRUE if the transition is found.
7206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 3.8
7216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const;
7236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Returns the number of <code>TimeZoneRule</code>s which represents time transitions,
7266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except
7276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <code>InitialTimeZoneRule</code>.  The return value range is 0 or any positive value.
7286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status    Receives error status code.
7296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return The number of <code>TimeZoneRule</code>s representing time transitions.
7306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 3.8
7316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual int32_t countTransitionRules(UErrorCode& status) const;
7336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZoneRule</code>
7366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * which represent time transitions for this time zone.  On successful return,
7376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the argument initial points to non-NULL <code>InitialTimeZoneRule</code> and
7386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</code>
7396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * instances up to the size specified by trscount.  The results are referencing the
7406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * rule instance held by this time zone instance.  Therefore, after this time zone
7416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * is destructed, they are no longer available.
7426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param initial       Receives the initial timezone rule
7436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param trsrules      Receives the timezone transition rules
7446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param trscount      On input, specify the size of the array 'transitions' receiving
7456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      the timezone transition rules.  On output, actual number of
7466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                      rules filled in the array will be set.
7476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status        Receives error status code.
7486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 3.8
7496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
7516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const;
7526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgpublic:
7556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Override TimeZone Returns a unique class ID POLYMORPHICALLY. Pure virtual
7586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * override. This method is to implement a simple version of RTTI, since not all C++
7596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * compilers support genuine RTTI. Polymorphic operator==() and clone() methods call
7606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * this method.
7616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
7626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return   The class ID for this object. All objects of a given class have the
7636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *           same class ID. Objects of other classes have different class IDs.
7646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
7656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    virtual UClassID getDynamicClassID(void) const;
7676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Return the class ID for this class. This is useful only for comparing to a return
7706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * value from getDynamicClassID(). For example:
7716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <pre>
7726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * .   Base* polymorphic_pointer = createPolymorphicObject();
7736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * .   if (polymorphic_pointer->getDynamicClassID() ==
7746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * .       Derived::getStaticClassID()) ...
7756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * </pre>
7766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return   The class ID for all objects of this class.
7776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @stable ICU 2.0
7786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    static UClassID U_EXPORT2 getStaticClassID(void);
7806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgprivate:
7826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Constants specifying values of startMode and endMode.
7846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
7856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    enum EMode
7866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    {
7876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        DOM_MODE = 1,
7886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        DOW_IN_MONTH_MODE,
7896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        DOW_GE_DOM_MODE,
7906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org        DOW_LE_DOM_MODE
7916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    };
7926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    SimpleTimeZone(); // default constructor not implemented
7946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
7956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
7966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Internal construction method.
7976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param rawOffsetGMT    The new SimpleTimeZone's raw GMT offset
7986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param startMonth      the month DST starts
7996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param startDay        the day DST starts
8006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param startDayOfWeek  the DOW DST starts
8016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param startTime       the time DST starts
8026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param startTimeMode   Whether the start time is local wall time, local
8036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                        standard time, or UTC time. Default is local wall time.
8046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param endMonth        the month DST ends
8056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param endDay          the day DST ends
8066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param endDayOfWeek    the DOW DST ends
8076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param endTime         the time DST ends
8086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param endTimeMode     Whether the end time is local wall time, local
8096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                        standard time, or UTC time. Default is local wall time.
8106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param dstSavings      The number of milliseconds added to standard time
8116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *                        to get DST time. Default is one hour.
8126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @param status          An UErrorCode to receive the status.
8136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
8146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void construct(int32_t rawOffsetGMT,
8156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   int8_t startMonth, int8_t startDay, int8_t startDayOfWeek,
8166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   int32_t startTime, TimeMode startTimeMode,
8176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   int8_t endMonth, int8_t endDay, int8_t endDayOfWeek,
8186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   int32_t endTime, TimeMode endTimeMode,
8196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                   int32_t dstSavings, UErrorCode& status);
8206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
8226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Compare a given date in the year to a rule. Return 1, 0, or -1, depending
8236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * on whether the date is after, equal to, or before the rule date. The
8246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * millis are compared directly against the ruleMillis, so any
8256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * standard-daylight adjustments must be handled by the caller.
8266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *
8276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * @return  1 if the date is after the rule date, -1 if the date is before
8286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     *          the rule date, or 0 if the date is equal to the rule date.
8296f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
8306f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    static int32_t compareToRule(int8_t month, int8_t monthLen, int8_t prevMonthLen,
8316f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                 int8_t dayOfMonth,
8326f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                 int8_t dayOfWeek, int32_t millis, int32_t millisDelta,
8336f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                 EMode ruleMode, int8_t ruleMonth, int8_t ruleDayOfWeek,
8346f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                 int8_t ruleDay, int32_t ruleMillis);
8356f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8366f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
8376f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Given a set of encoded rules in startDay and startDayOfMonth, decode
8386f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * them and set the startMode appropriately.  Do the same for endDay and
8396f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * endDayOfMonth.
8406f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <P>
8416f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Upon entry, the day of week variables may be zero or
8426f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * negative, in order to indicate special modes.  The day of month
8436f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * variables may also be negative.
8446f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <P>
8456f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Upon exit, the mode variables will be
8466f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * set, and the day of week and day of month variables will be positive.
8476f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * <P>
8486f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * This method also recognizes a startDay or endDay of zero as indicating
8496f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * no DST.
8506f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
8516f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void decodeRules(UErrorCode& status);
8526f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void decodeStartRule(UErrorCode& status);
8536f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void decodeEndRule(UErrorCode& status);
8546f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8556f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int8_t startMonth, startDay, startDayOfWeek;   // the month, day, DOW, and time DST starts
8566f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int32_t startTime;
8576f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    TimeMode startTimeMode, endTimeMode; // Mode for startTime, endTime; see TimeMode
8586f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int8_t endMonth, endDay, endDayOfWeek; // the month, day, DOW, and time DST ends
8596f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int32_t endTime;
8606f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int32_t startYear;  // the year these DST rules took effect
8616f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int32_t rawOffset;  // the TimeZone's raw GMT offset
8626f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UBool useDaylight; // flag indicating whether this TimeZone uses DST
8636f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    static const int8_t STATICMONTHLENGTH[12]; // lengths of the months
8646f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    EMode startMode, endMode;   // flags indicating what kind of rules the DST rules are
8656f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8666f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /**
8676f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * A positive value indicating the amount of time saved during DST in ms.
8686f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     * Typically one hour; sometimes 30 minutes.
8696f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org     */
8706f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    int32_t dstSavings;
8716f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8726f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    /* Private for BasicTimeZone implementation */
8736f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void checkTransitionRules(UErrorCode& status) const;
8746f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void initTransitionRules(UErrorCode& status);
8756f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void clearTransitionRules(void);
8766f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    void deleteTransitionRules(void);
8776f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    UBool   transitionRulesInitialized;
8786f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    InitialTimeZoneRule*    initialRule;
8796f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    TimeZoneTransition*     firstTransition;
8806f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    AnnualTimeZoneRule*     stdRule;
8816f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    AnnualTimeZoneRule*     dstRule;
8826f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org};
8836f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8846f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void SimpleTimeZone::setStartRule(int32_t month, int32_t dayOfWeekInMonth,
8856f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                         int32_t dayOfWeek,
8866f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                         int32_t time, UErrorCode& status) {
8876f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    setStartRule(month, dayOfWeekInMonth, dayOfWeek, time, WALL_TIME, status);
8886f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
8896f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8906f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void SimpleTimeZone::setStartRule(int32_t month, int32_t dayOfMonth,
8916f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                         int32_t time,
8926f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                         UErrorCode& status) {
8936f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    setStartRule(month, dayOfMonth, time, WALL_TIME, status);
8946f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
8956f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
8966f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void SimpleTimeZone::setStartRule(int32_t month, int32_t dayOfMonth,
8976f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                         int32_t dayOfWeek,
8986f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                         int32_t time, UBool after, UErrorCode& status) {
8996f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    setStartRule(month, dayOfMonth, dayOfWeek, time, WALL_TIME, after, status);
9006f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
9016f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9026f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void SimpleTimeZone::setEndRule(int32_t month, int32_t dayOfWeekInMonth,
9036f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t dayOfWeek,
9046f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t time, UErrorCode& status) {
9056f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    setEndRule(month, dayOfWeekInMonth, dayOfWeek, time, WALL_TIME, status);
9066f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
9076f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9086f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void SimpleTimeZone::setEndRule(int32_t month, int32_t dayOfMonth,
9096f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t time, UErrorCode& status) {
9106f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    setEndRule(month, dayOfMonth, time, WALL_TIME, status);
9116f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
9126f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9136f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void SimpleTimeZone::setEndRule(int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
9146f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                                       int32_t time, UBool after, UErrorCode& status) {
9156f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    setEndRule(month, dayOfMonth, dayOfWeek, time, WALL_TIME, after, status);
9166f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
9176f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9186f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orginline void
9196f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgSimpleTimeZone::getOffset(UDate date, UBool local, int32_t& rawOffsetRef,
9206f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org                          int32_t& dstOffsetRef, UErrorCode& ec) const {
9216f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org    TimeZone::getOffset(date, local, rawOffsetRef, dstOffsetRef, ec);
9226f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org}
9236f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9246f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.orgU_NAMESPACE_END
9256f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9266f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif /* #if !UCONFIG_NO_FORMATTING */
9276f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org
9286f31ac30b9092fd02a8c97e5216cf53f3e4fae4jshin@chromium.org#endif // _SIMPLETZ
929