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