+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
-* Copyright (C) 2007-2011, International Business Machines Corporation and *
+* Copyright (C) 2007-2016, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
#if !UCONFIG_NO_FORMATTING
#include "unicode/datefmt.h"
+#include "unicode/smpdtfmt.h"
+#include "unicode/brkiter.h"
U_NAMESPACE_BEGIN
// forward declarations
class DateFormatSymbols;
-class MessageFormat;
+class SimpleFormatter;
// internal structure used for caching strings
struct URelativeString;
*/
virtual const DateFormatSymbols* getDateFormatSymbols(void) const;
+ /**
+ * Set a particular UDisplayContext value in the formatter, such as
+ * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. Note: For getContext, see
+ * DateFormat.
+ * @param value The UDisplayContext value to set.
+ * @param status Input/output status. If at entry this indicates a failure
+ * status, the function will do nothing; otherwise this will be
+ * updated with any new status from the function.
+ * @internal ICU 53
+ */
+ virtual void setContext(UDisplayContext value, UErrorCode& status);
private:
- DateFormat *fDateFormat; // the held date format
- DateFormat *fTimeFormat; // the held time format
- MessageFormat *fCombinedFormat; // the {0} {1} format.
+ SimpleDateFormat *fDateTimeFormatter;
+ UnicodeString fDatePattern;
+ UnicodeString fTimePattern;
+ SimpleFormatter *fCombinedFormat; // the {0} {1} format.
UDateFormatStyle fDateStyle;
- UDateFormatStyle fTimeStyle;
Locale fLocale;
- int32_t fDayMin; // day id of lowest #
- int32_t fDayMax; // day id of highest #
int32_t fDatesLen; // Length of array
URelativeString *fDates; // array of strings
+ UBool fCombinedHasDateAtStart;
+ UBool fCapitalizationInfoSet;
+ UBool fCapitalizationOfRelativeUnitsForUIListMenu;
+ UBool fCapitalizationOfRelativeUnitsForStandAlone;
+#if !UCONFIG_NO_BREAK_ITERATION
+ BreakIterator* fCapitalizationBrkIter;
+#else
+ UObject* fCapitalizationBrkIter;
+#endif
/**
* Get the string at a specific offset.
*/
void loadDates(UErrorCode &status);
+ /**
+ * Set fCapitalizationOfRelativeUnitsForUIListMenu, fCapitalizationOfRelativeUnitsForStandAlone
+ */
+ void initCapitalizationContextInfo(const Locale& thelocale);
+
/**
* @return the number of days in "until-now"
*/
* @internal ICU 3.8
*/
virtual UClassID getDynamicClassID(void) const;
+
+ /**
+ * Apple addition
+ * This is for ICU internal use only. Please do not use.
+ * Get the capitalization break iterator of this relative date formatter.
+ * Should be cloned before using it.
+ * It is used in udat.
+ *
+ * @return capitalization break iterator
+ * @internal
+ */
+ BreakIterator* getCapitalizationBrkIter(void) const;
};
+inline BreakIterator*
+RelativeDateFormat::getCapitalizationBrkIter() const
+{
+ return fCapitalizationBrkIter;
+}
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif // RELDTFMT_H
-//eof