From b6a4eb8a654148627a9d92d29489d509acec4675 Mon Sep 17 00:00:00 2001 From: Rich Gillam Date: Tue, 5 Sep 2023 16:05:28 -0700 Subject: [PATCH] ICU-22325 Promoted all @draft ICU 72 APIs to @stable ICU 72. --- icu4c/source/i18n/unicode/displayoptions.h | 48 ++++---- icu4c/source/i18n/unicode/formattednumber.h | 6 +- icu4c/source/i18n/unicode/numberformatter.h | 6 +- icu4c/source/i18n/unicode/udisplayoptions.h | 120 ++++++++++---------- icu4c/source/i18n/unicode/unum.h | 4 +- 5 files changed, 84 insertions(+), 100 deletions(-) diff --git a/icu4c/source/i18n/unicode/displayoptions.h b/icu4c/source/i18n/unicode/displayoptions.h index 7bc763bbacd..9cc822626b5 100644 --- a/icu4c/source/i18n/unicode/displayoptions.h +++ b/icu4c/source/i18n/unicode/displayoptions.h @@ -22,8 +22,6 @@ U_NAMESPACE_BEGIN -#ifndef U_HIDE_DRAFT_API - /** * Represents all the display options that are supported by CLDR such as grammatical case, noun * class, ... etc. It currently supports enums, but may be extended in the future to have other @@ -40,14 +38,14 @@ U_NAMESPACE_BEGIN * .build(); * ``` * - * @draft ICU 72 + * @stable ICU 72 */ class U_I18N_API DisplayOptions { public: /** * Responsible for building `DisplayOptions`. * - * @draft ICU 72 + * @stable ICU 72 */ class U_I18N_API Builder { public: @@ -56,7 +54,7 @@ public: * * @param grammaticalCase The grammatical case. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setGrammaticalCase(UDisplayOptionsGrammaticalCase grammaticalCase) { this->grammaticalCase = grammaticalCase; @@ -68,7 +66,7 @@ public: * * @param nounClass The noun class. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setNounClass(UDisplayOptionsNounClass nounClass) { this->nounClass = nounClass; @@ -80,7 +78,7 @@ public: * * @param pluralCategory The plural category. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setPluralCategory(UDisplayOptionsPluralCategory pluralCategory) { this->pluralCategory = pluralCategory; @@ -92,7 +90,7 @@ public: * * @param capitalization The capitalization. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setCapitalization(UDisplayOptionsCapitalization capitalization) { this->capitalization = capitalization; @@ -104,7 +102,7 @@ public: * * @param nameStyle The name style. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setNameStyle(UDisplayOptionsNameStyle nameStyle) { this->nameStyle = nameStyle; @@ -116,7 +114,7 @@ public: * * @param displayLength The display length. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setDisplayLength(UDisplayOptionsDisplayLength displayLength) { this->displayLength = displayLength; @@ -128,7 +126,7 @@ public: * * @param substituteHandling The substitute handling. * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder &setSubstituteHandling(UDisplayOptionsSubstituteHandling substituteHandling) { this->substituteHandling = substituteHandling; @@ -139,7 +137,7 @@ public: * Builds the display options. * * @return DisplayOptions - * @draft ICU 72 + * @stable ICU 72 */ DisplayOptions build() { return DisplayOptions(*this); } @@ -162,21 +160,21 @@ public: * Creates a builder with the `UNDEFINED` values for all the parameters. * * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ static Builder builder(); /** * Creates a builder with the same parameters from this object. * * @return Builder - * @draft ICU 72 + * @stable ICU 72 */ Builder copyToBuilder() const; /** * Gets the grammatical case. * * @return UDisplayOptionsGrammaticalCase - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsGrammaticalCase getGrammaticalCase() const { return grammaticalCase; } @@ -184,7 +182,7 @@ public: * Gets the noun class. * * @return UDisplayOptionsNounClass - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsNounClass getNounClass() const { return nounClass; } @@ -192,7 +190,7 @@ public: * Gets the plural category. * * @return UDisplayOptionsPluralCategory - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsPluralCategory getPluralCategory() const { return pluralCategory; } @@ -200,7 +198,7 @@ public: * Gets the capitalization. * * @return UDisplayOptionsCapitalization - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsCapitalization getCapitalization() const { return capitalization; } @@ -208,7 +206,7 @@ public: * Gets the dialect handling. * * @return UDisplayOptionsNameStyle - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsNameStyle getNameStyle() const { return nameStyle; } @@ -216,7 +214,7 @@ public: * Gets the display length. * * @return UDisplayOptionsDisplayLength - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsDisplayLength getDisplayLength() const { return displayLength; } @@ -224,7 +222,7 @@ public: * Gets the substitute handling. * * @return UDisplayOptionsSubstituteHandling - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsSubstituteHandling getSubstituteHandling() const { return substituteHandling; } @@ -232,7 +230,7 @@ public: * Copies the DisplayOptions. * * @param other The options to copy. - * @draft ICU 72 + * @stable ICU 72 */ DisplayOptions &operator=(const DisplayOptions &other) = default; @@ -240,7 +238,7 @@ public: * Moves the DisplayOptions. * * @param other The options to move from. - * @draft ICU 72 + * @stable ICU 72 */ DisplayOptions &operator=(DisplayOptions &&other) noexcept = default; @@ -248,7 +246,7 @@ public: * Copies the DisplayOptions. * * @param other The options to copy. - * @draft ICU 72 + * @stable ICU 72 */ DisplayOptions(const DisplayOptions &other) = default; @@ -263,8 +261,6 @@ private: UDisplayOptionsSubstituteHandling substituteHandling; }; -#endif // U_HIDE_DRAFT_API - U_NAMESPACE_END #endif /* #if !UCONFIG_NO_FORMATTING */ diff --git a/icu4c/source/i18n/unicode/formattednumber.h b/icu4c/source/i18n/unicode/formattednumber.h index 198c9d84782..83178ea40ef 100644 --- a/icu4c/source/i18n/unicode/formattednumber.h +++ b/icu4c/source/i18n/unicode/formattednumber.h @@ -140,19 +140,15 @@ class U_I18N_API FormattedNumber : public UMemory, public FormattedValue { */ MeasureUnit getOutputUnit(UErrorCode& status) const; -#ifndef U_HIDE_DRAFT_API - /** * Gets the noun class of the formatted output. Returns `UNDEFINED` when the noun class * is not supported yet. * * @return UDisplayOptionsNounClass - * @draft ICU 72 + * @stable ICU 72 */ UDisplayOptionsNounClass getNounClass(UErrorCode &status) const; -#endif // U_HIDE_DRAFT_API - #ifndef U_HIDE_INTERNAL_API /** diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 56beb3692b9..069324a9ef3 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -2260,14 +2260,13 @@ class U_I18N_API NumberFormatterSettings { */ Derived usage(StringPiece usage) &&; -#ifndef U_HIDE_DRAFT_API /** * Specifies the DisplayOptions. For example, UDisplayOptionsGrammaticalCase specifies * the desired case for a unit formatter's output (e.g. accusative, dative, genitive). * * @param displayOptions * @return The fluent chain. - * @draft ICU 72 + * @stable ICU 72 */ Derived displayOptions(const DisplayOptions &displayOptions) const &; @@ -2276,10 +2275,9 @@ class U_I18N_API NumberFormatterSettings { * * @param displayOptions * @return The fluent chain. - * @draft ICU 72 + * @stable ICU 72 */ Derived displayOptions(const DisplayOptions &displayOptions) &&; -#endif // U_HIDE_DRAFT_API #ifndef U_HIDE_INTERNAL_API /** diff --git a/icu4c/source/i18n/unicode/udisplayoptions.h b/icu4c/source/i18n/unicode/udisplayoptions.h index 1ecdf1d8e94..490bc01cf39 100644 --- a/icu4c/source/i18n/unicode/udisplayoptions.h +++ b/icu4c/source/i18n/unicode/udisplayoptions.h @@ -18,47 +18,45 @@ #include "unicode/uversion.h" -#ifndef U_HIDE_DRAFT_API - /** * Represents all the grammatical cases that are supported by CLDR. * - * @draft ICU 72 + * @stable ICU 72 */ typedef enum UDisplayOptionsGrammaticalCase { /** * A possible setting for GrammaticalCase. * The grammatical case context to be used is unknown (this is the default value). - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_UNDEFINED = 0, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_ABLATIVE = 1, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_ACCUSATIVE = 2, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_COMITATIVE = 3, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_DATIVE = 4, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_ERGATIVE = 5, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_GENITIVE = 6, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_INSTRUMENTAL = 7, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_LOCATIVE = 8, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_LOCATIVE_COPULATIVE = 9, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_NOMINATIVE = 10, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_OBLIQUE = 11, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_PREPOSITIONAL = 12, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_SOCIATIVE = 13, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_GRAMMATICAL_CASE_VOCATIVE = 14, } UDisplayOptionsGrammaticalCase; @@ -66,7 +64,7 @@ typedef enum UDisplayOptionsGrammaticalCase { * @param grammaticalCase The grammatical case. * @return the lowercase CLDR keyword string for the grammatical case. * - * @draft ICU 72 + * @stable ICU 72 */ U_CAPI const char * U_EXPORT2 udispopt_getGrammaticalCaseIdentifier(UDisplayOptionsGrammaticalCase grammaticalCase); @@ -75,7 +73,7 @@ udispopt_getGrammaticalCaseIdentifier(UDisplayOptionsGrammaticalCase grammatical * @param identifier in lower case such as "dative" or "nominative" * @return the plural category corresponding to the identifier, or `UDISPOPT_GRAMMATICAL_CASE_UNDEFINED` * - * @draft ICU 72 + * @stable ICU 72 */ U_CAPI UDisplayOptionsGrammaticalCase U_EXPORT2 udispopt_fromGrammaticalCaseIdentifier(const char *identifier); @@ -84,7 +82,7 @@ udispopt_fromGrammaticalCaseIdentifier(const char *identifier); * Standard CLDR plural form/category constants. * See https://www.unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules * - * @draft ICU 72 + * @stable ICU 72 */ typedef enum UDisplayOptionsPluralCategory { @@ -92,20 +90,20 @@ typedef enum UDisplayOptionsPluralCategory { * A possible setting for PluralCategory. * The plural category case context to be used is unknown (this is the default value). * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_UNDEFINED = 0, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_ZERO = 1, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_ONE = 2, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_TWO = 3, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_FEW = 4, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_MANY = 5, - /** @draft ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_PLURAL_CATEGORY_OTHER = 6, } UDisplayOptionsPluralCategory; @@ -113,7 +111,7 @@ typedef enum UDisplayOptionsPluralCategory { * @param pluralCategory The plural category. * @return the lowercase CLDR identifier string for the plural category. * - * @draft ICU 72 + * @stable ICU 72 */ U_CAPI const char * U_EXPORT2 udispopt_getPluralCategoryIdentifier(UDisplayOptionsPluralCategory pluralCategory); @@ -123,7 +121,7 @@ udispopt_getPluralCategoryIdentifier(UDisplayOptionsPluralCategory pluralCategor * @return the plural category corresponding to the identifier (plural keyword), * or `UDISPOPT_PLURAL_CATEGORY_UNDEFINED` * - * @draft ICU 72 + * @stable ICU 72 */ U_CAPI UDisplayOptionsPluralCategory U_EXPORT2 udispopt_fromPluralCategoryIdentifier(const char *identifier); @@ -131,31 +129,31 @@ udispopt_fromPluralCategoryIdentifier(const char *identifier); /** * Represents all the grammatical noun classes that are supported by CLDR. * - * @draft ICU 72. + * @stable ICU 72. */ typedef enum UDisplayOptionsNounClass { /** * A possible setting for NounClass. * The noun class case context to be used is unknown (this is the default value). * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_NOUN_CLASS_UNDEFINED = 0, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_OTHER = 1, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_NEUTER = 2, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_FEMININE = 3, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_MASCULINE = 4, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_ANIMATE = 5, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_INANIMATE = 6, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_PERSONAL = 7, - /** ICU 72 */ + /** @stable ICU 72 */ UDISPOPT_NOUN_CLASS_COMMON = 8, } UDisplayOptionsNounClass; @@ -163,7 +161,7 @@ typedef enum UDisplayOptionsNounClass { * @param nounClass The noun class. * @return the lowercase CLDR keyword string for the noun class. * - * @draft ICU 72 + * @stable ICU 72 */ U_CAPI const char * U_EXPORT2 udispopt_getNounClassIdentifier(UDisplayOptionsNounClass nounClass); @@ -172,7 +170,7 @@ udispopt_getNounClassIdentifier(UDisplayOptionsNounClass nounClass); * @param identifier in lower case such as "feminine" or "masculine" * @return the plural category corresponding to the identifier, or `UDISPOPT_NOUN_CLASS_UNDEFINED` * - * @draft ICU 72 + * @stable ICU 72 */ U_CAPI UDisplayOptionsNounClass U_EXPORT2 udispopt_fromNounClassIdentifier(const char *identifier); @@ -180,14 +178,14 @@ udispopt_fromNounClassIdentifier(const char *identifier); /** * Represents all the capitalization options. * - * @draft ICU 72 + * @stable ICU 72 */ typedef enum UDisplayOptionsCapitalization { /** * A possible setting for Capitalization. * The capitalization context to be used is unknown (this is the default value). * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_CAPITALIZATION_UNDEFINED = 0, @@ -195,7 +193,7 @@ typedef enum UDisplayOptionsCapitalization { * The capitalization context if a date, date symbol or display name is to be * formatted with capitalization appropriate for the beginning of a sentence. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_CAPITALIZATION_BEGINNING_OF_SENTENCE = 1, @@ -203,7 +201,7 @@ typedef enum UDisplayOptionsCapitalization { * The capitalization context if a date, date symbol or display name is to be * formatted with capitalization appropriate for the middle of a sentence. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_CAPITALIZATION_MIDDLE_OF_SENTENCE = 2, @@ -212,7 +210,7 @@ typedef enum UDisplayOptionsCapitalization { * formatted with capitalization appropriate for stand-alone usage such as an * isolated name on a calendar page. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_CAPITALIZATION_STANDALONE = 3, @@ -220,7 +218,7 @@ typedef enum UDisplayOptionsCapitalization { * The capitalization context if a date, date symbol or display name is to be * formatted with capitalization appropriate for a user-interface list or menu item. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_CAPITALIZATION_UI_LIST_OR_MENU = 4, } UDisplayOptionsCapitalization; @@ -228,14 +226,14 @@ typedef enum UDisplayOptionsCapitalization { /** * Represents all the dialect handlings. * - * @draft ICU 72 + * @stable ICU 72 */ typedef enum UDisplayOptionsNameStyle { /** * A possible setting for NameStyle. * The NameStyle context to be used is unknown (this is the default value). * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_NAME_STYLE_UNDEFINED = 0, @@ -243,7 +241,7 @@ typedef enum UDisplayOptionsNameStyle { * Use standard names when generating a locale name, * e.g. en_GB displays as 'English (United Kingdom)'. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_NAME_STYLE_STANDARD_NAMES = 1, @@ -251,7 +249,7 @@ typedef enum UDisplayOptionsNameStyle { * Use dialect names, when generating a locale name, * e.g. en_GB displays as 'British English'. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_NAME_STYLE_DIALECT_NAMES = 2, } UDisplayOptionsNameStyle; @@ -259,14 +257,14 @@ typedef enum UDisplayOptionsNameStyle { /** * Represents all the display lengths. * - * @draft ICU 72 + * @stable ICU 72 */ typedef enum UDisplayOptionsDisplayLength { /** * A possible setting for DisplayLength. * The DisplayLength context to be used is unknown (this is the default value). * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_DISPLAY_LENGTH_UNDEFINED = 0, @@ -274,7 +272,7 @@ typedef enum UDisplayOptionsDisplayLength { * Uses full names when generating a locale name, * e.g. "United States" for US. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_DISPLAY_LENGTH_FULL = 1, @@ -282,7 +280,7 @@ typedef enum UDisplayOptionsDisplayLength { * Use short names when generating a locale name, * e.g. "U.S." for US. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_DISPLAY_LENGTH_SHORT = 2, } UDisplayOptionsDisplayLength; @@ -290,7 +288,7 @@ typedef enum UDisplayOptionsDisplayLength { /** * Represents all the substitute handling. * - * @draft ICU 72 + * @stable ICU 72 */ typedef enum UDisplayOptionsSubstituteHandling { @@ -298,7 +296,7 @@ typedef enum UDisplayOptionsSubstituteHandling { * A possible setting for SubstituteHandling. * The SubstituteHandling context to be used is unknown (this is the default value). * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_SUBSTITUTE_HANDLING_UNDEFINED = 0, @@ -306,20 +304,18 @@ typedef enum UDisplayOptionsSubstituteHandling { * Returns a fallback value (e.g., the input code) when no data is available. * This is the default behaviour. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_SUBSTITUTE_HANDLING_SUBSTITUTE = 1, /** * Returns a null value when no data is available. * - * @draft ICU 72 + * @stable ICU 72 */ UDISPOPT_SUBSTITUTE_HANDLING_NO_SUBSTITUTE = 2, } UDisplayOptionsSubstituteHandling; -#endif // U_HIDE_DRAFT_API - #endif /* #if !UCONFIG_NO_FORMATTING */ #endif // __UDISPLAYOPTIONS_H__ diff --git a/icu4c/source/i18n/unicode/unum.h b/icu4c/source/i18n/unicode/unum.h index 172ed08964b..2dd2badc1bd 100644 --- a/icu4c/source/i18n/unicode/unum.h +++ b/icu4c/source/i18n/unicode/unum.h @@ -1107,7 +1107,6 @@ typedef enum UNumberFormatAttribute { } UNumberFormatAttribute; -#ifndef U_HIDE_DRAFT_API /** * Returns true if the formatter supports the specified attribute and false if not. * @param fmt The formatter to query. @@ -1120,12 +1119,11 @@ typedef enum UNumberFormatAttribute { * @see unum_setDoubleAttribute * @see unum_getTextAttribute * @see unum_setTextAttribute -* @draft ICU 72 +* @stable ICU 72 */ U_CAPI bool U_EXPORT2 unum_hasAttribute(const UNumberFormat* fmt, UNumberFormatAttribute attr); -#endif // U_HIDE_DRAFT_API /** * Get a numeric attribute associated with a UNumberFormat.