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