1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 #include "unicode/utypes.h"
6 #if !UCONFIG_NO_FORMATTING
7 #ifndef __NUMBER_LONGNAMES_H__
8 #define __NUMBER_LONGNAMES_H__
10 #include "unicode/uversion.h"
11 #include "number_utils.h"
12 #include "number_modifiers.h"
14 U_NAMESPACE_BEGIN
namespace number
{
17 class LongNameHandler
: public MicroPropsGenerator
, public ModifierStore
, public UMemory
{
19 static UnicodeString
getUnitDisplayName(
21 const MeasureUnit
& unit
,
22 UNumberUnitWidth width
,
25 static UnicodeString
getUnitPattern( // Apple-specific
27 const MeasureUnit
& unit
,
28 UNumberUnitWidth width
,
29 StandardPlural::Form pluralForm
,
32 static LongNameHandler
*
33 forCurrencyLongNames(const Locale
&loc
, const CurrencyUnit
¤cy
, const PluralRules
*rules
,
34 const MicroPropsGenerator
*parent
, UErrorCode
&status
);
36 static LongNameHandler
*
37 forMeasureUnit(const Locale
&loc
, const MeasureUnit
&unit
, const MeasureUnit
&perUnit
,
38 const UNumberUnitWidth
&width
, const PluralRules
*rules
,
39 const MicroPropsGenerator
*parent
, UErrorCode
&status
);
42 processQuantity(DecimalQuantity
&quantity
, MicroProps
µs
, UErrorCode
&status
) const U_OVERRIDE
;
44 const Modifier
* getModifier(int8_t signum
, StandardPlural::Form plural
) const U_OVERRIDE
;
47 SimpleModifier fModifiers
[StandardPlural::Form::COUNT
];
48 const PluralRules
*rules
;
49 const MicroPropsGenerator
*parent
;
51 LongNameHandler(const PluralRules
*rules
, const MicroPropsGenerator
*parent
)
52 : rules(rules
), parent(parent
) {}
54 static LongNameHandler
*
55 forCompoundUnit(const Locale
&loc
, const MeasureUnit
&unit
, const MeasureUnit
&perUnit
,
56 const UNumberUnitWidth
&width
, const PluralRules
*rules
,
57 const MicroPropsGenerator
*parent
, UErrorCode
&status
);
59 void simpleFormatsToModifiers(const UnicodeString
*simpleFormats
, Field field
, UErrorCode
&status
);
60 void multiSimpleFormatsToModifiers(const UnicodeString
*leadFormats
, UnicodeString trailFormat
,
61 Field field
, UErrorCode
&status
);
68 #endif //__NUMBER_LONGNAMES_H__
70 #endif /* #if !UCONFIG_NO_FORMATTING */