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