1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ********************************************************************************
3fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius *   Copyright (C) 1997-2014, International Business Machines
4b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   Corporation and others.  All Rights Reserved.
5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ********************************************************************************
6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * File DATEFMT.H
8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
9b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Modification History:
10b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
11b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   Date        Name        Description
12b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   02/19/97    aliu        Converted from java.
13b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   04/01/97    aliu        Added support for centuries.
14b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   07/23/98    stephen     JDK 1.2 sync
15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   11/15/99    weiv        Added support for week of year/day of week formatting
16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru ********************************************************************************
17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
19b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef DATEFMT_H
20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define DATEFMT_H
21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/utypes.h"
23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#if !UCONFIG_NO_FORMATTING
25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/udat.h"
27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/calendar.h"
28b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/numfmt.h"
29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/format.h"
30b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/locid.h"
3159d709d503bab6e2b61931737e662dd293b40578ccornelius#include "unicode/enumset.h"
32fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#include "unicode/udisplaycontext.h"
33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
3550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \file
36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \brief C++ API: Abstract class for converting dates.
37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
39b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_NAMESPACE_BEGIN
40b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
41b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruclass TimeZone;
42b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queruclass DateTimePatternGenerator;
43b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
4459d709d503bab6e2b61931737e662dd293b40578ccornelius// explicit template instantiation. see digitlst.h
4559d709d503bab6e2b61931737e662dd293b40578ccornelius#if defined (_MSC_VER)
4659d709d503bab6e2b61931737e662dd293b40578ccorneliustemplate class U_I18N_API EnumSet<UDateFormatBooleanAttribute,
4759d709d503bab6e2b61931737e662dd293b40578ccornelius            0,
4859d709d503bab6e2b61931737e662dd293b40578ccornelius            UDAT_BOOLEAN_ATTRIBUTE_COUNT>;
4959d709d503bab6e2b61931737e662dd293b40578ccornelius#endif
5059d709d503bab6e2b61931737e662dd293b40578ccornelius
51b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
52b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * DateFormat is an abstract class for a family of classes that convert dates and
53b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * times from their internal representations to textual form and back again in a
54b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * language-independent manner. Converting from the internal representation (milliseconds
55b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * since midnight, January 1, 1970) to text is known as "formatting," and converting
56b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * from text to millis is known as "parsing."  We currently define only one concrete
57b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * subclass of DateFormat: SimpleDateFormat, which can handle pretty much all normal
58b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * date formatting and parsing actions.
59b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <P>
60b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * DateFormat helps you to format and parse dates for any locale. Your code can
61b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * be completely independent of the locale conventions for months, days of the
62b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * week, or even the calendar format: lunar vs. solar.
63b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <P>
64b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * To format a date for the current Locale, use one of the static factory
65b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * methods:
66b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre>
67b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code
68b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      DateFormat* dfmt = DateFormat::createDateInstance();
69b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      UDate myDate = Calendar::getNow();
70b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      UnicodeString myString;
71b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      myString = dfmt->format( myDate, myString );
72b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode
73b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre>
74b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If you are formatting multiple numbers, it is more efficient to get the
75b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * format and use it multiple times so that the system doesn't have to fetch the
76b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * information about the local language and country conventions multiple times.
77b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre>
78b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code
79b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      DateFormat* df = DateFormat::createDateInstance();
80b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      UnicodeString myString;
81b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      UDate myDateArr[] = { 0.0, 100000000.0, 2000000000.0 }; // test values
82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      for (int32_t i = 0; i < 3; ++i) {
83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          myString.remove();
84b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          cout << df->format( myDateArr[i], myString ) << endl;
85b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      }
86b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode
87b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre>
88b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * To get specific fields of a date, you can use UFieldPosition to
89b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * get specific fields.
90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre>
91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code
92b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      DateFormat* dfmt = DateFormat::createDateInstance();
93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      FieldPosition pos(DateFormat::YEAR_FIELD);
94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      UnicodeString myString;
95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      myString = dfmt->format( myDate, myString );
96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      cout << myString << endl;
97b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      cout << pos.getBeginIndex() << "," << pos. getEndIndex() << endl;
98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode
99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre>
100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * To format a date for a different Locale, specify it in the call to
101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * createDateInstance().
102b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre>
103b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code
104b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *       DateFormat* df =
105b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *           DateFormat::createDateInstance( DateFormat::SHORT, Locale::getFrance());
106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode
107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre>
108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * You can use a DateFormat to parse also.
109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <pre>
110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \code
111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *       UErrorCode status = U_ZERO_ERROR;
112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *       UDate myDate = df->parse(myString, status);
113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \endcode
114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </pre>
115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Use createDateInstance() to produce the normal date format for that country.
116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * There are other static factory methods available. Use createTimeInstance()
117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to produce the normal time format for that country. Use createDateTimeInstance()
118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to produce a DateFormat that formats both date and time. You can pass in
119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * different options to these factory methods to control the length of the
120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * result; from SHORT to MEDIUM to LONG to FULL. The exact result depends on the
121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * locale, but generally:
122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <ul type=round>
123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   <li>   SHORT is completely numeric, such as 12/13/52 or 3:30pm
124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   <li>   MEDIUM is longer, such as Jan 12, 1952
125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   <li>   LONG is longer, such as January 12, 1952 or 3:30:32pm
126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   <li>   FULL is pretty completely specified, such as
127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          Tuesday, April 12, 1952 AD or 3:30:42pm PST.
128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </ul>
129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * You can also set the time zone on the format if you wish. If you want even
130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * more control over the format or parsing, (or want to give your users more
131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * control), you can try casting the DateFormat you get from the factory methods
132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to a SimpleDateFormat. This will work for the majority of countries; just
133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * remember to chck getDynamicClassID() before carrying out the cast.
134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <P>
135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * You can also use forms of the parse and format methods with ParsePosition and
136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * FieldPosition to allow you to
137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <ul type=round>
138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   <li>   Progressively parse through pieces of a string.
139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *   <li>   Align any particular field, or find out where it is for selection
140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          on the screen.
141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * </ul>
142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <p><em>User subclasses are not supported.</em> While clients may write
144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * subclasses, such code will not necessarily work and will not be
145b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * guaranteed to work stably from release to release.
146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruclass U_I18N_API DateFormat : public Format {
148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querupublic:
149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Constants for various style patterns. These reflect the order of items in
152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the DateTimePatterns resource. There are 4 time patterns, 4 date patterns,
15350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * the default date-time pattern, and 4 date-time patterns. Each block of 4 values
154b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     * in the resource occurs in the order full, long, medium, short.
155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.4
156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    enum EStyle
158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    {
159b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kNone   = -1,
160b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
161b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kFull   = 0,
162b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kLong   = 1,
163b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kMedium = 2,
164b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kShort  = 3,
165b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
166b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDateOffset   = kShort + 1,
167b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     // kFull   + kDateOffset = 4
168b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     // kLong   + kDateOffset = 5
169b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     // kMedium + kDateOffset = 6
170b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     // kShort  + kDateOffset = 7
171b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
172b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDateTime             = 8,
173b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     // Default DateTime
174b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru
175b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru        kDateTimeOffset = kDateTime + 1,
176b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     // kFull   + kDateTimeOffset = 9
177b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     // kLong   + kDateTimeOffset = 10
178b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     // kMedium + kDateTimeOffset = 11
179b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     // kShort  + kDateTimeOffset = 12
180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        // relative dates
182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kRelative = (1 << 7),
18350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kFullRelative = (kFull | kRelative),
18550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kLongRelative = kLong | kRelative,
18750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kMediumRelative = kMedium | kRelative,
18950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kShortRelative = kShort | kRelative,
19150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDefault      = kMedium,
194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * These constants are provided for backwards compatibility only.
199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Please use the C++ style constants defined above.
200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
201b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        FULL        = kFull,
202b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        LONG        = kLong,
203b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        MEDIUM        = kMedium,
204b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        SHORT        = kShort,
205b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DEFAULT        = kDefault,
206b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DATE_OFFSET    = kDateOffset,
207b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        NONE        = kNone,
208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DATE_TIME    = kDateTime
209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    };
210b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
211b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Destructor.
213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual ~DateFormat();
216b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
217b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
218b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Equality operator.  Returns true if the two formats have the same behavior.
219b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
220b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
221b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual UBool operator==(const Format&) const;
222b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
22350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
22450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    using Format::format;
22550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
226b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
227b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Format an object to produce a string. This method handles Formattable
228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * objects with a UDate type. If a the Formattable object type is not a Date,
229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * then it returns a failing UErrorCode.
230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param obj       The object to format. Must be a Date.
232b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param appendTo  Output parameter to receive result.
233b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  Result is appended to existing contents.
234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param pos       On input: an alignment field, if desired.
235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  On output: the offsets of the alignment field.
236b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param status    Output param filled with success/failure status.
237b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return          Reference to 'appendTo' parameter.
238b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual UnicodeString& format(const Formattable& obj,
241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                  UnicodeString& appendTo,
242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                  FieldPosition& pos,
243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                  UErrorCode& status) const;
244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
245b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
24650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * Format an object to produce a string. This method handles Formattable
24750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * objects with a UDate type. If a the Formattable object type is not a Date,
24850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * then it returns a failing UErrorCode.
24950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *
25050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param obj       The object to format. Must be a Date.
25150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param appendTo  Output parameter to receive result.
25250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  Result is appended to existing contents.
25350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param posIter   On return, can be used to iterate over positions
25450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  of fields generated by this format call.  Field values
25550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  are defined in UDateFormatField.  Can be NULL.
25650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param status    Output param filled with success/failure status.
25750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @return          Reference to 'appendTo' parameter.
25827f654740f2a26ad62a5c155af9199af9e69b889claireho     * @stable ICU 4.4
25950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     */
26050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    virtual UnicodeString& format(const Formattable& obj,
26150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                                  UnicodeString& appendTo,
26250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                                  FieldPositionIterator* posIter,
26350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                                  UErrorCode& status) const;
26450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    /**
265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Formats a date into a date/time string. This is an abstract method which
266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * concrete subclasses must implement.
267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * On input, the FieldPosition parameter may have its "field" member filled with
269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * an enum value specifying a field.  On output, the FieldPosition will be filled
270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * in with the text offsets for that field.
271b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P> For example, given a time text
272b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
275b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P> Notice
276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * that if the same time field appears more than once in a pattern, the status will
277b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * be set for the first occurence of that time field. For instance,
278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * formatting a UDate to the time string "1 PM PDT (Pacific Daylight Time)"
279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * using the pattern "h a z (zzzz)" and the alignment field
280b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * DateFormat::TIMEZONE_FIELD, the offsets fieldPosition.beginIndex and
281b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * fieldPosition.getEndIndex will be set to 5 and 8, respectively, for the first
282b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * occurence of the timezone pattern character 'z'.
283b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
284b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param cal           Calendar set to the date and time to be formatted
285b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                      into a date/time string.  When the calendar type is
286b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                      different from the internal calendar held by this
287b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                      DateFormat instance, the date and the time zone will
288b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                      be inherited from the input calendar, but other calendar
289b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                      field values will be calculated by the internal calendar.
290b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param appendTo      Output parameter to receive result.
291b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                      Result is appended to existing contents.
292b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param fieldPosition On input: an alignment field, if desired (see examples above)
293b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                      On output: the offsets of the alignment field (see examples above)
294b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return              Reference to 'appendTo' parameter.
295b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.1
296b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
297b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual UnicodeString& format(  Calendar& cal,
298b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                    UnicodeString& appendTo,
299b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                    FieldPosition& fieldPosition) const = 0;
300b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
301b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
30250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * Formats a date into a date/time string. Subclasses should implement this method.
30350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *
30450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param cal       Calendar set to the date and time to be formatted
30550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  into a date/time string.  When the calendar type is
30650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  different from the internal calendar held by this
30750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  DateFormat instance, the date and the time zone will
30850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  be inherited from the input calendar, but other calendar
30950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  field values will be calculated by the internal calendar.
31050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param appendTo  Output parameter to receive result.
31150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  Result is appended to existing contents.
31250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param posIter   On return, can be used to iterate over positions
31350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  of fields generated by this format call.  Field values
31450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  are defined in UDateFormatField.  Can be NULL.
31550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param status    error status.
31650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @return          Reference to 'appendTo' parameter.
31727f654740f2a26ad62a5c155af9199af9e69b889claireho     * @stable ICU 4.4
31850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     */
31950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    virtual UnicodeString& format(Calendar& cal,
32050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                                  UnicodeString& appendTo,
32150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                                  FieldPositionIterator* posIter,
32250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                                  UErrorCode& status) const;
32350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    /**
324b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Formats a UDate into a date/time string.
325b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
326b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * On input, the FieldPosition parameter may have its "field" member filled with
327b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * an enum value specifying a field.  On output, the FieldPosition will be filled
328b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * in with the text offsets for that field.
329b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P> For example, given a time text
330b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * "1996.07.10 AD at 15:08:56 PDT", if the given fieldPosition.field is
331b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * UDAT_YEAR_FIELD, the offsets fieldPosition.beginIndex and
332b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * statfieldPositionus.getEndIndex will be set to 0 and 4, respectively.
333b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P> Notice
334b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * that if the same time field appears more than once in a pattern, the status will
335b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * be set for the first occurence of that time field. For instance,
336b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * formatting a UDate to the time string "1 PM PDT (Pacific Daylight Time)"
337b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * using the pattern "h a z (zzzz)" and the alignment field
338b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * DateFormat::TIMEZONE_FIELD, the offsets fieldPosition.beginIndex and
339b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * fieldPosition.getEndIndex will be set to 5 and 8, respectively, for the first
340b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * occurence of the timezone pattern character 'z'.
341b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
342b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param date          UDate to be formatted into a date/time string.
343b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param appendTo      Output parameter to receive result.
344b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                      Result is appended to existing contents.
345b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param fieldPosition On input: an alignment field, if desired (see examples above)
346b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                      On output: the offsets of the alignment field (see examples above)
347b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return              Reference to 'appendTo' parameter.
348b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
349b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
350b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    UnicodeString& format(  UDate date,
351b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                            UnicodeString& appendTo,
352b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                            FieldPosition& fieldPosition) const;
353b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
354b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
35550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * Formats a UDate into a date/time string.
35650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *
35750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param date      UDate to be formatted into a date/time string.
35850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param appendTo  Output parameter to receive result.
35950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  Result is appended to existing contents.
36050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param posIter   On return, can be used to iterate over positions
36150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  of fields generated by this format call.  Field values
36250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     *                  are defined in UDateFormatField.  Can be NULL.
36350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @param status    error status.
36450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     * @return          Reference to 'appendTo' parameter.
36527f654740f2a26ad62a5c155af9199af9e69b889claireho     * @stable ICU 4.4
36650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho     */
36750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    UnicodeString& format(UDate date,
36850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                          UnicodeString& appendTo,
36950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                          FieldPositionIterator* posIter,
37050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho                          UErrorCode& status) const;
37150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho    /**
372b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Formats a UDate into a date/time string. If there is a problem, you won't
373b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * know, using this method. Use the overloaded format() method which takes a
374b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * FieldPosition& to detect formatting problems.
375b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
376b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param date      The UDate value to be formatted into a string.
377b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param appendTo  Output parameter to receive result.
378b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  Result is appended to existing contents.
379b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return          Reference to 'appendTo' parameter.
380b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
381b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
382b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    UnicodeString& format(UDate date, UnicodeString& appendTo) const;
383b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
384b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
385103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * Parse a date/time string. For example, a time text "07/10/96 4:5 PM, PDT"
386103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * will be parsed into a UDate that is equivalent to Date(837039928046).
387103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * Parsing begins at the beginning of the string and proceeds as far as
388103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * possible.  Assuming no parse errors were encountered, this function
389103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * doesn't return any information about how much of the string was consumed
390103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * by the parsing.  If you need that information, use the version of
391103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * parse() that takes a ParsePosition.
392103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * <P>
393103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * By default, parsing is lenient: If the input is not in the form used by
394103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * this object's format method but can still be parsed as a date, then the
395103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * parse succeeds. Clients may insist on strict adherence to the format by
396103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * calling setLenient(false).
397103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @see DateFormat::setLenient(boolean)
398103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * <P>
399103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * Note that the normal date formats associated with some calendars - such
400103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * as the Chinese lunar calendar - do not specify enough fields to enable
401103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * dates to be parsed unambiguously. In the case of the Chinese lunar
402103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * calendar, while the year within the current 60-year cycle is specified,
403103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * the number of such cycles since the start date of the calendar (in the
404103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * ERA field of the Calendar object) is not normally part of the format,
405103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * and parsing may assume the wrong era. For cases such as this it is
406103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * recommended that clients parse using the method
407103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * parse(const UnicodeString&, Calendar& cal, ParsePosition&)
408103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * with the Calendar passed in set to the current date, or to a date
409103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * within the era/cycle that should be assumed if absent in the format.
410b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
411103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @param text      The date/time string to be parsed into a UDate value.
412b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param status    Output param to be set to success/failure code. If
413b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  'text' cannot be parsed, it will be set to a failure
414b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  code.
415103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @return          The parsed UDate value, if successful.
416b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
417b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
418b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual UDate parse( const UnicodeString& text,
419b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        UErrorCode& status) const;
420b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
421b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
422b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Parse a date/time string beginning at the given parse position. For
423b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
424b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * that is equivalent to Date(837039928046).
425b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
426b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * By default, parsing is lenient: If the input is not in the form used by
427b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * this object's format method but can still be parsed as a date, then the
428b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * parse succeeds. Clients may insist on strict adherence to the format by
429b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * calling setLenient(false).
430b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @see DateFormat::setLenient(boolean)
431b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
432103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @param text  The date/time string to be parsed.
433103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @param cal   A Calendar set on input to the date and time to be used for
434103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              missing values in the date/time string being parsed, and set
435103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              on output to the parsed date/time. When the calendar type is
436103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              different from the internal calendar held by this DateFormat
437103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              instance, the internal calendar will be cloned to a work
438103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              calendar set to the same milliseconds and time zone as the
439103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              cal parameter, field values will be parsed based on the work
440103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              calendar, then the result (milliseconds and time zone) will
441103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *              be set in this calendar.
442b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param pos   On input, the position at which to start parsing; on
443b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *              output, the position at which parsing terminated, or the
444b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *              start position if the parse failed.
445b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.1
446b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
447b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void parse( const UnicodeString& text,
448b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        Calendar& cal,
449b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        ParsePosition& pos) const = 0;
450b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
451b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
452b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Parse a date/time string beginning at the given parse position. For
453b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * example, a time text "07/10/96 4:5 PM, PDT" will be parsed into a Date
454b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * that is equivalent to Date(837039928046).
455b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
456b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * By default, parsing is lenient: If the input is not in the form used by
457b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * this object's format method but can still be parsed as a date, then the
458b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * parse succeeds. Clients may insist on strict adherence to the format by
459b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * calling setLenient(false).
460b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @see DateFormat::setLenient(boolean)
461103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * <P>
462103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * Note that the normal date formats associated with some calendars - such
463103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * as the Chinese lunar calendar - do not specify enough fields to enable
464103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * dates to be parsed unambiguously. In the case of the Chinese lunar
465103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * calendar, while the year within the current 60-year cycle is specified,
466103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * the number of such cycles since the start date of the calendar (in the
467103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * ERA field of the Calendar object) is not normally part of the format,
468103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * and parsing may assume the wrong era. For cases such as this it is
469103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * recommended that clients parse using the method
470103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * parse(const UnicodeString&, Calendar& cal, ParsePosition&)
471103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * with the Calendar passed in set to the current date, or to a date
472103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * within the era/cycle that should be assumed if absent in the format.
473b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
474103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @param text  The date/time string to be parsed into a UDate value.
475b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param pos   On input, the position at which to start parsing; on
476b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *              output, the position at which parsing terminated, or the
477b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *              start position if the parse failed.
478b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return      A valid UDate if the input could be parsed.
479b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
480b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
481b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    UDate parse( const UnicodeString& text,
482b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                 ParsePosition& pos) const;
483b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
484b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
485b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Parse a string to produce an object. This methods handles parsing of
486b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * date/time strings into Formattable objects with UDate types.
487b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
488b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Before calling, set parse_pos.index to the offset you want to start
489b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * parsing at in the source. After calling, parse_pos.index is the end of
490b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the text you parsed. If error occurs, index is unchanged.
491b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
492b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * When parsing, leading whitespace is discarded (with a successful parse),
493b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * while trailing whitespace is left as is.
494b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * <P>
495b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * See Format::parseObject() for more.
496b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
497b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param source    The string to be parsed into an object.
498b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param result    Formattable to be set to the parse result.
499b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  If parse fails, return contents are undefined.
500b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param parse_pos The position to start parsing at. Upon return
501b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  this param is set to the position after the
502b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  last character successfully parsed. If the
503b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  source is not parsed successfully, this param
504b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *                  will remain unchanged.
505b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
506b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
507b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void parseObject(const UnicodeString& source,
508b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                             Formattable& result,
509b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                             ParsePosition& parse_pos) const;
510b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
511b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
512b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Create a default date/time formatter that uses the SHORT style for both
513b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the date and the time.
514b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
515b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return A date/time formatter which the caller owns.
516b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
517b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
518b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static DateFormat* U_EXPORT2 createInstance(void);
519b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
520b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
521b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Creates a time formatter with the given formatting style for the given
522b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * locale.
523b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
524b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param style     The given formatting style. For example,
525b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                  SHORT for "h:mm a" in the US locale. Relative
526b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                  time styles are not currently supported.
527b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param aLocale   The given locale.
528b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return          A time formatter which the caller owns.
529b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
530b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
531b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static DateFormat* U_EXPORT2 createTimeInstance(EStyle style = kDefault,
532b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                          const Locale& aLocale = Locale::getDefault());
533b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
534b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
535b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Creates a date formatter with the given formatting style for the given
536b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * const locale.
537b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
538103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     * @param style     The given formatting style. For example, SHORT for "M/d/yy" in the
539103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  US locale. As currently implemented, relative date formatting only
540103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  affects a limited range of calendar days before or after the
541103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  current date, based on the CLDR &lt;field type="day"&gt;/&lt;relative&gt; data:
542103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  For example, in English, "Yesterday", "Today", and "Tomorrow".
543103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  Outside of this range, dates are formatted using the corresponding
544103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  non-relative style.
545b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param aLocale   The given locale.
546b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return          A date formatter which the caller owns.
547b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
548b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
549b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static DateFormat* U_EXPORT2 createDateInstance(EStyle style = kDefault,
550b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                          const Locale& aLocale = Locale::getDefault());
551b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
552b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
553b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Creates a date/time formatter with the given formatting styles for the
554b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * given locale.
555b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
556b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param dateStyle The given formatting style for the date portion of the result.
557103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  For example, SHORT for "M/d/yy" in the US locale. As currently
558103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  implemented, relative date formatting only affects a limited range
559103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  of calendar days before or after the current date, based on the
560103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  CLDR &lt;field type="day"&gt;/&lt;relative&gt; data: For example, in English,
561103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  "Yesterday", "Today", and "Tomorrow". Outside of this range, dates
562103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius     *                  are formatted using the corresponding non-relative style.
563b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param timeStyle The given formatting style for the time portion of the result.
564b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                  For example, SHORT for "h:mm a" in the US locale. Relative
565b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru     *                  time styles are not currently supported.
566b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param aLocale   The given locale.
567b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return          A date/time formatter which the caller owns.
568b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
569b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
570b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static DateFormat* U_EXPORT2 createDateTimeInstance(EStyle dateStyle = kDefault,
571b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                              EStyle timeStyle = kDefault,
572b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                                              const Locale& aLocale = Locale::getDefault());
573b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
574b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
575b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Gets the set of locales for which DateFormats are installed.
576b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param count Filled in with the number of locales in the list that is returned.
577b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return the set of locales for which DateFormats are installed.  The caller
578b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *  does NOT own this list and must not delete it.
579b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
580b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
581b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    static const Locale* U_EXPORT2 getAvailableLocales(int32_t& count);
582b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
583b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
584fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Returns whether both date/time parsing in the encapsulated Calendar object and DateFormat whitespace &
585fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * numeric processing is lenient.
586b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
587b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
588b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual UBool isLenient(void) const;
589b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
590b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
591fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Specifies whether date/time parsing is to be lenient.  With
592fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * lenient parsing, the parser may use heuristics to interpret inputs that
593fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * do not precisely match this object's format.  Without lenient parsing,
594fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * inputs must match this object's format more closely.
595fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     *
596fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Note: ICU 53 introduced finer grained control of leniency (and added
597fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * new control points) making the preferred method a combination of
598fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * setCalendarLenient() & setBooleanAttribute() calls.
599fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * This method supports prior functionality but may not support all
600fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * future leniency control & behavior of DateFormat. For control of pre 53 leniency,
601fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Calendar and DateFormat whitespace & numeric tolerance, this method is safe to
602fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * use. However, mixing leniency control via this method and modification of the
603fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * newer attributes via setBooleanAttribute() may produce undesirable
604fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * results.
60559d709d503bab6e2b61931737e662dd293b40578ccornelius     *
606b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param lenient  True specifies date/time interpretation to be lenient.
607b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @see Calendar::setLenient
608fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @stable ICU 2.0
609b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
610b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void setLenient(UBool lenient);
611b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
612fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
613fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */
614fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /**
615fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Returns whether date/time parsing in the encapsulated Calendar object processing is lenient.
616fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @draft ICU 53
617fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     */
618fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    virtual UBool isCalendarLenient(void) const;
619fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
620fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
621fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */
622fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /**
623fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Specifies whether encapsulated Calendar date/time parsing is to be lenient.  With
624fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * lenient parsing, the parser may use heuristics to interpret inputs that
625fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * do not precisely match this object's format.  Without lenient parsing,
626fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * inputs must match this object's format more closely.
627fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @param lenient when true, parsing is lenient
628fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @see com.ibm.icu.util.Calendar#setLenient
629fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @draft ICU 53
630fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     */
631fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    virtual void setCalendarLenient(UBool lenient);
632fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
633fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
634b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
635b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Gets the calendar associated with this date/time formatter.
636fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * The calendar is owned by the formatter and must not be modified.
637fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Also, the calendar does not reflect the results of a parse operation.
638fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * To parse to a calendar, use {@link #parse(const UnicodeString&, Calendar& cal, ParsePosition&) const parse(const UnicodeString&, Calendar& cal, ParsePosition&)}
639b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return the calendar associated with this date/time formatter.
640b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
641b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
642b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual const Calendar* getCalendar(void) const;
643b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
644b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
645b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Set the calendar to be used by this date format. Initially, the default
646b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * calendar for the specified or default locale is used.  The caller should
647b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * not delete the Calendar object after it is adopted by this call.
648b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Adopting a new calendar will change to the default symbols.
649b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
650b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param calendarToAdopt    Calendar object to be adopted.
651b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
652b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
653b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void adoptCalendar(Calendar* calendarToAdopt);
654b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
655b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
656b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Set the calendar to be used by this date format. Initially, the default
657b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * calendar for the specified or default locale is used.
658b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     *
659b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param newCalendar Calendar object to be set.
660b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
661b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
662b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void setCalendar(const Calendar& newCalendar);
663b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
664b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
665b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
666b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Gets the number formatter which this date/time formatter uses to format
667b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * and parse the numeric portions of the pattern.
668b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return the number formatter which this date/time formatter uses.
669b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
670b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
671b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual const NumberFormat* getNumberFormat(void) const;
672b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
673b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
674b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Allows you to set the number formatter.  The caller should
675b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * not delete the NumberFormat object after it is adopted by this call.
676b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param formatToAdopt     NumberFormat object to be adopted.
677b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
678b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
679b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void adoptNumberFormat(NumberFormat* formatToAdopt);
680b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
681b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
682b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Allows you to set the number formatter.
683b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param newNumberFormat  NumberFormat object to be set.
684b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
685b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
686b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void setNumberFormat(const NumberFormat& newNumberFormat);
687b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
688b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
689b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Returns a reference to the TimeZone used by this DateFormat's calendar.
690b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return the time zone associated with the calendar of DateFormat.
691b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
692b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
693b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual const TimeZone& getTimeZone(void) const;
694b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
695b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
696b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Sets the time zone for the calendar of this DateFormat object. The caller
697b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * no longer owns the TimeZone object and should not delete it after this call.
698b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param zoneToAdopt the TimeZone to be adopted.
699b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
700b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
701b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void adoptTimeZone(TimeZone* zoneToAdopt);
702b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
703b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
704b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Sets the time zone for the calendar of this DateFormat object.
705b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param zone the new time zone.
706b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
707b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
708b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    virtual void setTimeZone(const TimeZone& zone);
709b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
710fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */
711fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /**
712fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Set a particular UDisplayContext value in the formatter, such as
713fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * UDISPCTX_CAPITALIZATION_FOR_STANDALONE.
714fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @param value The UDisplayContext value to set.
715fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @param status Input/output status. If at entry this indicates a failure
716fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     *               status, the function will do nothing; otherwise this will be
717fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     *               updated with any new status from the function.
718fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @draft ICU 53
719fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     */
720fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    virtual void setContext(UDisplayContext value, UErrorCode& status);
721fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
722fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */
723fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /**
724fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Get the formatter's UDisplayContext value for the specified UDisplayContextType,
725fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * such as UDISPCTX_TYPE_CAPITALIZATION.
726fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @param type The UDisplayContextType whose value to return
727fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @param status Input/output status. If at entry this indicates a failure
728fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     *               status, the function will do nothing; otherwise this will be
729fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     *               updated with any new status from the function.
730fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @return The UDisplayContextValue for the specified type.
731fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @draft ICU 53
732fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     */
733fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    virtual UDisplayContext getContext(UDisplayContextType type, UErrorCode& status) const;
734fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
735fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius   /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */
73659d709d503bab6e2b61931737e662dd293b40578ccornelius   /**
737fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Sets an boolean attribute on this DateFormat.
73859d709d503bab6e2b61931737e662dd293b40578ccornelius     * May return U_UNSUPPORTED_ERROR if this instance does not support
73959d709d503bab6e2b61931737e662dd293b40578ccornelius     * the specified attribute.
74059d709d503bab6e2b61931737e662dd293b40578ccornelius     * @param attr the attribute to set
74159d709d503bab6e2b61931737e662dd293b40578ccornelius     * @param newvalue new value
74259d709d503bab6e2b61931737e662dd293b40578ccornelius     * @param status the error type
74359d709d503bab6e2b61931737e662dd293b40578ccornelius     * @return *this - for chaining (example: format.setAttribute(...).setAttribute(...) )
744fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @draft ICU 53
74559d709d503bab6e2b61931737e662dd293b40578ccornelius     */
74659d709d503bab6e2b61931737e662dd293b40578ccornelius
74759d709d503bab6e2b61931737e662dd293b40578ccornelius    virtual DateFormat&  U_EXPORT2 setBooleanAttribute(UDateFormatBooleanAttribute attr,
74859d709d503bab6e2b61931737e662dd293b40578ccornelius    									UBool newvalue,
74959d709d503bab6e2b61931737e662dd293b40578ccornelius    									UErrorCode &status);
75059d709d503bab6e2b61931737e662dd293b40578ccornelius
751fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    /* Cannot use #ifndef U_HIDE_DRAFT_API for the following draft method since it is virtual */
75259d709d503bab6e2b61931737e662dd293b40578ccornelius    /**
753fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * Returns a boolean from this DateFormat
75459d709d503bab6e2b61931737e662dd293b40578ccornelius     * May return U_UNSUPPORTED_ERROR if this instance does not support
75559d709d503bab6e2b61931737e662dd293b40578ccornelius     * the specified attribute.
75659d709d503bab6e2b61931737e662dd293b40578ccornelius     * @param attr the attribute to set
75759d709d503bab6e2b61931737e662dd293b40578ccornelius     * @param status the error type
75859d709d503bab6e2b61931737e662dd293b40578ccornelius     * @return the attribute value. Undefined if there is an error.
759fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius     * @draft ICU 53
76059d709d503bab6e2b61931737e662dd293b40578ccornelius     */
76159d709d503bab6e2b61931737e662dd293b40578ccornelius    virtual UBool U_EXPORT2 getBooleanAttribute(UDateFormatBooleanAttribute attr, UErrorCode &status) const;
76259d709d503bab6e2b61931737e662dd293b40578ccornelius
763b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruprotected:
764b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
765b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Default constructor.  Creates a DateFormat with no Calendar or NumberFormat
766b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * associated with it.  This constructor depends on the subclasses to fill in
767b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * the calendar and numberFormat fields.
768b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
769b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
770b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    DateFormat();
771b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
772b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
773b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Copy constructor.
774b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
775b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
776b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    DateFormat(const DateFormat&);
777b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
778b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
779b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Default assignment operator.
780b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.0
781b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
782b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    DateFormat& operator=(const DateFormat&);
783b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
784b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
785b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * The calendar that DateFormat uses to produce the time field values needed
786b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * to implement date/time formatting. Subclasses should generally initialize
787b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * this to the default calendar for the locale associated with this DateFormat.
788b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.4
789b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
790b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    Calendar* fCalendar;
791b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
792b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
793b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * The number formatter that DateFormat uses to format numbers in dates and
794b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * times. Subclasses should generally initialize this to the default number
795b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * format for the locale associated with this DateFormat.
796b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.4
797b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
798b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    NumberFormat* fNumberFormat;
799b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
80059d709d503bab6e2b61931737e662dd293b40578ccornelius
801b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruprivate:
802b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
803b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Gets the date/time formatter with the given formatting styles for the
804b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * given locale.
805b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param dateStyle the given date formatting style.
806b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param timeStyle the given time formatting style.
807b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @param inLocale the given locale.
808b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @return a date/time formatter, or 0 on failure.
809b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
810b26ce3a7367e4ed2ee7ddddcdc3f3d3377a455c2claireho    static DateFormat* U_EXPORT2 create(EStyle timeStyle, EStyle dateStyle, const Locale& inLocale);
811b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
81259d709d503bab6e2b61931737e662dd293b40578ccornelius
81359d709d503bab6e2b61931737e662dd293b40578ccornelius    /**
81459d709d503bab6e2b61931737e662dd293b40578ccornelius     * enum set of active boolean attributes for this instance
81559d709d503bab6e2b61931737e662dd293b40578ccornelius     */
81659d709d503bab6e2b61931737e662dd293b40578ccornelius    EnumSet<UDateFormatBooleanAttribute, 0, UDAT_BOOLEAN_ATTRIBUTE_COUNT> fBoolFlags;
81759d709d503bab6e2b61931737e662dd293b40578ccornelius
81859d709d503bab6e2b61931737e662dd293b40578ccornelius
819fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius    UDisplayContext fCapitalizationContext;
820fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
821b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querupublic:
822103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_OBSOLETE_API
823b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
824b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Field selector for FieldPosition for DateFormat fields.
825b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @obsolete ICU 3.4 use UDateFormatField instead, since this API will be
826b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * removed in that release
827b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
828b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    enum EField
829b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    {
830b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        // Obsolete; use UDateFormatField instead
831b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kEraField = UDAT_ERA_FIELD,
832b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kYearField = UDAT_YEAR_FIELD,
833b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kMonthField = UDAT_MONTH_FIELD,
834b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDateField = UDAT_DATE_FIELD,
835b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kHourOfDay1Field = UDAT_HOUR_OF_DAY1_FIELD,
836b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kHourOfDay0Field = UDAT_HOUR_OF_DAY0_FIELD,
837b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kMinuteField = UDAT_MINUTE_FIELD,
838b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kSecondField = UDAT_SECOND_FIELD,
839b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kMillisecondField = UDAT_FRACTIONAL_SECOND_FIELD,
840b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDayOfWeekField = UDAT_DAY_OF_WEEK_FIELD,
841b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDayOfYearField = UDAT_DAY_OF_YEAR_FIELD,
842b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDayOfWeekInMonthField = UDAT_DAY_OF_WEEK_IN_MONTH_FIELD,
843b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kWeekOfYearField = UDAT_WEEK_OF_YEAR_FIELD,
844b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kWeekOfMonthField = UDAT_WEEK_OF_MONTH_FIELD,
845b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kAmPmField = UDAT_AM_PM_FIELD,
846b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kHour1Field = UDAT_HOUR1_FIELD,
847b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kHour0Field = UDAT_HOUR0_FIELD,
848b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kTimezoneField = UDAT_TIMEZONE_FIELD,
849b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kYearWOYField = UDAT_YEAR_WOY_FIELD,
850b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kDOWLocalField = UDAT_DOW_LOCAL_FIELD,
851b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kExtendedYearField = UDAT_EXTENDED_YEAR_FIELD,
852b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kJulianDayField = UDAT_JULIAN_DAY_FIELD,
853b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        kMillisecondsInDayField = UDAT_MILLISECONDS_IN_DAY_FIELD,
854b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
855b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        // Obsolete; use UDateFormatField instead
856b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        ERA_FIELD = UDAT_ERA_FIELD,
857b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        YEAR_FIELD = UDAT_YEAR_FIELD,
858b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        MONTH_FIELD = UDAT_MONTH_FIELD,
859b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DATE_FIELD = UDAT_DATE_FIELD,
860b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        HOUR_OF_DAY1_FIELD = UDAT_HOUR_OF_DAY1_FIELD,
861b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        HOUR_OF_DAY0_FIELD = UDAT_HOUR_OF_DAY0_FIELD,
862b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        MINUTE_FIELD = UDAT_MINUTE_FIELD,
863b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        SECOND_FIELD = UDAT_SECOND_FIELD,
864b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        MILLISECOND_FIELD = UDAT_FRACTIONAL_SECOND_FIELD,
865b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DAY_OF_WEEK_FIELD = UDAT_DAY_OF_WEEK_FIELD,
866b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DAY_OF_YEAR_FIELD = UDAT_DAY_OF_YEAR_FIELD,
867b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        DAY_OF_WEEK_IN_MONTH_FIELD = UDAT_DAY_OF_WEEK_IN_MONTH_FIELD,
868b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        WEEK_OF_YEAR_FIELD = UDAT_WEEK_OF_YEAR_FIELD,
869b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        WEEK_OF_MONTH_FIELD = UDAT_WEEK_OF_MONTH_FIELD,
870b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        AM_PM_FIELD = UDAT_AM_PM_FIELD,
871b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        HOUR1_FIELD = UDAT_HOUR1_FIELD,
872b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        HOUR0_FIELD = UDAT_HOUR0_FIELD,
873b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru        TIMEZONE_FIELD = UDAT_TIMEZONE_FIELD
874b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    };
875103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_OBSOLETE_API */
876b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru};
877b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
878b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_NAMESPACE_END
879b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
880b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_FORMATTING */
881b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
882b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif // _DATEFMT
883b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru//eof
884