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