]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/number_longnames.h
ICU-64252.0.1.tar.gz
[apple/icu.git] / icuSources / i18n / number_longnames.h
CommitLineData
0f5d89e8
A
1// © 2017 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3
4#include "unicode/utypes.h"
5
6#if !UCONFIG_NO_FORMATTING
7#ifndef __NUMBER_LONGNAMES_H__
8#define __NUMBER_LONGNAMES_H__
9
10#include "unicode/uversion.h"
11#include "number_utils.h"
12#include "number_modifiers.h"
13
14U_NAMESPACE_BEGIN namespace number {
15namespace impl {
16
3d1f044b 17class LongNameHandler : public MicroPropsGenerator, public ModifierStore, public UMemory {
0f5d89e8 18 public:
3d1f044b
A
19 static UnicodeString getUnitDisplayName(
20 const Locale& loc,
21 const MeasureUnit& unit,
22 UNumberUnitWidth width,
23 UErrorCode& status);
24
25 static UnicodeString getUnitPattern( // Apple-specific
26 const Locale& loc,
27 const MeasureUnit& unit,
28 UNumberUnitWidth width,
29 StandardPlural::Form pluralForm,
30 UErrorCode& status);
31
32 static LongNameHandler*
0f5d89e8
A
33 forCurrencyLongNames(const Locale &loc, const CurrencyUnit &currency, const PluralRules *rules,
34 const MicroPropsGenerator *parent, UErrorCode &status);
35
3d1f044b 36 static LongNameHandler*
0f5d89e8
A
37 forMeasureUnit(const Locale &loc, const MeasureUnit &unit, const MeasureUnit &perUnit,
38 const UNumberUnitWidth &width, const PluralRules *rules,
39 const MicroPropsGenerator *parent, UErrorCode &status);
40
41 void
42 processQuantity(DecimalQuantity &quantity, MicroProps &micros, UErrorCode &status) const U_OVERRIDE;
43
3d1f044b
A
44 const Modifier* getModifier(int8_t signum, StandardPlural::Form plural) const U_OVERRIDE;
45
0f5d89e8
A
46 private:
47 SimpleModifier fModifiers[StandardPlural::Form::COUNT];
48 const PluralRules *rules;
49 const MicroPropsGenerator *parent;
50
51 LongNameHandler(const PluralRules *rules, const MicroPropsGenerator *parent)
52 : rules(rules), parent(parent) {}
53
3d1f044b 54 static LongNameHandler*
0f5d89e8
A
55 forCompoundUnit(const Locale &loc, const MeasureUnit &unit, const MeasureUnit &perUnit,
56 const UNumberUnitWidth &width, const PluralRules *rules,
57 const MicroPropsGenerator *parent, UErrorCode &status);
58
3d1f044b
A
59 void simpleFormatsToModifiers(const UnicodeString *simpleFormats, Field field, UErrorCode &status);
60 void multiSimpleFormatsToModifiers(const UnicodeString *leadFormats, UnicodeString trailFormat,
61 Field field, UErrorCode &status);
0f5d89e8
A
62};
63
64} // namespace impl
65} // namespace number
66U_NAMESPACE_END
67
68#endif //__NUMBER_LONGNAMES_H__
69
70#endif /* #if !UCONFIG_NO_FORMATTING */