1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_i18n_NumberFormatIndex_idl__
21 #define __com_sun_star_i18n_NumberFormatIndex_idl__
24 module com
{ module sun
{ module star
{ module i18n
{
27 //! Do NOT insert any new values!
28 //! Locale data number format creation must match these values!
29 //! Number formatter internals must match these values!
32 Number format indices to be passed as the index argument to
33 XNumberFormatCode::getFormatCode()
35 ::com::sun::star::util::XNumberFormatTypes::getFormatIndex().
37 <p> Each locale can support up to about 5000 arbitrary format
38 codes. But for backward compatibility reasons, each locale
39 <b>MUST</b> support some predefined format codes. These predefined
40 format codes are accessed through indices as the following, and
41 the locale data format code definitions in
42 i18npool/source/localedata/data/\*.xml <b>MUST</b> have matching
43 entries in the form <br/>
45 <code><FormatElement formatindex="0"></code> <br/>
47 (see also FormatElement::formatIndex()).
49 The index values are also used to define the <code>enum
50 NfIndexTableOffset</code> in file svtools/inc/zforlist.hxx </p>
52 <p> Note: This index has <b>nothing</b> to do with the index key
53 used internally by the number formatter. </p> <br/>
55 <p> Date formats may have a comment of DIN/EN/ISO, meaning
57 <li> DIN 5008 (Deutsches Institut für Normung, formerly Deutsche Industrie-Norm) </li>
58 <li> EN 28601 (European Norm) </li>
59 <li> ISO 8601 (International Standards Organization) </li>
63 <p> Some names of date format constants indicate a special
64 behavior of those formats in StarOffice 5.2 or older. Those are:
67 <dt> <a name="SYSTEM"> DATE_SYSTEM_... </a> </dt>
68 <dd> On Windows platforms these formats were entirely
69 retrieved from the system's Regional Settings. OpenOffice.org
70 / StarOffice 6 don't use those Windows settings anymore in
71 order to provide the same functionality and document layout on
72 every platform. Like all other formats these formats are now
73 defined in the i18n framework locale data files under
74 i18npool/source/localedata/data/\*.xml </dd>
76 <dt> <a name="SYS"> DATE_SYS_... </a> </dt>
77 <dd> On Windows platforms these formats used separators and
78 YMD order retrieved from the Regional Settings, but appearance
79 of short/long days/months/years was defined by the
82 <dt> <a name="DEF"> DATE_DEF_... </a> </dt>
83 <dd> The format code was hard defined, only the date separator
84 was taken from the Windows Regional Settings, but not the YMD
90 published constants NumberFormatIndex
92 /// Start of simple numerical formats (first format)
93 const short NUMBER_START
= 0;
94 /// The "General" standard format <br/> formatindex="0"
95 const short NUMBER_STANDARD
= NUMBER_START
;
96 /// 0 <br/>Integer number <br/> formatindex="1"
97 const short NUMBER_INT
= NUMBER_START
+1;
98 /// 0.00 <br/>Decimal number with 2 decimals <br/> formatindex="2"
99 const short NUMBER_DEC2
= NUMBER_START
+2;
100 /// #,##0 <br/>Integer number with group separator <br/> formatindex="3"
101 const short NUMBER_1000INT
= NUMBER_START
+3;
102 /// #,##0.00 <br/>Decimal number with group separator <br/> formatindex="4"
103 const short NUMBER_1000DEC2
= NUMBER_START
+4;
104 /// #,##0.00 <br/> In SO5/Win this format was retrieved from the Regional Settings <br/> formatindex="5"
105 const short NUMBER_SYSTEM
= NUMBER_START
+5;
106 /// End of simple numerical formats (last format)
107 const short NUMBER_END
= NUMBER_SYSTEM
;
110 /// Start of Scientific formats (first format)
111 const short SCIENTIFIC_START
= NUMBER_END
+1;
112 /// 0.00E+000 <br/>Number in scientific notation with exponent in 3 digit placeholders <br/> formatindex="6"
113 const short SCIENTIFIC_000E000
= SCIENTIFIC_START
;
114 /// 0.00E+00 <br/>Number in scientific notation with exponent in 2 digit placeholders <br/> formatindex="7"
115 const short SCIENTIFIC_000E00
= SCIENTIFIC_START
+1;
116 /// End of Scientific formats (last format)
117 const short SCIENTIFIC_END
= SCIENTIFIC_000E00
;
120 /// Start of Percent formats (first format)
121 const short PERCENT_START
= SCIENTIFIC_END
+1;
122 /// 0% <br/>Percentage format, rounded to integer <br/> formatindex="8"
123 const short PERCENT_INT
= PERCENT_START
;
124 /// 0.00% <br/>Percentage format, rounded to 2 decimals <br/> formatindex="9"
125 const short PERCENT_DEC2
= PERCENT_START
+1;
126 /// End of Percent formats (last format)
127 const short PERCENT_END
= PERCENT_DEC2
;
130 /// Start of Fraction formats (first format)
131 const short FRACTION_START
= PERCENT_END
+1;
132 /// # ?/? <br/>Number with decimal in fraction in 1 digit placeholder <br/> formatindex="10"
133 const short FRACTION_1
= FRACTION_START
;
134 /// # ??/?? <br/>Number with decimal in fraction in 2 digit placeholders <br/> formatindex="11"
135 const short FRACTION_2
= FRACTION_START
+1;
136 /// End of Fraction formats (last format)
137 const short FRACTION_END
= FRACTION_2
;
140 /// Start of Currency formats (first format)
141 const short CURRENCY_START
= FRACTION_END
+1;
142 /// #,##0 DM <br/>Integer currency format with group separator <br/> formatindex="12"
143 const short CURRENCY_1000INT
= CURRENCY_START
;
144 /// #,##0.00 DM <br/>Decimal currency format with group separator <br/> formatindex="13"
145 const short CURRENCY_1000DEC2
= CURRENCY_START
+1;
146 /// #,##0 DM <br/>Integer currency format with negative in red <br/> formatindex="14"
147 const short CURRENCY_1000INT_RED
= CURRENCY_START
+2;
148 /// #,##0.00 DM <br/>Decimal currency format with negative in red <br/> formatindex="15"
149 const short CURRENCY_1000DEC2_RED
= CURRENCY_START
+3;
150 /// #,##0.00 DEM <br/>Currency in ISO-4217 abbreviation format <br/> formatindex="16"
151 const short CURRENCY_1000DEC2_CCC
= CURRENCY_START
+4;
152 /// #,##0.-- DM <br/>Currency format with dash representing 0 in decimals <br/> formatindex="17"
153 const short CURRENCY_1000DEC2_DASHED
= CURRENCY_START
+5;
154 /// End of Currency formats (last format)
155 const short CURRENCY_END
= CURRENCY_1000DEC2_DASHED
;
158 /// Start of Date formats (first format)
159 const short DATE_START
= CURRENCY_END
+1;
160 /// 08.10.97 <br/> see also DATE_SYSTEM_... <a href="#SYSTEM">explanation</a> <br/> formatindex="18"
161 const short DATE_SYSTEM_SHORT
= DATE_START
;
162 /** Wednesday, 8. October 1997 <br/> see also DATE_SYSTEM_... <a href="#SYSTEM">explanation</a>
163 <br/> formatindex="19" */
164 const short DATE_SYSTEM_LONG
= DATE_START
+1;
165 /// 08.10.97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="20"
166 const short DATE_SYS_DDMMYY
= DATE_START
+2;
167 /** 08.10.1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a>
168 <br/><b>Note:</b> When editing already existing date data this
169 format is forced in order to always edit the full century.
170 <br/> formatindex="21" */
171 const short DATE_SYS_DDMMYYYY
= DATE_START
+3;
172 /// 8. Oct 97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="22"
173 const short DATE_SYS_DMMMYY
= DATE_START
+4;
174 /// 8. Oct 1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="23"
175 const short DATE_SYS_DMMMYYYY
= DATE_START
+5;
176 /// 8. Oct. 1997 <br/> DIN/EN <br/> formatindex="24"
177 const short DATE_DIN_DMMMYYYY
= DATE_START
+6;
178 /// 8. October 1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="25"
179 const short DATE_SYS_DMMMMYYYY
= DATE_START
+7;
180 /// 8. October 1997 <br/> DIN/EN <br/> formatindex="26"
181 const short DATE_DIN_DMMMMYYYY
= DATE_START
+8;
182 /// Wed, 8. Oct 97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="27"
183 const short DATE_SYS_NNDMMMYY
= DATE_START
+9;
184 /// Wed 08.Oct 97 <br/> see also DATE_DEF_... <a href="#DEF">explanation</a> <br/> formatindex="28"
185 const short DATE_DEF_NNDDMMMYY
= DATE_START
+10;
186 /// Wed, 8. October 1997 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="29"
187 const short DATE_SYS_NNDMMMMYYYY
= DATE_START
+11;
188 /// Wednesday, 8. October 1997 <br/> formatindex="30"
189 const short DATE_SYS_NNNNDMMMMYYYY
= DATE_START
+12;
190 /// 10-08 <br/> DIN/EN <br/> formatindex="31"
191 const short DATE_DIN_MMDD
= DATE_START
+13;
192 /// 97-10-08 <br/> DIN/EN <br/> formatindex="32"
193 const short DATE_DIN_YYMMDD
= DATE_START
+14;
194 /// 1997-10-08 <br/> DIN/EN/ISO <br/> formatindex="33"
195 const short DATE_DIN_YYYYMMDD
= DATE_START
+15;
196 /// 10.97 <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="34"
197 const short DATE_SYS_MMYY
= DATE_START
+16;
198 /// 08.Oct <br/> see also DATE_SYS_... <a href="#SYS">explanation</a> <br/> formatindex="35"
199 const short DATE_SYS_DDMMM
= DATE_START
+17;
200 /// October <br/> formatindex="36"
201 const short DATE_MMMM
= DATE_START
+18;
202 /// 4th quarter 97 <br/> formatindex="37"
203 const short DATE_QQJJ
= DATE_START
+19;
204 /// week of year <br/> formatindex="38"
205 const short DATE_WW
= DATE_START
+20;
206 /// End of Date formats (last format)
207 const short DATE_END
= DATE_WW
;
210 /// Start of Time formats (first format)
211 const short TIME_START
= DATE_END
+1;
212 /// HH:MM <br/>Time format with hour and minute <br/> formatindex="39"
213 const short TIME_HHMM
= TIME_START
;
214 /// HH:MM:SS <br/>Time format with hour, minute and second <br/> formatindex="40"
215 const short TIME_HHMMSS
= TIME_START
+1;
216 /// HH:MM AM/PM <br/>Time format with hour, minute and morning/afternoon notation <br/> formatindex="41"
217 const short TIME_HHMMAMPM
= TIME_START
+2;
218 /// HH:MM:SS AM/PM <br/>Time format with hour, minute, second and morning/afternoon notation <br/> formatindex="42"
219 const short TIME_HHMMSSAMPM
= TIME_START
+3;
220 /// [HH]:MM:SS <br/>Time format with amount of hours <br/> formatindex="43"
221 const short TIME_HH_MMSS
= TIME_START
+4;
222 /// MM:SS,00 <br/>Time format with second in fraction <br/> formatindex="44"
223 const short TIME_MMSS00
= TIME_START
+5;
224 /// [HH]:MM:SS,00 <br/>Time format with amount of hours and seconds with fraction <br/> formatindex="45"
225 const short TIME_HH_MMSS00
= TIME_START
+6;
226 /// End of Time formats (last format)
227 const short TIME_END
= TIME_HH_MMSS00
;
230 /// Start of DateTime formats (first format)
231 const short DATETIME_START
= TIME_END
+ 1;
232 /// 08.10.97 01:23 Date/time format <br/> formatindex="46"
233 const short DATETIME_SYSTEM_SHORT_HHMM
= DATETIME_START
;
234 /** 08.10.1997 01:23:45 Date/time format with second
235 <br/><b>Note:</b> When editing already existing date/time data this
236 format is forced in order to always edit the full century.
237 <br/> formatindex="47" */
238 const short DATETIME_SYS_DDMMYYYY_HHMMSS
= DATETIME_START
+1;
239 /// End of DateTime formats (last format)
240 const short DATETIME_END
= DATETIME_SYS_DDMMYYYY_HHMMSS
;
247 <b>Not</b> defined in locale data, but generated by the number
248 formatter. If you want to access this format you <b>MUST</b>
249 do it via com::sun::star::util::XNumberFormatTypes::getFormatIndex()
250 instead of XNumberFormatCode::getFormatCode().
251 <br/> reserved formatindex="48"
253 const short BOOLEAN = DATETIME_END
+1;
259 <b>Not</b> defined in locale data, but generated by the number
260 formatter. If you want to access this format you <b>MUST</b>
261 do it via com::sun::star::util::XNumberFormatTypes::getFormatIndex()
262 instead of XNumberFormatCode::getFormatCode()
263 <br/> reserved formatindex="49"
265 const short TEXT
= BOOLEAN+1;
267 /// count of built-in format codes.
268 const short INDEX_TABLE_ENTRIES
= TEXT
+1;
275 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */