ICU 73.2  73.2
ucurr.h
Go to the documentation of this file.
00001 // © 2016 and later: Unicode, Inc. and others.
00002 // License & terms of use: http://www.unicode.org/copyright.html
00003 /*
00004 **********************************************************************
00005 * Copyright (c) 2002-2016, International Business Machines
00006 * Corporation and others.  All Rights Reserved.
00007 **********************************************************************
00008 */
00009 #ifndef _UCURR_H_
00010 #define _UCURR_H_
00011 
00012 #include "unicode/utypes.h"
00013 #include "unicode/uenum.h"
00014 
00035 #if !UCONFIG_NO_FORMATTING
00036 
00041 enum UCurrencyUsage {
00048     UCURR_USAGE_STANDARD=0,
00054     UCURR_USAGE_CASH=1,
00055 #ifndef U_HIDE_DEPRECATED_API
00056 
00060     UCURR_USAGE_COUNT=2
00061 #endif  // U_HIDE_DEPRECATED_API
00062 };
00064 typedef enum UCurrencyUsage UCurrencyUsage; 
00065 
00081 U_CAPI int32_t U_EXPORT2
00082 ucurr_forLocale(const char* locale,
00083                 UChar* buff,
00084                 int32_t buffCapacity,
00085                 UErrorCode* ec);
00086 
00093 typedef enum UCurrNameStyle {
00099     UCURR_SYMBOL_NAME,
00100 
00106     UCURR_LONG_NAME,
00107 
00116     UCURR_NARROW_SYMBOL_NAME,
00117 
00126     UCURR_FORMAL_SYMBOL_NAME,
00127 
00135     UCURR_VARIANT_SYMBOL_NAME
00136     
00137 } UCurrNameStyle;
00138 
00139 #if !UCONFIG_NO_SERVICE
00140 
00143 typedef const void* UCurrRegistryKey;
00144 
00156 U_CAPI UCurrRegistryKey U_EXPORT2
00157 ucurr_register(const UChar* isoCode, 
00158                    const char* locale,  
00159                    UErrorCode* status);
00171 U_CAPI UBool U_EXPORT2
00172 ucurr_unregister(UCurrRegistryKey key, UErrorCode* status);
00173 #endif /* UCONFIG_NO_SERVICE */
00174 
00192 U_CAPI const UChar* U_EXPORT2
00193 ucurr_getName(const UChar* currency,
00194               const char* locale,
00195               UCurrNameStyle nameStyle,
00196               UBool* isChoiceFormat,
00197               int32_t* len,
00198               UErrorCode* ec);
00199 
00217 U_CAPI const UChar* U_EXPORT2
00218 ucurr_getPluralName(const UChar* currency,
00219                     const char* locale,
00220                     UBool* isChoiceFormat,
00221                     const char* pluralCount,
00222                     int32_t* len,
00223                     UErrorCode* ec);
00224 
00242 U_CAPI int32_t U_EXPORT2
00243 ucurr_getDefaultFractionDigits(const UChar* currency,
00244                                UErrorCode* ec);
00245 
00263 U_CAPI int32_t U_EXPORT2
00264 ucurr_getDefaultFractionDigitsForUsage(const UChar* currency, 
00265                                        const UCurrencyUsage usage,
00266                                        UErrorCode* ec);
00267 
00278 U_CAPI double U_EXPORT2
00279 ucurr_getRoundingIncrement(const UChar* currency,
00280                            UErrorCode* ec);
00281 
00292 U_CAPI double U_EXPORT2
00293 ucurr_getRoundingIncrementForUsage(const UChar* currency,
00294                                    const UCurrencyUsage usage,
00295                                    UErrorCode* ec);
00296 
00303 typedef enum UCurrCurrencyType {
00308     UCURR_ALL = INT32_MAX,
00317     UCURR_COMMON = 1,
00325     UCURR_UNCOMMON = 2,
00331     UCURR_DEPRECATED = 4,
00337     UCURR_NON_DEPRECATED = 8
00338 } UCurrCurrencyType;
00339 
00349 U_CAPI UEnumeration * U_EXPORT2
00350 ucurr_openISOCurrencies(uint32_t currType, UErrorCode *pErrorCode);
00351 
00378 U_CAPI UBool U_EXPORT2
00379 ucurr_isAvailable(const UChar* isoCode, 
00380              UDate from, 
00381              UDate to, 
00382              UErrorCode* errorCode);
00383 
00398 U_CAPI int32_t U_EXPORT2
00399 ucurr_countCurrencies(const char* locale, 
00400                  UDate date, 
00401                  UErrorCode* ec); 
00402 
00422 U_CAPI int32_t U_EXPORT2 
00423 ucurr_forLocaleAndDate(const char* locale, 
00424                 UDate date, 
00425                 int32_t index,
00426                 UChar* buff, 
00427                 int32_t buffCapacity, 
00428                 UErrorCode* ec); 
00429 
00446 U_CAPI UEnumeration* U_EXPORT2
00447 ucurr_getKeywordValuesForLocale(const char* key,
00448                                 const char* locale,
00449                                 UBool commonlyUsed,
00450                                 UErrorCode* status);
00451 
00461 U_CAPI int32_t U_EXPORT2
00462 ucurr_getNumericCode(const UChar* currency);
00463 
00464 #endif /* #if !UCONFIG_NO_FORMATTING */
00465 
00466 #endif