displayoptions.h
Go to the documentation of this file.
// © 2022 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
#ifndef __DISPLAYOPTIONS_H__
#define __DISPLAYOPTIONS_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/udisplayoptions.h"
#include "unicode/uversion.h"
U_NAMESPACE_BEGIN
class U_I18N_API DisplayOptions {
public:
class U_I18N_API Builder {
public:
Builder &setGrammaticalCase(UDisplayOptionsGrammaticalCase grammaticalCase) {
this->grammaticalCase = grammaticalCase;
return *this;
}
Builder &setNounClass(UDisplayOptionsNounClass nounClass) {
this->nounClass = nounClass;
return *this;
}
Builder &setPluralCategory(UDisplayOptionsPluralCategory pluralCategory) {
this->pluralCategory = pluralCategory;
return *this;
}
Builder &setCapitalization(UDisplayOptionsCapitalization capitalization) {
this->capitalization = capitalization;
return *this;
}
Builder &setNameStyle(UDisplayOptionsNameStyle nameStyle) {
this->nameStyle = nameStyle;
return *this;
}
Builder &setDisplayLength(UDisplayOptionsDisplayLength displayLength) {
this->displayLength = displayLength;
return *this;
}
Builder &setSubstituteHandling(UDisplayOptionsSubstituteHandling substituteHandling) {
this->substituteHandling = substituteHandling;
return *this;
}
DisplayOptions build() { return DisplayOptions(*this); }
private:
friend DisplayOptions;
Builder();
Builder(const DisplayOptions &displayOptions);
UDisplayOptionsGrammaticalCase grammaticalCase;
UDisplayOptionsNounClass nounClass;
UDisplayOptionsPluralCategory pluralCategory;
UDisplayOptionsCapitalization capitalization;
UDisplayOptionsNameStyle nameStyle;
UDisplayOptionsDisplayLength displayLength;
UDisplayOptionsSubstituteHandling substituteHandling;
};
static Builder builder();
Builder copyToBuilder() const;
UDisplayOptionsGrammaticalCase getGrammaticalCase() const { return grammaticalCase; }
UDisplayOptionsNounClass getNounClass() const { return nounClass; }
UDisplayOptionsPluralCategory getPluralCategory() const { return pluralCategory; }
UDisplayOptionsCapitalization getCapitalization() const { return capitalization; }
UDisplayOptionsNameStyle getNameStyle() const { return nameStyle; }
UDisplayOptionsDisplayLength getDisplayLength() const { return displayLength; }
UDisplayOptionsSubstituteHandling getSubstituteHandling() const { return substituteHandling; }
DisplayOptions &operator=(const DisplayOptions &other) = default;
DisplayOptions &operator=(DisplayOptions &&other) noexcept = default;
DisplayOptions(const DisplayOptions &other) = default;
private:
DisplayOptions(const Builder &builder);
UDisplayOptionsGrammaticalCase grammaticalCase;
UDisplayOptionsNounClass nounClass;
UDisplayOptionsPluralCategory pluralCategory;
UDisplayOptionsCapitalization capitalization;
UDisplayOptionsNameStyle nameStyle;
UDisplayOptionsDisplayLength displayLength;
UDisplayOptionsSubstituteHandling substituteHandling;
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __DISPLAYOPTIONS_H__
icu::DisplayOptions::Builder
Responsible for building DisplayOptions.
Definition: displayoptions.h:50
icu::DisplayOptions::Builder::setNounClass
Builder & setNounClass(UDisplayOptionsNounClass nounClass)
Sets the noun class.
Definition: displayoptions.h:71
icu::DisplayOptions::Builder::setPluralCategory
Builder & setPluralCategory(UDisplayOptionsPluralCategory pluralCategory)
Sets the plural category.
Definition: displayoptions.h:83
icu::DisplayOptions::Builder::setDisplayLength
Builder & setDisplayLength(UDisplayOptionsDisplayLength displayLength)
Sets the display length.
Definition: displayoptions.h:119
icu::DisplayOptions::Builder::setCapitalization
Builder & setCapitalization(UDisplayOptionsCapitalization capitalization)
Sets the capitalization.
Definition: displayoptions.h:95
icu::DisplayOptions::Builder::setNameStyle
Builder & setNameStyle(UDisplayOptionsNameStyle nameStyle)
Sets the dialect handling.
Definition: displayoptions.h:107
icu::DisplayOptions::Builder::build
DisplayOptions build()
Builds the display options.
Definition: displayoptions.h:142
icu::DisplayOptions::Builder::setSubstituteHandling
Builder & setSubstituteHandling(UDisplayOptionsSubstituteHandling substituteHandling)
Sets the substitute handling.
Definition: displayoptions.h:131
icu::DisplayOptions::Builder::setGrammaticalCase
Builder & setGrammaticalCase(UDisplayOptionsGrammaticalCase grammaticalCase)
Sets the grammatical case.
Definition: displayoptions.h:59
icu::DisplayOptions
Represents all the display options that are supported by CLDR such as grammatical case,...
Definition: displayoptions.h:43
icu::DisplayOptions::operator=
DisplayOptions & operator=(DisplayOptions &&other) noexcept=default
Moves the DisplayOptions.
icu::DisplayOptions::DisplayOptions
DisplayOptions(const DisplayOptions &other)=default
Copies the DisplayOptions.
icu::DisplayOptions::getSubstituteHandling
UDisplayOptionsSubstituteHandling getSubstituteHandling() const
Gets the substitute handling.
Definition: displayoptions.h:227
icu::DisplayOptions::getNameStyle
UDisplayOptionsNameStyle getNameStyle() const
Gets the dialect handling.
Definition: displayoptions.h:211
icu::DisplayOptions::builder
static Builder builder()
Creates a builder with the UNDEFINED values for all the parameters.
icu::DisplayOptions::getCapitalization
UDisplayOptionsCapitalization getCapitalization() const
Gets the capitalization.
Definition: displayoptions.h:203
icu::DisplayOptions::getGrammaticalCase
UDisplayOptionsGrammaticalCase getGrammaticalCase() const
Gets the grammatical case.
Definition: displayoptions.h:179
icu::DisplayOptions::getNounClass
UDisplayOptionsNounClass getNounClass() const
Gets the noun class.
Definition: displayoptions.h:187
icu::DisplayOptions::getDisplayLength
UDisplayOptionsDisplayLength getDisplayLength() const
Gets the display length.
Definition: displayoptions.h:219
icu::DisplayOptions::copyToBuilder
Builder copyToBuilder() const
Creates a builder with the same parameters from this object.
icu::DisplayOptions::operator=
DisplayOptions & operator=(const DisplayOptions &other)=default
Copies the DisplayOptions.
icu::DisplayOptions::getPluralCategory
UDisplayOptionsPluralCategory getPluralCategory() const
Gets the plural category.
Definition: displayoptions.h:195
udisplayoptions.h
C API: Display options (enum types, values, helper functions)
UDisplayOptionsCapitalization
UDisplayOptionsCapitalization
Represents all the capitalization options.
Definition: udisplayoptions.h:183
UDisplayOptionsSubstituteHandling
UDisplayOptionsSubstituteHandling
Represents all the substitute handling.
Definition: udisplayoptions.h:293
UDisplayOptionsPluralCategory
UDisplayOptionsPluralCategory
Standard CLDR plural form/category constants.
Definition: udisplayoptions.h:87
UDisplayOptionsGrammaticalCase
UDisplayOptionsGrammaticalCase
Represents all the grammatical cases that are supported by CLDR.
Definition: udisplayoptions.h:26
UDisplayOptionsNameStyle
UDisplayOptionsNameStyle
Represents all the dialect handlings.
Definition: udisplayoptions.h:231
UDisplayOptionsNounClass
UDisplayOptionsNounClass
Represents all the grammatical noun classes that are supported by CLDR.
Definition: udisplayoptions.h:134
UDisplayOptionsDisplayLength
UDisplayOptionsDisplayLength
Represents all the display lengths.
Definition: udisplayoptions.h:262
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition: utypes.h:301
uversion.h
C API: API for accessing ICU version numbers.