1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/*
2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*******************************************************************************
38393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius* Copyright (C) 2007-2013, International Business Machines Corporation and
4103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius* others. All Rights Reserved.
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*******************************************************************************
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef VTZONE_H
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define VTZONE_H
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/utypes.h"
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * \file
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * \brief C++ API: RFC2445 VTIMEZONE support
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#if !UCONFIG_NO_FORMATTING
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/basictz.h"
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_NAMESPACE_BEGIN
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass VTZWriter;
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass VTZReader;
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass UVector;
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * <code>VTimeZone</code> is a class implementing RFC2445 VTIMEZONE.  You can create a
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * <code>VTimeZone</code> instance from a time zone ID supported by <code>TimeZone</code>.
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * With the <code>VTimeZone</code> instance created from the ID, you can write out the rule
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * in RFC2445 VTIMEZONE format.  Also, you can create a <code>VTimeZone</code> instance
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * from RFC2445 VTIMEZONE data stream, which allows you to calculate time
3327f654740f2a26ad62a5c155af9199af9e69b889claireho * zone offset by the rules defined by the data. Or, you can create a
3427f654740f2a26ad62a5c155af9199af9e69b889claireho * <code>VTimeZone</code> from any other ICU <code>BasicTimeZone</code>.
3527f654740f2a26ad62a5c155af9199af9e69b889claireho * <br><br>
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Note: The consumer of this class reading or writing VTIMEZONE data is responsible to
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * decode or encode Non-ASCII text.  Methods reading/writing VTIMEZONE data in this class
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * do nothing with MIME encoding.
3985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho * @stable ICU 3.8
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass U_I18N_API VTimeZone : public BasicTimeZone {
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Copy constructor.
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param source    The <code>VTimeZone</code> object to be copied.
4685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    VTimeZone(const VTimeZone& source);
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Destructor.
5285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual ~VTimeZone();
55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Assignment operator.
58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param right The object to be copied.
5985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    VTimeZone& operator=(const VTimeZone& right);
62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Return true if the given <code>TimeZone</code> objects are
65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * semantically equal. Objects of different subclasses are considered unequal.
66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param that  The object to be compared with.
67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return  true if the given <code>TimeZone</code> objects are
68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru      *semantically equal.
6985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UBool operator==(const TimeZone& that) const;
72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Return true if the given <code>TimeZone</code> objects are
75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * semantically unequal. Objects of different subclasses are considered unequal.
76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param that  The object to be compared with.
77ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return  true if the given <code>TimeZone</code> objects are
78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * semantically unequal.
7985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UBool operator!=(const TimeZone& that) const;
82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
83ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
84ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Create a <code>VTimeZone</code> instance by the time zone ID.
85ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param ID The time zone ID, such as America/New_York
86ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return A <code>VTimeZone</code> object initialized by the time zone ID,
87ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * or NULL when the ID is unknown.
8885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
89ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
90ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    static VTimeZone* createVTimeZoneByID(const UnicodeString& ID);
91ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
92ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
9327f654740f2a26ad62a5c155af9199af9e69b889claireho     * Create a <code>VTimeZone</code> instance using a basic time zone.
9427f654740f2a26ad62a5c155af9199af9e69b889claireho     * @param basicTZ The basic time zone instance
9527f654740f2a26ad62a5c155af9199af9e69b889claireho     * @param status Output param to filled in with a success or an error.
9627f654740f2a26ad62a5c155af9199af9e69b889claireho     * @return A <code>VTimeZone</code> object initialized by the basic time zone.
97103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @stable ICU 4.6
9827f654740f2a26ad62a5c155af9199af9e69b889claireho     */
9927f654740f2a26ad62a5c155af9199af9e69b889claireho    static VTimeZone* createVTimeZoneFromBasicTimeZone(const BasicTimeZone& basicTZ,
10027f654740f2a26ad62a5c155af9199af9e69b889claireho                                                       UErrorCode &status);
10127f654740f2a26ad62a5c155af9199af9e69b889claireho
10227f654740f2a26ad62a5c155af9199af9e69b889claireho    /**
103ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Create a <code>VTimeZone</code> instance by RFC2445 VTIMEZONE data
104ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
105ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param vtzdata The string including VTIMEZONE data block
106ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status Output param to filled in with a success or an error.
107ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return A <code>VTimeZone</code> initialized by the VTIMEZONE data or
108ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * NULL if failed to load the rule from the VTIMEZONE data.
10985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
110ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
111ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    static VTimeZone* createVTimeZone(const UnicodeString& vtzdata, UErrorCode& status);
112ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
113ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
114ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gets the RFC2445 TZURL property value.  When a <code>VTimeZone</code> instance was
115ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * created from VTIMEZONE data, the initial value is set by the TZURL property value
116ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * in the data.  Otherwise, the initial value is not set.
117ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param url Receives the RFC2445 TZURL property value.
118ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return TRUE if TZURL attribute is available and value is set.
11985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
120ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
121ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UBool getTZURL(UnicodeString& url) const;
122ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
123ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
124ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Sets the RFC2445 TZURL property value.
125ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param url The TZURL property value.
12685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
127ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
128ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void setTZURL(const UnicodeString& url);
129ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
130ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
131ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gets the RFC2445 LAST-MODIFIED property value.  When a <code>VTimeZone</code> instance
132ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * was created from VTIMEZONE data, the initial value is set by the LAST-MODIFIED property
133ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * value in the data.  Otherwise, the initial value is not set.
134ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param lastModified Receives the last modified date.
135ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return TRUE if lastModified attribute is available and value is set.
13685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
137ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
138ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UBool getLastModified(UDate& lastModified) const;
139ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
140ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
141ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Sets the RFC2445 LAST-MODIFIED property value.
142ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param lastModified The LAST-MODIFIED date.
14385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
144ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
145ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void setLastModified(UDate lastModified);
146ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
147ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
148ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Writes RFC2445 VTIMEZONE data for this time zone
149ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param result Output param to filled in with the VTIMEZONE data.
150ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status Output param to filled in with a success or an error.
15185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
152ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
153ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void write(UnicodeString& result, UErrorCode& status) const;
154ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
155ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
156ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Writes RFC2445 VTIMEZONE data for this time zone applicalbe
157ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * for dates after the specified start time.
158ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param start The start date.
159ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param result Output param to filled in with the VTIMEZONE data.
160ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status Output param to filled in with a success or an error.
16185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
162ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
1638393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    void write(UDate start, UnicodeString& result, UErrorCode& status) const;
164ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
165ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
166ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Writes RFC2445 VTIMEZONE data applicalbe for the specified date.
167ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Some common iCalendar implementations can only handle a single time
168ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * zone property or a pair of standard and daylight time properties using
169ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * BYDAY rule with day of week (such as BYDAY=1SUN).  This method produce
170ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the VTIMEZONE data which can be handled these implementations.  The rules
171ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * produced by this method can be used only for calculating time zone offset
172ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * around the specified date.
173ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param time The date used for rule extraction.
174ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param result Output param to filled in with the VTIMEZONE data.
175ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status Output param to filled in with a success or an error.
17685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
177ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
1788393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    void writeSimple(UDate time, UnicodeString& result, UErrorCode& status) const;
179ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
180ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
181ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Clones TimeZone objects polymorphically. Clients are responsible for deleting
182ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the TimeZone object cloned.
183ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return   A new copy of this TimeZone object.
18485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
185ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
186ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual TimeZone* clone(void) const;
187ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
188ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
189ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add
190ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * to GMT to get local time in this time zone, taking daylight savings time into
191ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * account) as of a particular reference date.  The reference date is used to determine
192ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * whether daylight savings time is in effect and needs to be figured into the offset
193ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * that is returned (in other words, what is the adjusted GMT offset in this time zone
194ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * at this particular date and time?).  For the time zones produced by createTimeZone(),
195ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the reference data is specified according to the Gregorian calendar, and the date
196ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * and time fields are local standard time.
197ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
198ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload,
199ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * which returns both the raw and the DST offset for a given time. This method
200ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * is retained only for backward compatibility.
201ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
202ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param era        The reference date's era
203ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param year       The reference date's year
204ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param month      The reference date's month (0-based; 0 is January)
205ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param day        The reference date's day-in-month (1-based)
206ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param dayOfWeek  The reference date's day-of-week (1-based; 1 is Sunday)
207ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param millis     The reference date's milliseconds in day, local standard time
208ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status     Output param to filled in with a success or an error.
209ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return           The offset in milliseconds to add to GMT to get local time.
21085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
211ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
212ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
213ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                              uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const;
214ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
215ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
216ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gets the time zone offset, for current date, modified in case of
217ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * daylight savings. This is the offset to add *to* UTC to get local time.
218ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
219ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload,
220ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * which returns both the raw and the DST offset for a given time. This method
221ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * is retained only for backward compatibility.
222ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
223ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param era        The reference date's era
224ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param year       The reference date's year
225ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param month      The reference date's month (0-based; 0 is January)
226ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param day        The reference date's day-in-month (1-based)
227ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param dayOfWeek  The reference date's day-of-week (1-based; 1 is Sunday)
228ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param millis     The reference date's milliseconds in day, local standard time
229ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param monthLength The length of the given month in days.
230ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status     Output param to filled in with a success or an error.
231ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return           The offset in milliseconds to add to GMT to get local time.
23285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
233ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
234ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
235ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                           uint8_t dayOfWeek, int32_t millis,
236ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                           int32_t monthLength, UErrorCode& status) const;
237ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
238ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
239ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Returns the time zone raw and GMT offset for the given moment
240ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * in time.  Upon return, local-millis = GMT-millis + rawOffset +
241ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * dstOffset.  All computations are performed in the proleptic
242ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gregorian calendar.  The default implementation in the TimeZone
243ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * class delegates to the 8-argument getOffset().
244ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
245ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param date moment in time for which to return offsets, in
246ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * units of milliseconds from January 1, 1970 0:00 GMT, either GMT
247ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * time or local wall time, depending on `local'.
248ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param local if true, `date' is local wall time; otherwise it
249ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * is in GMT time.
250ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param rawOffset output parameter to receive the raw offset, that
251ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * is, the offset not including DST adjustments
252ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param dstOffset output parameter to receive the DST offset,
253ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * that is, the offset to be added to `rawOffset' to obtain the
254ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * total offset between local and GMT time. If DST is not in
255ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * effect, this value is zero; otherwise it is a positive value,
256ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * typically one hour.
257ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param ec input-output error code
25885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
259ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
260ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void getOffset(UDate date, UBool local, int32_t& rawOffset,
261ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                           int32_t& dstOffset, UErrorCode& ec) const;
262ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
263ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
264ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
265ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * to GMT to get local time, before taking daylight savings time into account).
266ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
267ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param offsetMillis  The new raw GMT offset for this time zone.
26885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
269ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
270ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void setRawOffset(int32_t offsetMillis);
271ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
272ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
273ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add
274ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * to GMT to get local time, before taking daylight savings time into account).
275ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
276ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return   The TimeZone's raw GMT offset.
27785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
278ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
279ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual int32_t getRawOffset(void) const;
280ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
281ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
282ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Queries if this time zone uses daylight savings time.
283ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return true if this time zone uses daylight savings time,
284ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * false, otherwise.
28585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
286ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
287ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UBool useDaylightTime(void) const;
288ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
289ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
290ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Queries if the given date is in daylight savings time in
291ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * this time zone.
292ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * This method is wasteful since it creates a new GregorianCalendar and
293ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * deletes it each time it is called. This is a deprecated method
294ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * and provided only for Java compatibility.
295ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
296ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param date the given UDate.
297ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status Output param filled in with success/error code.
298ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return true if the given date is in daylight savings time,
299ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * false, otherwise.
300ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead.
301ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
302ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UBool inDaylightTime(UDate date, UErrorCode& status) const;
303ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
304ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
305ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Returns true if this zone has the same rule and offset as another zone.
306ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * That is, if this zone differs only in ID, if at all.
307ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param other the <code>TimeZone</code> object to be compared with
308ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return true if the given zone is the same as this one,
309ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * with the possible exception of the ID
31085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
311ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
312ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UBool hasSameRules(const TimeZone& other) const;
313ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
314ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
315ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gets the first time zone transition after the base time.
316ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param base      The base time.
317ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param inclusive Whether the base time is inclusive or not.
318ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param result    Receives the first transition after the base time.
319ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return  TRUE if the transition is found.
32085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
321ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
3228393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const;
323ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
324ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
325ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gets the most recent time zone transition before the base time.
326ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param base      The base time.
327ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param inclusive Whether the base time is inclusive or not.
328ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param result    Receives the most recent transition before the base time.
329ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return  TRUE if the transition is found.
33085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
331ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
3328393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const;
333ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
334ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
335ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Returns the number of <code>TimeZoneRule</code>s which represents time transitions,
336ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except
337ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * <code>InitialTimeZoneRule</code>.  The return value range is 0 or any positive value.
338ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status    Receives error status code.
339ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return The number of <code>TimeZoneRule</code>s representing time transitions.
34085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
341ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
3428393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    virtual int32_t countTransitionRules(UErrorCode& status) const;
343ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
344ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
345ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Gets the <code>InitialTimeZoneRule</code> and the set of <code>TimeZoneRule</code>
346ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * which represent time transitions for this time zone.  On successful return,
347ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the argument initial points to non-NULL <code>InitialTimeZoneRule</code> and
348ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * the array trsrules is filled with 0 or multiple <code>TimeZoneRule</code>
349ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * instances up to the size specified by trscount.  The results are referencing the
350ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * rule instance held by this time zone instance.  Therefore, after this time zone
351ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * is destructed, they are no longer available.
352ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param initial       Receives the initial timezone rule
353ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param trsrules      Receives the timezone transition rules
354ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param trscount      On input, specify the size of the array 'transitions' receiving
355ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *                      the timezone transition rules.  On output, actual number of
356ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *                      rules filled in the array will be set.
357ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @param status        Receives error status code.
35885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
359ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
360ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial,
3618393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius        const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const;
362ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
363ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprivate:
364ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    enum { DEFAULT_VTIMEZONE_LINES = 100 };
365ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
366ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
367ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Default constructor.
368ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
369ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    VTimeZone();
370ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    static VTimeZone* createVTimeZone(VTZReader* reader);
371ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void write(VTZWriter& writer, UErrorCode& status) const;
3728393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    void write(UDate start, VTZWriter& writer, UErrorCode& status) const;
3738393335b955da7340c9f19b1b4b2d6c0c2c04be7Craig Cornelius    void writeSimple(UDate time, VTZWriter& writer, UErrorCode& status) const;
374ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void load(VTZReader& reader, UErrorCode& status);
375ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void parse(UErrorCode& status);
376ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
377ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void writeZone(VTZWriter& w, BasicTimeZone& basictz, UVector* customProps,
378ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        UErrorCode& status) const;
379ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
380ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void writeHeaders(VTZWriter& w, UErrorCode& status) const;
381ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void writeFooter(VTZWriter& writer, UErrorCode& status) const;
382ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
38385bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    void writeZonePropsByTime(VTZWriter& writer, UBool isDst, const UnicodeString& zonename,
384ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                              int32_t fromOffset, int32_t toOffset, UDate time, UBool withRDATE,
385ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                              UErrorCode& status) const;
38685bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    void writeZonePropsByDOM(VTZWriter& writer, UBool isDst, const UnicodeString& zonename,
387ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                             int32_t fromOffset, int32_t toOffset,
388ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                             int32_t month, int32_t dayOfMonth, UDate startTime, UDate untilTime,
389ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                             UErrorCode& status) const;
39085bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    void writeZonePropsByDOW(VTZWriter& writer, UBool isDst, const UnicodeString& zonename,
391ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                             int32_t fromOffset, int32_t toOffset,
392ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                             int32_t month, int32_t weekInMonth, int32_t dayOfWeek,
393ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                             UDate startTime, UDate untilTime, UErrorCode& status) const;
39485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    void writeZonePropsByDOW_GEQ_DOM(VTZWriter& writer, UBool isDst, const UnicodeString& zonename,
395ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                     int32_t fromOffset, int32_t toOffset,
396ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                     int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
397ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                     UDate startTime, UDate untilTime, UErrorCode& status) const;
398ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void writeZonePropsByDOW_GEQ_DOM_sub(VTZWriter& writer, int32_t month, int32_t dayOfMonth,
399ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                         int32_t dayOfWeek, int32_t numDays,
400ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                         UDate untilTime, int32_t fromOffset, UErrorCode& status) const;
40185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    void writeZonePropsByDOW_LEQ_DOM(VTZWriter& writer, UBool isDst, const UnicodeString& zonename,
402ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                     int32_t fromOffset, int32_t toOffset,
403ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                     int32_t month, int32_t dayOfMonth, int32_t dayOfWeek,
404ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                                     UDate startTime, UDate untilTime, UErrorCode& status) const;
405ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void writeFinalRule(VTZWriter& writer, UBool isDst, const AnnualTimeZoneRule* rule,
406ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                        int32_t fromRawOffset, int32_t fromDSTSavings,
407ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                        UDate startTime, UErrorCode& status) const;
408ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
40985bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho    void beginZoneProps(VTZWriter& writer, UBool isDst, const UnicodeString& zonename,
410ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru                        int32_t fromOffset, int32_t toOffset, UDate startTime, UErrorCode& status) const;
411ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void endZoneProps(VTZWriter& writer, UBool isDst, UErrorCode& status) const;
412ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void beginRRULE(VTZWriter& writer, int32_t month, UErrorCode& status) const;
413ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    void appendUNTIL(VTZWriter& writer, const UnicodeString& until, UErrorCode& status) const;
414ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
415ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    BasicTimeZone   *tz;
416ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UVector         *vtzlines;
417ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeString   tzurl;
418ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UDate           lastmod;
419ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeString   olsonzid;
420ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UnicodeString   icutzver;
421ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
422ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
423ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
424ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Return the class ID for this class. This is useful only for comparing to
425ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * a return value from getDynamicClassID(). For example:
426ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * <pre>
427ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * .   Base* polymorphic_pointer = createPolymorphicObject();
428ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * .   if (polymorphic_pointer->getDynamicClassID() ==
429ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * .       erived::getStaticClassID()) ...
430ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * </pre>
431ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return          The class ID for all objects of this class.
43285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
433ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
434ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    static UClassID U_EXPORT2 getStaticClassID(void);
435ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
436ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    /**
437ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
438ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * method is to implement a simple version of RTTI, since not all C++
439ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * compilers support genuine RTTI. Polymorphic operator==() and clone()
440ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * methods call this method.
441ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *
442ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     * @return          The class ID for this object. All objects of a
443ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *                  given class have the same class ID.  Objects of
444ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     *                  other classes have different class IDs.
44585bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho     * @stable ICU 3.8
446ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru     */
447ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UClassID getDynamicClassID(void) const;
448ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
449ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
450ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_NAMESPACE_END
451ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
452ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_FORMATTING */
453ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
454ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif // VTZONE_H
455ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru//eof
456