Imported Upstream version 58.1
[platform/upstream/icu.git] / source / i18n / unicode / measfmt.h
index 57debd9..37b3314 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 **********************************************************************
 * Copyright (c) 2004-2016, International Business Machines
@@ -59,11 +61,13 @@ enum UMeasureFormatWidth {
      */
     UMEASFMT_WIDTH_NUMERIC,
 
+#ifndef U_HIDE_DEPRECATED_API
     /**
-     * Count of values in this enum.
-     * @stable ICU 53
+     * One more than the highest normal UMeasureFormatWidth value.
+     * @deprecated ICU 58 The numeric value may change over time, see ICU ticket #12420.
      */
     UMEASFMT_WIDTH_COUNT = 4
+#endif  // U_HIDE_DEPRECATED_API
 };
 /** @stable ICU 53 */
 typedef enum UMeasureFormatWidth UMeasureFormatWidth; 
@@ -206,6 +210,21 @@ class U_I18N_API MeasureFormat : public Format {
             FieldPosition &pos,
             UErrorCode &status) const;
 
+#ifndef U_HIDE_DRAFT_API
+    /**
+     * Gets the display name of the specified {@link MeasureUnit} corresponding to the current
+     * locale and format width.
+     * @param unit  The unit for which to get a display name.
+     * @param status the error.
+     * @return  The display name in the locale and width specified in
+     *          {@link MeasureFormat#getInstance}, or null if there is no display name available
+     *          for the specified unit.
+     *
+     * @draft ICU 58
+     */
+    UnicodeString getUnitDisplayName(const MeasureUnit& unit, UErrorCode &status) const;
+#endif /* U_HIDE_DRAFT_API */
+
 
     /**
      * Return a formatter for CurrencyAmount objects in the given