merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / i18n / NumberFormatIndex.idl
blob38163215d054fccb7cf7abd92013e4459406ed4a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef __com_sun_star_i18n_NumberFormatIndex_idl__
29 #define __com_sun_star_i18n_NumberFormatIndex_idl__
31 //=============================================================================
33 module com { module sun { module star { module i18n {
35 //=============================================================================
37 //! Do NOT insert any new values!
38 //! Locale data number format creation must match these values!
39 //! Number formatter internals must match these values!
41 /**
42 Number format indices to be passed as the index argument to
43 <member>XNumberFormatCode::getFormatCode()</member>
45 <member scope="::com::sun::star::util">XNumberFormatTypes::getFormatIndex()</member>.
47 <p> Each locale can support up to about 5000 arbitrary format
48 codes. But for backward compatiblity reasons, each locale
49 <b>MUST</b> support some predefined format codes. These predefined
50 format codes are accessed through indices as the following, and
51 the locale data format code definitions in
52 i18npool\source\localedata\data\*.xml <b>MUST</b> have matching
53 entries in the form <br/>
55 <code>&lt;FormatElement formatindex="0"&gt;</code> <br/>
57 (see also <member>FormatElement::formatIndex</member>).
59 The index values are also used to define the <code>enum
60 NfIndexTableOffset</code> in file svtools/inc/zforlist.hxx </p>
62 <p> Note: This index has <b>nothing</b> to do with the index key
63 used internally by the number formatter. </p> <br/>
65 <p> Date formats may have a comment of DIN/EN/ISO, meaning
66 <ul>
67 <li> DIN 5008 (Deutsche Industrie Norm) </li>
68 <li> EN 28601 (European Norm) </li>
69 <li> ISO 8601 (International Standards Organisation) </li>
70 </ul>
71 </p>
73 <p> Some names of date format constants indicate a special
74 behavior of those formats in StarOffice 5.2 or older. Those are:
76 <dl>
77 <dt> <a name="SYSTEM"> DATE_SYSTEM_... </a> </dt>
78 <dd> On Windows platforms these formats were entirely
79 retrieved from the system's Regional Settings. OpenOffice.org
80 / StarOffice 6 don't use those Windows settings anymore in
81 order to provide the same functionality and document layout on
82 every platform. Like all other formats these formats are now
83 defined in the i18n framework locale data files under
84 i18npool\source\localedata\data\*.xml </dd>
86 <dt> <a name="SYS"> DATE_SYS_... </a> </dt>
87 <dd> On Windows platforms these formats used separators and
88 YMD order retrieved from the Regional Settings, but appearance
89 of short/long days/months/years was defined by the
90 application. </dd>
92 <dt> <a name="DEF"> DATE_DEF_... </a> </dt>
93 <dd> The format code was hard defined, only the date separator
94 was taken from the Windows Regional Settings, but not the YMD
95 order. </dd>
97 </dl>
98 </p>
100 published constants NumberFormatIndex
102 /// Start of simple numerical formats (first format)
103 const short NUMBER_START = 0;
104 /// The "General" standard format
105 const short NUMBER_STANDARD = NUMBER_START;
106 /// 0 <br/>Integer number
107 const short NUMBER_INT = NUMBER_START+1;
108 /// 0.00 <br/>Decimal number with 2 decimals
109 const short NUMBER_DEC2 = NUMBER_START+2;
110 /// #,##0 <br/>Integer number with group separator
111 const short NUMBER_1000INT = NUMBER_START+3;
112 /// #,##0.00 <br/>Decimal number with group separator
113 const short NUMBER_1000DEC2 = NUMBER_START+4;
114 /// #,##0.00 <br/> In SO5/Win this format was retrieved from the Regional Settings
115 const short NUMBER_SYSTEM = NUMBER_START+5;
116 /// End of simple numerical formats (last format)
117 const short NUMBER_END = NUMBER_SYSTEM ;
120 /// Start of Scientific formats (first format)
121 const short SCIENTIFIC_START = NUMBER_END+1;
122 /// 0.00E+000 <br/>Number in scientific notation with exponent in 3 digit placeholders
123 const short SCIENTIFIC_000E000 = SCIENTIFIC_START;
124 /// 0.00E+00 <br/>Number in scientific notation with exponent in 2 digit placeholders
125 const short SCIENTIFIC_000E00 = SCIENTIFIC_START+1;
126 /// End of Scientific formats (last format)
127 const short SCIENTIFIC_END = SCIENTIFIC_000E00;
130 /// Start of Percent formats (first format)
131 const short PERCENT_START = SCIENTIFIC_END+1;
132 /// 0% <br/>Percentage format, rounded to integer
133 const short PERCENT_INT = PERCENT_START;
134 /// 0.00% <br/>Percentage format, rounded to 2 decimals
135 const short PERCENT_DEC2 = PERCENT_START+1;
136 /// End of Percent formats (last format)
137 const short PERCENT_END = PERCENT_DEC2;
140 /// Start of Fraction formats (first format)
141 const short FRACTION_START = PERCENT_END+1;
142 /// # ?/? <br/>Number with decimal in fraction in 1 digit placeholder
143 const short FRACTION_1 = FRACTION_START;
144 /// # ??/?? <br/>Number with decimal in fraction in 2 digit placeholders
145 const short FRACTION_2 = FRACTION_START+1;
146 /// End of Fraction formats (last format)
147 const short FRACTION_END = FRACTION_2;
150 /// Start of Currency formats (first format)
151 const short CURRENCY_START = FRACTION_END+1;
152 /// #,##0 DM <br/>Integer currency format with group separator
153 const short CURRENCY_1000INT = CURRENCY_START;
154 /// #,##0.00 DM <br/>Decimal currency format with group separator
155 const short CURRENCY_1000DEC2 = CURRENCY_START+1;
156 /// #,##0 DM <br/>Integer currency format with negative in red
157 const short CURRENCY_1000INT_RED = CURRENCY_START+2;
158 /// #,##0.00 DM <br/>Decimal currency format with negative in red
159 const short CURRENCY_1000DEC2_RED = CURRENCY_START+3;
160 /// #,##0.00 DEM <br/>Currency in ISO-4217 abbreviation format
161 const short CURRENCY_1000DEC2_CCC = CURRENCY_START+4;
162 /// #,##0.-- DM <br/>Currency format with dash representing 0 in decimals
163 const short CURRENCY_1000DEC2_DASHED = CURRENCY_START+5;
164 /// End of Currency formats (last format)
165 const short CURRENCY_END = CURRENCY_1000DEC2_DASHED;
168 /// Start of Date formats (first format)
169 const short DATE_START = CURRENCY_END+1;
170 /// 08.10.97 <br/> see also DATE_SYSTEM_... <a href="#SYSTEM">explanation</a>
171 const short DATE_SYSTEM_SHORT = DATE_START;
172 /// Wednesday, 8. October 1997 <br/> see also DATE_SYSTEM_... <a href="#SYSTEM">explanation</a>
173 const short DATE_SYSTEM_LONG = DATE_START+1;
174 /// 08.10.97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
175 const short DATE_SYS_DDMMYY = DATE_START+2;
176 /** 08.10.1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
177 <br/><b>Note:</b> When editing already existing date data this
178 format is forced in order to always edit the full century. */
179 const short DATE_SYS_DDMMYYYY = DATE_START+3;
180 /// 8. Oct 97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
181 const short DATE_SYS_DMMMYY = DATE_START+4;
182 /// 8. Oct 1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
183 const short DATE_SYS_DMMMYYYY = DATE_START+5;
184 /// 8. Oct. 1997 <br/> DIN/EN
185 const short DATE_DIN_DMMMYYYY = DATE_START+6;
186 /// 8. October 1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
187 const short DATE_SYS_DMMMMYYYY = DATE_START+7;
188 /// 8. October 1997 <br/> DIN/EN
189 const short DATE_DIN_DMMMMYYYY = DATE_START+8;
190 /// Wed, 8. Oct 97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
191 const short DATE_SYS_NNDMMMYY = DATE_START+9;
192 /// Wed 08.Oct 97 <br/> see also DATE_DEF_... <a href="#DEF">explanation</a>
193 const short DATE_DEF_NNDDMMMYY = DATE_START+10;
194 /// Wed, 8. October 1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
195 const short DATE_SYS_NNDMMMMYYYY = DATE_START+11;
196 /// Wednesday, 8. October 1997
197 const short DATE_SYS_NNNNDMMMMYYYY = DATE_START+12;
198 /// 10-08 <br/> DIN/EN
199 const short DATE_DIN_MMDD = DATE_START+13;
200 /// 97-10-08 <br/> DIN/EN/ISO
201 const short DATE_DIN_YYMMDD = DATE_START+14;
202 /// 1997-10-08 <br/> DIN/EN/ISO
203 const short DATE_DIN_YYYYMMDD = DATE_START+15;
204 /// 10.97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
205 const short DATE_SYS_MMYY = DATE_START+16;
206 /// 08.Oct <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
207 const short DATE_SYS_DDMMM = DATE_START+17;
208 /// October
209 const short DATE_MMMM = DATE_START+18;
210 /// 4th quarter 97
211 const short DATE_QQJJ = DATE_START+19;
212 /// week of year
213 const short DATE_WW = DATE_START+20;
214 /// End of Date formats (last format)
215 const short DATE_END = DATE_WW;
218 /// Start of Time formats (first format)
219 const short TIME_START = DATE_END+1;
220 /// HH:MM <br/>Time format with hour and minute
221 const short TIME_HHMM = TIME_START;
222 /// HH:MM:SS <br/>Time format with hour, minute and second
223 const short TIME_HHMMSS = TIME_START+1;
224 /// HH:MM AM/PM <br/>Time format with hour, minute and morning/afternoon notation
225 const short TIME_HHMMAMPM = TIME_START+2;
226 /// HH:MM:SS AM/PM <br/>Time format with hour, minute, second and morning/afternoon notation
227 const short TIME_HHMMSSAMPM = TIME_START+3;
228 /// [HH]:MM:SS <br/>Time format with amount of hours
229 const short TIME_HH_MMSS = TIME_START+4;
230 /// MM:SS,00 <br/>Time format with second in fraction
231 const short TIME_MMSS00 = TIME_START+5;
232 /// [HH]:MM:SS,00 <br/>Time format with amount of hours and seconds with fraction
233 const short TIME_HH_MMSS00 = TIME_START+6;
234 /// End of Time formats (last format)
235 const short TIME_END = TIME_HH_MMSS00;
238 /// Start of DateTime formats (first format)
239 const short DATETIME_START = TIME_END + 1;
240 /// 08.10.97 01:23 Date/time format
241 const short DATETIME_SYSTEM_SHORT_HHMM = DATETIME_START;
242 /** 08.10.1997 01:23:45 Date/time format with second
243 <br/><b>Note:</b> When editing already existing date/time data this
244 format is forced in order to always edit the full century. */
245 const short DATETIME_SYS_DDMMYYYY_HHMMSS= DATETIME_START+1;
246 /// End of DateTime formats (last format)
247 const short DATETIME_END = DATETIME_SYS_DDMMYYYY_HHMMSS;
251 BOOLEAN format
253 @ATTENTION
254 <b>Not</b> defined in locale data, but generated by the number
255 formatter. If you want to access this format you <b>MUST</b>
256 do it via <member scope="com::sun::star::util">XNumberFormatTypes::getFormatIndex()</member>
257 instead of <member>XNumberFormatCode::getFormatCode()</member>.
259 const short BOOLEAN = DATETIME_END+1;
262 Text format
264 @ATTENTION
265 <b>Not</b> defined in locale data, but generated by the number
266 formatter. If you want to access this format you <b>MUST</b>
267 do it via <member scope="com::sun::star::util">XNumberFormatTypes::getFormatIndex()</member>
268 instead of <member>XNumberFormatCode::getFormatCode()</member>
270 const short TEXT = BOOLEAN+1;
272 /// count of built-in format codes.
273 const short INDEX_TABLE_ENTRIES = TEXT+1;
277 //=============================================================================
278 }; }; }; };
279 #endif