chromium/third_party/icu/source/i18n/unicode/udisplayoptions.h

// © 2022 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

#ifndef __UDISPLAYOPTIONS_H__
#define __UDISPLAYOPTIONS_H__

#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

/**
 * \file
 * \brief C API: Display options (enum types, values, helper functions)
 *
 * These display options are designed to be used in class DisplayOptions
 * as a more modern version of the UDisplayContext mechanism.
 */

#include "unicode/uversion.h"

/**
 * Represents all the grammatical cases that are supported by CLDR.
 *
 * @stable ICU 72
 */
UDisplayOptionsGrammaticalCase;

/**
 * @param grammaticalCase The grammatical case.
 * @return the lowercase CLDR keyword string for the grammatical case.
 *
 * @stable ICU 72
 */
U_CAPI const char * U_EXPORT2
udispopt_getGrammaticalCaseIdentifier(UDisplayOptionsGrammaticalCase grammaticalCase);

/**
 * @param identifier in lower case such as "dative" or "nominative"
 * @return the plural category corresponding to the identifier, or `UDISPOPT_GRAMMATICAL_CASE_UNDEFINED`
 *
 * @stable ICU 72
 */
U_CAPI UDisplayOptionsGrammaticalCase U_EXPORT2
udispopt_fromGrammaticalCaseIdentifier(const char *identifier);

/**
 * Standard CLDR plural form/category constants.
 * See https://www.unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules
 *
 * @stable ICU 72
 */
UDisplayOptionsPluralCategory;

/**
 * @param pluralCategory The plural category.
 * @return the lowercase CLDR identifier string for the plural category.
 *
 * @stable ICU 72
 */
U_CAPI const char * U_EXPORT2
udispopt_getPluralCategoryIdentifier(UDisplayOptionsPluralCategory pluralCategory);

/**
 * @param identifier for example "few" or "other"
 * @return the plural category corresponding to the identifier (plural keyword),
 *         or `UDISPOPT_PLURAL_CATEGORY_UNDEFINED`
 *
 * @stable ICU 72
 */
U_CAPI UDisplayOptionsPluralCategory U_EXPORT2
udispopt_fromPluralCategoryIdentifier(const char *identifier);

/**
 * Represents all the grammatical noun classes that are supported by CLDR.
 *
 * @stable ICU 72.
 */
UDisplayOptionsNounClass;

/**
 * @param nounClass The noun class.
 * @return the lowercase CLDR keyword string for the noun class.
 *
 * @stable ICU 72
 */
U_CAPI const char * U_EXPORT2
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`
 *
 * @stable ICU 72
 */
U_CAPI UDisplayOptionsNounClass U_EXPORT2
udispopt_fromNounClassIdentifier(const char *identifier);

/**
 * Represents all the capitalization options.
 *
 * @stable ICU 72
 */
UDisplayOptionsCapitalization;

/**
 * Represents all the dialect handlings.
 *
 * @stable ICU 72
 */
UDisplayOptionsNameStyle;

/**
 * Represents all the display lengths.
 *
 * @stable ICU 72
 */
UDisplayOptionsDisplayLength;

/**
 * Represents all the substitute handling.
 *
 * @stable ICU 72
 */
UDisplayOptionsSubstituteHandling;

#endif /* #if !UCONFIG_NO_FORMATTING */

#endif // __UDISPLAYOPTIONS_H__