]> git.saurik.com Git - apple/icu.git/blob - icuSources/extra/ustdio/locbund.h
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / extra / ustdio / locbund.h
1 /*
2 *******************************************************************************
3 *
4 * Copyright (C) 1998-1999, International Business Machines
5 * Corporation and others. All Rights Reserved.
6 *
7 *******************************************************************************
8 *
9 * File locbund.h
10 *
11 * Modification History:
12 *
13 * Date Name Description
14 * 10/16/98 stephen Creation.
15 * 02/25/99 stephen Modified for new C API.
16 *******************************************************************************
17 */
18
19 #ifndef LOCBUND_H
20 #define LOCBUND_H
21
22 #include "unicode/utypes.h"
23
24 #if !UCONFIG_NO_FORMATTING
25
26 #include "unicode/unum.h"
27 #include "unicode/udat.h"
28
29 struct ULocaleBundle {
30 char *fLocale;
31
32 UNumberFormat *fNumberFormat;
33 UNumberFormat *fPercentFormat;
34 UNumberFormat *fCurrencyFormat;
35 UNumberFormat *fScientificFormat;
36 UNumberFormat *fSpelloutFormat;
37
38 UDateFormat *fDateFormat;
39 UDateFormat *fTimeFormat;
40 };
41 typedef struct ULocaleBundle ULocaleBundle;
42
43
44 /**
45 * Create a new ULocaleBundle, initializing all formatters to 0.
46 * @param loc The locale of the ULocaleBundle.
47 * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
48 */
49 ULocaleBundle*
50 u_locbund_new(const char *loc);
51
52 /**
53 * Create a deep copy of this ULocaleBundle;
54 * @param bundle The ULocaleBundle to clone.
55 * @return A new ULocaleBundle.
56 */
57 ULocaleBundle*
58 u_locbund_clone(const ULocaleBundle *bundle);
59
60 /**
61 * Delete the specified ULocaleBundle, freeing all associated memory.
62 * @param bundle The ULocaleBundle to delete
63 */
64 void
65 u_locbund_delete(ULocaleBundle *bundle);
66
67 /**
68 * Get the NumberFormat used to format and parse numbers in a ULocaleBundle.
69 * @param bundle The ULocaleBundle to use
70 * @return A pointer to the NumberFormat used for number formatting and parsing.
71 */
72 UNumberFormat*
73 u_locbund_getNumberFormat(ULocaleBundle *bundle);
74
75 /**
76 * Get the NumberFormat used to format and parse percents in a ULocaleBundle.
77 * @param bundle The ULocaleBundle to use
78 * @return A pointer to the NumberFormat used for percent formatting and parsing.
79 */
80 UNumberFormat*
81 u_locbund_getPercentFormat(ULocaleBundle *bundle);
82
83 /**
84 * Get the NumberFormat used to format and parse currency in a ULocaleBundle.
85 * @param bundle The ULocaleBundle to use
86 * @return A pointer to the NumberFormat used for currency formatting and parsing.
87 */
88 UNumberFormat*
89 u_locbund_getCurrencyFormat(ULocaleBundle *bundle);
90
91 /**
92 * Get the NumberFormat used to format and parse scientific numbers in a ULocaleBundle.
93 * @param bundle The ULocaleBundle to use
94 * @return A pointer to the NumberFormat used for scientific formatting and parsing.
95 */
96 UNumberFormat*
97 u_locbund_getScientificFormat(ULocaleBundle *bundle);
98
99 /**
100 * Get the NumberFormat used format to and parse spelled-out numbers in a ULocaleBundle.
101 * @param bundle The ULocaleBundle to use
102 * @return A pointer to the NumberFormat used for spelled-out number formatting and parsing.
103 */
104 UNumberFormat*
105 u_locbund_getSpelloutFormat(ULocaleBundle *bundle);
106
107 /**
108 * Get the DateFormat used to format and parse dates in a ULocaleBundle.
109 * @param bundle The ULocaleBundle to use
110 * @return A pointer to the DateFormat used for date formatting and parsing.
111 */
112 UDateFormat*
113 u_locbund_getDateFormat(ULocaleBundle *bundle);
114
115 /**
116 * Get the DateFormat used to format and parse times in a ULocaleBundle.
117 * @param bundle The ULocaleBundle to use
118 * @return A pointer to the DateFormat used for time formatting and parsing.
119 */
120 UDateFormat*
121 u_locbund_getTimeFormat(ULocaleBundle *bundle);
122
123 #endif /* #if !UCONFIG_NO_FORMATTING */
124
125 #endif