ICU 73.2  73.2
displayoptions.h
Go to the documentation of this file.
1 // © 2022 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 
4 #ifndef __DISPLAYOPTIONS_H__
5 #define __DISPLAYOPTIONS_H__
6 
7 #include "unicode/utypes.h"
8 
9 #if U_SHOW_CPLUSPLUS_API
10 
11 #if !UCONFIG_NO_FORMATTING
12 
21 #include "unicode/uversion.h"
22 
23 U_NAMESPACE_BEGIN
24 
25 #ifndef U_HIDE_DRAFT_API
26 
46 public:
53  public:
62  this->grammaticalCase = grammaticalCase;
63  return *this;
64  }
65 
74  this->nounClass = nounClass;
75  return *this;
76  }
77 
86  this->pluralCategory = pluralCategory;
87  return *this;
88  }
89 
98  this->capitalization = capitalization;
99  return *this;
100  }
101 
110  this->nameStyle = nameStyle;
111  return *this;
112  }
113 
122  this->displayLength = displayLength;
123  return *this;
124  }
125 
134  this->substituteHandling = substituteHandling;
135  return *this;
136  }
137 
144  DisplayOptions build() { return DisplayOptions(*this); }
145 
146  private:
147  friend DisplayOptions;
148 
149  Builder();
150  Builder(const DisplayOptions &displayOptions);
151 
152  UDisplayOptionsGrammaticalCase grammaticalCase;
153  UDisplayOptionsNounClass nounClass;
154  UDisplayOptionsPluralCategory pluralCategory;
155  UDisplayOptionsCapitalization capitalization;
156  UDisplayOptionsNameStyle nameStyle;
157  UDisplayOptionsDisplayLength displayLength;
158  UDisplayOptionsSubstituteHandling substituteHandling;
159  };
160 
167  static Builder builder();
174  Builder copyToBuilder() const;
181  UDisplayOptionsGrammaticalCase getGrammaticalCase() const { return grammaticalCase; }
182 
189  UDisplayOptionsNounClass getNounClass() const { return nounClass; }
190 
197  UDisplayOptionsPluralCategory getPluralCategory() const { return pluralCategory; }
198 
205  UDisplayOptionsCapitalization getCapitalization() const { return capitalization; }
206 
213  UDisplayOptionsNameStyle getNameStyle() const { return nameStyle; }
214 
221  UDisplayOptionsDisplayLength getDisplayLength() const { return displayLength; }
222 
229  UDisplayOptionsSubstituteHandling getSubstituteHandling() const { return substituteHandling; }
230 
237  DisplayOptions &operator=(const DisplayOptions &other) = default;
238 
245  DisplayOptions &operator=(DisplayOptions &&other) noexcept = default;
246 
253  DisplayOptions(const DisplayOptions &other) = default;
254 
255 private:
256  DisplayOptions(const Builder &builder);
257  UDisplayOptionsGrammaticalCase grammaticalCase;
258  UDisplayOptionsNounClass nounClass;
259  UDisplayOptionsPluralCategory pluralCategory;
260  UDisplayOptionsCapitalization capitalization;
261  UDisplayOptionsNameStyle nameStyle;
262  UDisplayOptionsDisplayLength displayLength;
263  UDisplayOptionsSubstituteHandling substituteHandling;
264 };
265 
266 #endif // U_HIDE_DRAFT_API
267 
268 U_NAMESPACE_END
269 
270 #endif /* #if !UCONFIG_NO_FORMATTING */
271 
272 #endif /* U_SHOW_CPLUSPLUS_API */
273 
274 #endif // __DISPLAYOPTIONS_H__
UDisplayOptionsPluralCategory getPluralCategory() const
Gets the plural category.
Builder & setCapitalization(UDisplayOptionsCapitalization capitalization)
Sets the capitalization.
C API: API for accessing ICU version numbers.
DisplayOptions build()
Builds the display options.
Builder & setNounClass(UDisplayOptionsNounClass nounClass)
Sets the noun class.
UDisplayOptionsSubstituteHandling
Represents all the substitute handling.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:301
Responsible for building DisplayOptions.
UDisplayOptionsNameStyle getNameStyle() const
Gets the dialect handling.
Represents all the display options that are supported by CLDR such as grammatical case...
UDisplayOptionsSubstituteHandling getSubstituteHandling() const
Gets the substitute handling.
C API: Display options (enum types, values, helper functions)
Builder & setDisplayLength(UDisplayOptionsDisplayLength displayLength)
Sets the display length.
UDisplayOptionsGrammaticalCase
Represents all the grammatical cases that are supported by CLDR.
Builder & setPluralCategory(UDisplayOptionsPluralCategory pluralCategory)
Sets the plural category.
Builder & setNameStyle(UDisplayOptionsNameStyle nameStyle)
Sets the dialect handling.
UDisplayOptionsDisplayLength getDisplayLength() const
Gets the display length.
Builder & setSubstituteHandling(UDisplayOptionsSubstituteHandling substituteHandling)
Sets the substitute handling.
UDisplayOptionsCapitalization getCapitalization() const
Gets the capitalization.
UDisplayOptionsPluralCategory
Standard CLDR plural form/category constants.
UDisplayOptionsGrammaticalCase getGrammaticalCase() const
Gets the grammatical case.
UDisplayOptionsNounClass getNounClass() const
Gets the noun class.
Builder & setGrammaticalCase(UDisplayOptionsGrammaticalCase grammaticalCase)
Sets the grammatical case.
UDisplayOptionsNounClass
Represents all the grammatical noun classes that are supported by CLDR.
UDisplayOptionsDisplayLength
Represents all the display lengths.
Basic definitions for ICU, for both C and C++ APIs.
UDisplayOptionsNameStyle
Represents all the dialect handlings.
UDisplayOptionsCapitalization
Represents all the capitalization options.