12e5b6d6dSopenharmony_ci// © 2016 and later: Unicode, Inc. and others. 22e5b6d6dSopenharmony_ci// License & terms of use: http://www.unicode.org/copyright.html 32e5b6d6dSopenharmony_ci/* 42e5b6d6dSopenharmony_ci******************************************************************************* 52e5b6d6dSopenharmony_ci* Copyright (C) 2009-2016, International Business Machines Corporation and 62e5b6d6dSopenharmony_ci* others. All Rights Reserved. 72e5b6d6dSopenharmony_ci******************************************************************************* 82e5b6d6dSopenharmony_ci*/ 92e5b6d6dSopenharmony_ci 102e5b6d6dSopenharmony_ci/** 112e5b6d6dSopenharmony_ci* \file 122e5b6d6dSopenharmony_ci* \brief C API: RFC2445 VTIMEZONE support 132e5b6d6dSopenharmony_ci* 142e5b6d6dSopenharmony_ci* <p>This is a C wrapper around the C++ VTimeZone class.</p> 152e5b6d6dSopenharmony_ci*/ 162e5b6d6dSopenharmony_ci 172e5b6d6dSopenharmony_ci#ifndef __VZONE_H 182e5b6d6dSopenharmony_ci#define __VZONE_H 192e5b6d6dSopenharmony_ci 202e5b6d6dSopenharmony_ci#include "unicode/utypes.h" 212e5b6d6dSopenharmony_ci 222e5b6d6dSopenharmony_ci#if !UCONFIG_NO_FORMATTING 232e5b6d6dSopenharmony_ci 242e5b6d6dSopenharmony_ci#include "unicode/uobject.h" 252e5b6d6dSopenharmony_ci#include "ztrans.h" 262e5b6d6dSopenharmony_ci 272e5b6d6dSopenharmony_cistruct VZone; 282e5b6d6dSopenharmony_ci/** 292e5b6d6dSopenharmony_ci * A UnicodeSet. Use the vzone_* API to manipulate. Create with 302e5b6d6dSopenharmony_ci * vzone_open*, and destroy with vzone_close. 312e5b6d6dSopenharmony_ci */ 322e5b6d6dSopenharmony_citypedef struct VZone VZone; 332e5b6d6dSopenharmony_ci 342e5b6d6dSopenharmony_ci/********************************************************************* 352e5b6d6dSopenharmony_ci * VZone API 362e5b6d6dSopenharmony_ci *********************************************************************/ 372e5b6d6dSopenharmony_ci 382e5b6d6dSopenharmony_ci/** 392e5b6d6dSopenharmony_ci * Creates a vzone from the given time zone ID. 402e5b6d6dSopenharmony_ci * @param ID The time zone ID, such as America/New_York 412e5b6d6dSopenharmony_ci * @param idLength, length of the ID parameter 422e5b6d6dSopenharmony_ci * @return A vzone object initialized by the time zone ID, 432e5b6d6dSopenharmony_ci * or NULL when the ID is unknown. 442e5b6d6dSopenharmony_ci */ 452e5b6d6dSopenharmony_ciU_CAPI VZone* U_EXPORT2 462e5b6d6dSopenharmony_civzone_openID(const UChar* ID, int32_t idLength); 472e5b6d6dSopenharmony_ci 482e5b6d6dSopenharmony_ci/** 492e5b6d6dSopenharmony_ci * Create a vzone instance by RFC2445 VTIMEZONE data 502e5b6d6dSopenharmony_ci * @param vtzdata The string including VTIMEZONE data block 512e5b6d6dSopenharmony_ci * @param vtzdataLength, length of the vtzdata 522e5b6d6dSopenharmony_ci * @param status Output param to filled in with a success or an error. 532e5b6d6dSopenharmony_ci * @return A vzone initialized by the VTIMEZONE data or 542e5b6d6dSopenharmony_ci * NULL if failed to load the rule from the VTIMEZONE data. 552e5b6d6dSopenharmony_ci */ 562e5b6d6dSopenharmony_ciU_CAPI VZone* U_EXPORT2 572e5b6d6dSopenharmony_civzone_openData(const UChar* vtzdata, int32_t vtzdataLength, UErrorCode& status); 582e5b6d6dSopenharmony_ci 592e5b6d6dSopenharmony_ci/** 602e5b6d6dSopenharmony_ci * Disposes of the storage used by a VZone object. This function should 612e5b6d6dSopenharmony_ci * be called exactly once for objects returned by vzone_open*. 622e5b6d6dSopenharmony_ci * @param set the object to dispose of 632e5b6d6dSopenharmony_ci */ 642e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 652e5b6d6dSopenharmony_civzone_close(VZone* zone); 662e5b6d6dSopenharmony_ci 672e5b6d6dSopenharmony_ci/** 682e5b6d6dSopenharmony_ci * Returns a copy of this object. 692e5b6d6dSopenharmony_ci * @param zone the original vzone 702e5b6d6dSopenharmony_ci * @return the newly allocated copy of the vzone 712e5b6d6dSopenharmony_ci */ 722e5b6d6dSopenharmony_ciU_CAPI VZone* U_EXPORT2 732e5b6d6dSopenharmony_civzone_clone(const VZone *zone); 742e5b6d6dSopenharmony_ci 752e5b6d6dSopenharmony_ci/** 762e5b6d6dSopenharmony_ci * Returns true if zone1 is identical to zone2 772e5b6d6dSopenharmony_ci * and vis versa. 782e5b6d6dSopenharmony_ci * @param zone1 to be checked for containment 792e5b6d6dSopenharmony_ci * @param zone2 to be checked for containment 802e5b6d6dSopenharmony_ci * @return true if the test condition is met 812e5b6d6dSopenharmony_ci */ 822e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 832e5b6d6dSopenharmony_civzone_equals(const VZone* zone1, const VZone* zone2); 842e5b6d6dSopenharmony_ci 852e5b6d6dSopenharmony_ci/** 862e5b6d6dSopenharmony_ci * Gets the RFC2445 TZURL property value. When a vzone instance was 872e5b6d6dSopenharmony_ci * created from VTIMEZONE data, the initial value is set by the TZURL 882e5b6d6dSopenharmony_ci * property value in the data. Otherwise, the initial value is not set. 892e5b6d6dSopenharmony_ci * @param zone, the vzone to use 902e5b6d6dSopenharmony_ci * @param url Receives the RFC2445 TZURL property value. 912e5b6d6dSopenharmony_ci * @param urlLength, length of the url 922e5b6d6dSopenharmony_ci * @return true if TZURL attribute is available and value is set. 932e5b6d6dSopenharmony_ci */ 942e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 952e5b6d6dSopenharmony_civzone_getTZURL(VZone* zone, UChar* & url, int32_t & urlLength); 962e5b6d6dSopenharmony_ci 972e5b6d6dSopenharmony_ci/** 982e5b6d6dSopenharmony_ci * Sets the RFC2445 TZURL property value. 992e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1002e5b6d6dSopenharmony_ci * @param url The TZURL property value. 1012e5b6d6dSopenharmony_ci * @param urlLength, length of the url 1022e5b6d6dSopenharmony_ci */ 1032e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 1042e5b6d6dSopenharmony_civzone_setTZURL(VZone* zone, UChar* url, int32_t urlLength); 1052e5b6d6dSopenharmony_ci 1062e5b6d6dSopenharmony_ci/** 1072e5b6d6dSopenharmony_ci * Gets the RFC2445 LAST-MODIFIED property value. When a vzone instance 1082e5b6d6dSopenharmony_ci * was created from VTIMEZONE data, the initial value is set by the 1092e5b6d6dSopenharmony_ci * LAST-MODIFIED property value in the data. Otherwise, the initial value 1102e5b6d6dSopenharmony_ci * is not set. 1112e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1122e5b6d6dSopenharmony_ci * @param lastModified Receives the last modified date. 1132e5b6d6dSopenharmony_ci * @return true if lastModified attribute is available and value is set. 1142e5b6d6dSopenharmony_ci */ 1152e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 1162e5b6d6dSopenharmony_civzone_getLastModified(VZone* zone, UDate& lastModified); 1172e5b6d6dSopenharmony_ci 1182e5b6d6dSopenharmony_ci/** 1192e5b6d6dSopenharmony_ci * Sets the RFC2445 LAST-MODIFIED property value. 1202e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1212e5b6d6dSopenharmony_ci * @param lastModified The LAST-MODIFIED date. 1222e5b6d6dSopenharmony_ci */ 1232e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 1242e5b6d6dSopenharmony_civzone_setLastModified(VZone* zone, UDate lastModified); 1252e5b6d6dSopenharmony_ci 1262e5b6d6dSopenharmony_ci/** 1272e5b6d6dSopenharmony_ci * Writes RFC2445 VTIMEZONE data for this time zone 1282e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1292e5b6d6dSopenharmony_ci * @param result Output param to filled in with the VTIMEZONE data. 1302e5b6d6dSopenharmony_ci * @param resultLength, length of the result output 1312e5b6d6dSopenharmony_ci * @param status Output param to filled in with a success or an error. 1322e5b6d6dSopenharmony_ci */ 1332e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 1342e5b6d6dSopenharmony_civzone_write(VZone* zone, UChar* & result, int32_t & resultLength, UErrorCode& status); 1352e5b6d6dSopenharmony_ci 1362e5b6d6dSopenharmony_ci/** 1372e5b6d6dSopenharmony_ci * Writes RFC2445 VTIMEZONE data for this time zone applicable 1382e5b6d6dSopenharmony_ci * for dates after the specified start time. 1392e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1402e5b6d6dSopenharmony_ci * @param start The start date. 1412e5b6d6dSopenharmony_ci * @param result Output param to filled in with the VTIMEZONE data. 1422e5b6d6dSopenharmony_ci * @param resultLength, length of the result output 1432e5b6d6dSopenharmony_ci * @param status Output param to filled in with a success or an error. 1442e5b6d6dSopenharmony_ci */ 1452e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 1462e5b6d6dSopenharmony_civzone_writeFromStart(VZone* zone, UDate start, UChar* & result, int32_t & resultLength, UErrorCode& status); 1472e5b6d6dSopenharmony_ci 1482e5b6d6dSopenharmony_ci/** 1492e5b6d6dSopenharmony_ci * Writes RFC2445 VTIMEZONE data applicable for the specified date. 1502e5b6d6dSopenharmony_ci * Some common iCalendar implementations can only handle a single time 1512e5b6d6dSopenharmony_ci * zone property or a pair of standard and daylight time properties using 1522e5b6d6dSopenharmony_ci * BYDAY rule with day of week (such as BYDAY=1SUN). This method produce 1532e5b6d6dSopenharmony_ci * the VTIMEZONE data which can be handled these implementations. The rules 1542e5b6d6dSopenharmony_ci * produced by this method can be used only for calculating time zone offset 1552e5b6d6dSopenharmony_ci * around the specified date. 1562e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1572e5b6d6dSopenharmony_ci * @param time The date used for rule extraction. 1582e5b6d6dSopenharmony_ci * @param result Output param to filled in with the VTIMEZONE data. 1592e5b6d6dSopenharmony_ci * @param status Output param to filled in with a success or an error. 1602e5b6d6dSopenharmony_ci */ 1612e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 1622e5b6d6dSopenharmony_civzone_writeSimple(VZone* zone, UDate time, UChar* & result, int32_t & resultLength, UErrorCode& status); 1632e5b6d6dSopenharmony_ci 1642e5b6d6dSopenharmony_ci/** 1652e5b6d6dSopenharmony_ci * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add 1662e5b6d6dSopenharmony_ci * to GMT to get local time in this time zone, taking daylight savings time into 1672e5b6d6dSopenharmony_ci * account) as of a particular reference date. The reference date is used to determine 1682e5b6d6dSopenharmony_ci * whether daylight savings time is in effect and needs to be figured into the offset 1692e5b6d6dSopenharmony_ci * that is returned (in other words, what is the adjusted GMT offset in this time zone 1702e5b6d6dSopenharmony_ci * at this particular date and time?). For the time zones produced by createTimeZone(), 1712e5b6d6dSopenharmony_ci * the reference data is specified according to the Gregorian calendar, and the date 1722e5b6d6dSopenharmony_ci * and time fields are local standard time. 1732e5b6d6dSopenharmony_ci * 1742e5b6d6dSopenharmony_ci * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload, 1752e5b6d6dSopenharmony_ci * which returns both the raw and the DST offset for a given time. This method 1762e5b6d6dSopenharmony_ci * is retained only for backward compatibility. 1772e5b6d6dSopenharmony_ci * 1782e5b6d6dSopenharmony_ci * @param zone, the vzone to use 1792e5b6d6dSopenharmony_ci * @param era The reference date's era 1802e5b6d6dSopenharmony_ci * @param year The reference date's year 1812e5b6d6dSopenharmony_ci * @param month The reference date's month (0-based; 0 is January) 1822e5b6d6dSopenharmony_ci * @param day The reference date's day-in-month (1-based) 1832e5b6d6dSopenharmony_ci * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday) 1842e5b6d6dSopenharmony_ci * @param millis The reference date's milliseconds in day, local standard time 1852e5b6d6dSopenharmony_ci * @param status Output param to filled in with a success or an error. 1862e5b6d6dSopenharmony_ci * @return The offset in milliseconds to add to GMT to get local time. 1872e5b6d6dSopenharmony_ci */ 1882e5b6d6dSopenharmony_ciU_CAPI int32_t U_EXPORT2 1892e5b6d6dSopenharmony_civzone_getOffset(VZone* zone, uint8_t era, int32_t year, int32_t month, int32_t day, 1902e5b6d6dSopenharmony_ci uint8_t dayOfWeek, int32_t millis, UErrorCode& status); 1912e5b6d6dSopenharmony_ci 1922e5b6d6dSopenharmony_ci/** 1932e5b6d6dSopenharmony_ci * Gets the time zone offset, for current date, modified in case of 1942e5b6d6dSopenharmony_ci * daylight savings. This is the offset to add *to* UTC to get local time. 1952e5b6d6dSopenharmony_ci * 1962e5b6d6dSopenharmony_ci * <p>Note: Don't call this method. Instead, call the getOffset(UDate...) overload, 1972e5b6d6dSopenharmony_ci * which returns both the raw and the DST offset for a given time. This method 1982e5b6d6dSopenharmony_ci * is retained only for backward compatibility. 1992e5b6d6dSopenharmony_ci * 2002e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2012e5b6d6dSopenharmony_ci * @param era The reference date's era 2022e5b6d6dSopenharmony_ci * @param year The reference date's year 2032e5b6d6dSopenharmony_ci * @param month The reference date's month (0-based; 0 is January) 2042e5b6d6dSopenharmony_ci * @param day The reference date's day-in-month (1-based) 2052e5b6d6dSopenharmony_ci * @param dayOfWeek The reference date's day-of-week (1-based; 1 is Sunday) 2062e5b6d6dSopenharmony_ci * @param millis The reference date's milliseconds in day, local standard time 2072e5b6d6dSopenharmony_ci * @param monthLength The length of the given month in days. 2082e5b6d6dSopenharmony_ci * @param status Output param to filled in with a success or an error. 2092e5b6d6dSopenharmony_ci * @return The offset in milliseconds to add to GMT to get local time. 2102e5b6d6dSopenharmony_ci */ 2112e5b6d6dSopenharmony_ciU_CAPI int32_t U_EXPORT2 2122e5b6d6dSopenharmony_civzone_getOffset2(VZone* zone, uint8_t era, int32_t year, int32_t month, int32_t day, 2132e5b6d6dSopenharmony_ci uint8_t dayOfWeek, int32_t millis, 2142e5b6d6dSopenharmony_ci int32_t monthLength, UErrorCode& status); 2152e5b6d6dSopenharmony_ci 2162e5b6d6dSopenharmony_ci/** 2172e5b6d6dSopenharmony_ci * Returns the time zone raw and GMT offset for the given moment 2182e5b6d6dSopenharmony_ci * in time. Upon return, local-millis = GMT-millis + rawOffset + 2192e5b6d6dSopenharmony_ci * dstOffset. All computations are performed in the proleptic 2202e5b6d6dSopenharmony_ci * Gregorian calendar. The default implementation in the TimeZone 2212e5b6d6dSopenharmony_ci * class delegates to the 8-argument getOffset(). 2222e5b6d6dSopenharmony_ci * 2232e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2242e5b6d6dSopenharmony_ci * @param date moment in time for which to return offsets, in 2252e5b6d6dSopenharmony_ci * units of milliseconds from January 1, 1970 0:00 GMT, either GMT 2262e5b6d6dSopenharmony_ci * time or local wall time, depending on `local'. 2272e5b6d6dSopenharmony_ci * @param local if true, `date' is local wall time; otherwise it 2282e5b6d6dSopenharmony_ci * is in GMT time. 2292e5b6d6dSopenharmony_ci * @param rawOffset output parameter to receive the raw offset, that 2302e5b6d6dSopenharmony_ci * is, the offset not including DST adjustments 2312e5b6d6dSopenharmony_ci * @param dstOffset output parameter to receive the DST offset, 2322e5b6d6dSopenharmony_ci * that is, the offset to be added to `rawOffset' to obtain the 2332e5b6d6dSopenharmony_ci * total offset between local and GMT time. If DST is not in 2342e5b6d6dSopenharmony_ci * effect, this value is zero; otherwise it is a positive value, 2352e5b6d6dSopenharmony_ci * typically one hour. 2362e5b6d6dSopenharmony_ci * @param ec input-output error code 2372e5b6d6dSopenharmony_ci */ 2382e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 2392e5b6d6dSopenharmony_civzone_getOffset3(VZone* zone, UDate date, UBool local, int32_t& rawOffset, 2402e5b6d6dSopenharmony_ci int32_t& dstOffset, UErrorCode& ec); 2412e5b6d6dSopenharmony_ci 2422e5b6d6dSopenharmony_ci/** 2432e5b6d6dSopenharmony_ci * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add 2442e5b6d6dSopenharmony_ci * to GMT to get local time, before taking daylight savings time into account). 2452e5b6d6dSopenharmony_ci * 2462e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2472e5b6d6dSopenharmony_ci * @param offsetMillis The new raw GMT offset for this time zone. 2482e5b6d6dSopenharmony_ci */ 2492e5b6d6dSopenharmony_ciU_CAPI void U_EXPORT2 2502e5b6d6dSopenharmony_civzone_setRawOffset(VZone* zone, int32_t offsetMillis); 2512e5b6d6dSopenharmony_ci 2522e5b6d6dSopenharmony_ci/** 2532e5b6d6dSopenharmony_ci * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add 2542e5b6d6dSopenharmony_ci * to GMT to get local time, before taking daylight savings time into account). 2552e5b6d6dSopenharmony_ci * 2562e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2572e5b6d6dSopenharmony_ci * @return The TimeZone's raw GMT offset. 2582e5b6d6dSopenharmony_ci */ 2592e5b6d6dSopenharmony_ciU_CAPI int32_t U_EXPORT2 2602e5b6d6dSopenharmony_civzone_getRawOffset(VZone* zone); 2612e5b6d6dSopenharmony_ci 2622e5b6d6dSopenharmony_ci/** 2632e5b6d6dSopenharmony_ci * Queries if this time zone uses daylight savings time. 2642e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2652e5b6d6dSopenharmony_ci * @return true if this time zone uses daylight savings time, 2662e5b6d6dSopenharmony_ci * false, otherwise. 2672e5b6d6dSopenharmony_ci */ 2682e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 2692e5b6d6dSopenharmony_civzone_useDaylightTime(VZone* zone); 2702e5b6d6dSopenharmony_ci 2712e5b6d6dSopenharmony_ci/** 2722e5b6d6dSopenharmony_ci * Queries if the given date is in daylight savings time in 2732e5b6d6dSopenharmony_ci * this time zone. 2742e5b6d6dSopenharmony_ci * This method is wasteful since it creates a new GregorianCalendar and 2752e5b6d6dSopenharmony_ci * deletes it each time it is called. This is a deprecated method 2762e5b6d6dSopenharmony_ci * and provided only for Java compatibility. 2772e5b6d6dSopenharmony_ci * 2782e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2792e5b6d6dSopenharmony_ci * @param date the given UDate. 2802e5b6d6dSopenharmony_ci * @param status Output param filled in with success/error code. 2812e5b6d6dSopenharmony_ci * @return true if the given date is in daylight savings time, 2822e5b6d6dSopenharmony_ci * false, otherwise. 2832e5b6d6dSopenharmony_ci */ 2842e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 2852e5b6d6dSopenharmony_civzone_inDaylightTime(VZone* zone, UDate date, UErrorCode& status); 2862e5b6d6dSopenharmony_ci 2872e5b6d6dSopenharmony_ci/** 2882e5b6d6dSopenharmony_ci * Returns true if this zone has the same rule and offset as another zone. 2892e5b6d6dSopenharmony_ci * That is, if this zone differs only in ID, if at all. 2902e5b6d6dSopenharmony_ci * @param zone, the vzone to use 2912e5b6d6dSopenharmony_ci * @param other the <code>TimeZone</code> object to be compared with 2922e5b6d6dSopenharmony_ci * @return true if the given zone is the same as this one, 2932e5b6d6dSopenharmony_ci * with the possible exception of the ID 2942e5b6d6dSopenharmony_ci */ 2952e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 2962e5b6d6dSopenharmony_civzone_hasSameRules(VZone* zone, const VZone* other); 2972e5b6d6dSopenharmony_ci 2982e5b6d6dSopenharmony_ci/** 2992e5b6d6dSopenharmony_ci * Gets the first time zone transition after the base time. 3002e5b6d6dSopenharmony_ci * @param zone, the vzone to use 3012e5b6d6dSopenharmony_ci * @param base The base time. 3022e5b6d6dSopenharmony_ci * @param inclusive Whether the base time is inclusive or not. 3032e5b6d6dSopenharmony_ci * @param result Receives the first transition after the base time. 3042e5b6d6dSopenharmony_ci * @return true if the transition is found. 3052e5b6d6dSopenharmony_ci */ 3062e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 3072e5b6d6dSopenharmony_civzone_getNextTransition(VZone* zone, UDate base, UBool inclusive, ZTrans* result); 3082e5b6d6dSopenharmony_ci 3092e5b6d6dSopenharmony_ci/** 3102e5b6d6dSopenharmony_ci * Gets the most recent time zone transition before the base time. 3112e5b6d6dSopenharmony_ci * @param zone, the vzone to use 3122e5b6d6dSopenharmony_ci * @param base The base time. 3132e5b6d6dSopenharmony_ci * @param inclusive Whether the base time is inclusive or not. 3142e5b6d6dSopenharmony_ci * @param result Receives the most recent transition before the base time. 3152e5b6d6dSopenharmony_ci * @return true if the transition is found. 3162e5b6d6dSopenharmony_ci */ 3172e5b6d6dSopenharmony_ciU_CAPI UBool U_EXPORT2 3182e5b6d6dSopenharmony_civzone_getPreviousTransition(VZone* zone, UDate base, UBool inclusive, ZTrans* result); 3192e5b6d6dSopenharmony_ci 3202e5b6d6dSopenharmony_ci/** 3212e5b6d6dSopenharmony_ci * Returns the number of <code>TimeZoneRule</code>s which represents time transitions, 3222e5b6d6dSopenharmony_ci * for this time zone, that is, all <code>TimeZoneRule</code>s for this time zone except 3232e5b6d6dSopenharmony_ci * <code>InitialTimeZoneRule</code>. The return value range is 0 or any positive value. 3242e5b6d6dSopenharmony_ci * @param zone, the vzone to use 3252e5b6d6dSopenharmony_ci * @param status Receives error status code. 3262e5b6d6dSopenharmony_ci * @return The number of <code>TimeZoneRule</code>s representing time transitions. 3272e5b6d6dSopenharmony_ci */ 3282e5b6d6dSopenharmony_ciU_CAPI int32_t U_EXPORT2 3292e5b6d6dSopenharmony_civzone_countTransitionRules(VZone* zone, UErrorCode& status); 3302e5b6d6dSopenharmony_ci 3312e5b6d6dSopenharmony_ci/** 3322e5b6d6dSopenharmony_ci * Return the class ID for this class. This is useful only for comparing to 3332e5b6d6dSopenharmony_ci * a return value from getDynamicClassID(). For example: 3342e5b6d6dSopenharmony_ci * <pre> 3352e5b6d6dSopenharmony_ci * . Base* polymorphic_pointer = createPolymorphicObject(); 3362e5b6d6dSopenharmony_ci * . if (polymorphic_pointer->getDynamicClassID() == 3372e5b6d6dSopenharmony_ci * . erived::getStaticClassID()) ... 3382e5b6d6dSopenharmony_ci * </pre> 3392e5b6d6dSopenharmony_ci * @param zone, the vzone to use 3402e5b6d6dSopenharmony_ci * @return The class ID for all objects of this class. 3412e5b6d6dSopenharmony_ci */ 3422e5b6d6dSopenharmony_ciU_CAPI UClassID U_EXPORT2 3432e5b6d6dSopenharmony_civzone_getStaticClassID(VZone* zone); 3442e5b6d6dSopenharmony_ci 3452e5b6d6dSopenharmony_ci/** 3462e5b6d6dSopenharmony_ci * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This 3472e5b6d6dSopenharmony_ci * method is to implement a simple version of RTTI, since not all C++ 3482e5b6d6dSopenharmony_ci * compilers support genuine RTTI. Polymorphic operator==() and clone() 3492e5b6d6dSopenharmony_ci * methods call this method. 3502e5b6d6dSopenharmony_ci * 3512e5b6d6dSopenharmony_ci * @param zone, the vzone to use 3522e5b6d6dSopenharmony_ci * @return The class ID for this object. All objects of a 3532e5b6d6dSopenharmony_ci * given class have the same class ID. Objects of 3542e5b6d6dSopenharmony_ci * other classes have different class IDs. 3552e5b6d6dSopenharmony_ci */ 3562e5b6d6dSopenharmony_ciU_CAPI UClassID U_EXPORT2 3572e5b6d6dSopenharmony_civzone_getDynamicClassID(VZone* zone); 3582e5b6d6dSopenharmony_ci 3592e5b6d6dSopenharmony_ci#endif // __VZONE_H 3602e5b6d6dSopenharmony_ci 3612e5b6d6dSopenharmony_ci#endif 362