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