164339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// Copyright (C) 2016 and later: Unicode, Inc. and others.
264339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert// License & terms of use: http://www.unicode.org/copyright.html
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/*
4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*******************************************************************************
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
683a171d1a62abf406f7f44ae671823d5ec20db7dCraig Cornelius*   Copyright (C) 1998-2011, International Business Machines
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*   Corporation and others.  All Rights Reserved.
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*******************************************************************************
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* File locbund.h
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Modification History:
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*   Date        Name        Description
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*   10/16/98    stephen     Creation.
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*   02/25/99    stephen     Modified for new C API.
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*******************************************************************************
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef LOCBUND_H
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define LOCBUND_H
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/utypes.h"
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#if !UCONFIG_NO_FORMATTING
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/unum.h"
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define ULOCALEBUNDLE_NUMBERFORMAT_COUNT ((int32_t)UNUM_SPELLOUT)
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querutypedef struct ULocaleBundle {
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    char            *fLocale;
34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UNumberFormat   *fNumberFormat[ULOCALEBUNDLE_NUMBERFORMAT_COUNT];
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UBool           isInvariantLocale;
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru} ULocaleBundle;
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Initialize a ULocaleBundle, initializing all formatters to 0.
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @param result A ULocaleBundle to initialize.
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @param loc The locale of the ULocaleBundle.
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
4683a171d1a62abf406f7f44ae671823d5ec20db7dCraig CorneliusU_CAPI ULocaleBundle *
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruu_locbund_init(ULocaleBundle *result, const char *loc);
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Create a new ULocaleBundle, initializing all formatters to 0.
51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @param loc The locale of the ULocaleBundle.
52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
5483a171d1a62abf406f7f44ae671823d5ec20db7dCraig Cornelius/*U_CAPI  ULocaleBundle *
55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruu_locbund_new(const char *loc);*/
56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Create a deep copy of this ULocaleBundle;
59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @param bundle The ULocaleBundle to clone.
60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @return A new ULocaleBundle.
61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
6283a171d1a62abf406f7f44ae671823d5ec20db7dCraig Cornelius/*U_CAPI ULocaleBundle *
63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruu_locbund_clone(const ULocaleBundle *bundle);*/
64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Delete the specified ULocaleBundle, freeing all associated memory.
67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @param bundle The ULocaleBundle to delete
68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
6983a171d1a62abf406f7f44ae671823d5ec20db7dCraig CorneliusU_CAPI void
70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruu_locbund_close(ULocaleBundle *bundle);
71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Get the NumberFormat used to format and parse numbers in a ULocaleBundle.
74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @param bundle The ULocaleBundle to use
75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @return A pointer to the NumberFormat used for number formatting and parsing.
76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */
7783a171d1a62abf406f7f44ae671823d5ec20db7dCraig CorneliusU_CAPI UNumberFormat *
78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruu_locbund_getNumberFormat(ULocaleBundle *bundle, UNumberFormatStyle style);
79ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif /* #if !UCONFIG_NO_FORMATTING */
81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif
83