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_CalendarFieldIndex_idl__ 29*cdf0e10cSrcweir#define __com_sun_star_i18n_CalendarFieldIndex_idl__ 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir//============================================================================= 32*cdf0e10cSrcweir 33*cdf0e10cSrcweirmodule com { module sun { module star { module i18n { 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir//============================================================================= 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir/** 39*cdf0e10cSrcweir Field indices to be passed to various <type>XCalendar</type> methods. 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir <p> Field is writable only if marked both Get/Set. </p> 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir <p> ZONE_OFFSET and DST_OFFSET cooperate such that both values are added, 44*cdf0e10cSrcweir for example, ZoneOffset=1*60 and DstOffset=1*60 results in a time 45*cdf0e10cSrcweir difference of GMT+2. The calculation in minutes is 46*cdf0e10cSrcweir GMT = LocalTime - ZoneOffset - DstOffset </p> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir <p> With introduction of ZONE_OFFSET_SECOND_MILLIS and 49*cdf0e10cSrcweir DST_OFFSET_SECOND_MILLIS the exact calculation in milliseconds is 50*cdf0e10cSrcweir GMT = LocalTime 51*cdf0e10cSrcweir - (ZoneOffset*60000 + ZoneOffsetMillis * sign(ZoneOffset)) 52*cdf0e10cSrcweir - (DstOffset*60000 + DstOffsetMillis * sign(DstOffset)) 53*cdf0e10cSrcweir <p> 54*cdf0e10cSrcweir */ 55*cdf0e10cSrcweirpublished constants CalendarFieldIndex 56*cdf0e10cSrcweir{ 57*cdf0e10cSrcweir /// Get <type>AmPmValue</type>. 58*cdf0e10cSrcweir const short AM_PM = 0; 59*cdf0e10cSrcweir /// Get/Set day of month [1-31]. 60*cdf0e10cSrcweir const short DAY_OF_MONTH = 1; 61*cdf0e10cSrcweir /// Get day of week [0-6]. 62*cdf0e10cSrcweir const short DAY_OF_WEEK = 2; 63*cdf0e10cSrcweir /// Get day of year. 64*cdf0e10cSrcweir const short DAY_OF_YEAR = 3; 65*cdf0e10cSrcweir /** Get daylight saving time offset in minutes, e.g. [0*60..1*60] 66*cdf0e10cSrcweir <p> The DST offset value depends on the actual date set at the 67*cdf0e10cSrcweir calendar and is determined according to the timezone rules of 68*cdf0e10cSrcweir the locale used with the calendar. </p> 69*cdf0e10cSrcweir <p> Note that there is a bug in OpenOffice.org 1.0 / StarOffice 6.0 70*cdf0e10cSrcweir that prevents interpreting this value correctly. </p> */ 71*cdf0e10cSrcweir const short DST_OFFSET = 4; 72*cdf0e10cSrcweir /// Get/Set hour [0-23]. 73*cdf0e10cSrcweir const short HOUR = 5; 74*cdf0e10cSrcweir /// Get/Set minute [0-59]. 75*cdf0e10cSrcweir const short MINUTE = 6; 76*cdf0e10cSrcweir /// Get/Set second [0-59]. 77*cdf0e10cSrcweir const short SECOND = 7; 78*cdf0e10cSrcweir /// Get/Set milliseconds [0-999]. 79*cdf0e10cSrcweir const short MILLISECOND = 8; 80*cdf0e10cSrcweir /// Get week of month. 81*cdf0e10cSrcweir const short WEEK_OF_MONTH = 9; 82*cdf0e10cSrcweir /// Get week of year. 83*cdf0e10cSrcweir const short WEEK_OF_YEAR = 10; 84*cdf0e10cSrcweir /// Get/Set year. 85*cdf0e10cSrcweir const short YEAR = 11; 86*cdf0e10cSrcweir /** Get/Set month [0-...]. 87*cdf0e10cSrcweir <p> Note that the maximum value is <b>not</b> necessarily 11 for 88*cdf0e10cSrcweir December but depends on the calendar used instead. </p> */ 89*cdf0e10cSrcweir const short MONTH = 12; 90*cdf0e10cSrcweir /// Get/Set era, for example, 0:= Before Christ, 1:= After Christ. 91*cdf0e10cSrcweir const short ERA = 13; 92*cdf0e10cSrcweir /// Get/Set time zone offset in minutes, e.g. [-14*60..14*60] 93*cdf0e10cSrcweir const short ZONE_OFFSET = 14; 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir /// Total number of fields for < OOo 3.1 96*cdf0e10cSrcweir const short FIELD_COUNT = 15; 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir /** Get/Set additional offset in milliseconds that <b>adds</b> to 99*cdf0e10cSrcweir the value of ZONE_OFFSET. This may be necessary to correctly 100*cdf0e10cSrcweir interpret historical timezone data that consists of fractions of 101*cdf0e10cSrcweir minutes, e.g. seconds. 1 minute == 60000 milliseconds. 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir @ATTENTION! Though the field's type is signed 16-bit, the field 104*cdf0e10cSrcweir value is treated as unsigned 16-bit to allow for values up to 105*cdf0e10cSrcweir 60000 and expresses an absolute value that inherits its sign 106*cdf0e10cSrcweir from the parent ZONE_OFFSET field. 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir @since OOo 3.1 109*cdf0e10cSrcweir */ 110*cdf0e10cSrcweir const short ZONE_OFFSET_SECOND_MILLIS = 15; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir /** Get additional offset in milliseconds that <b>adds</b> to 113*cdf0e10cSrcweir the value of DST_OFFSET. This may be necessary to correctly 114*cdf0e10cSrcweir interpret historical timezone data that consists of fractions of 115*cdf0e10cSrcweir minutes, e.g. seconds. 1 minute == 60000 milliseconds. 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir @ATTENTION! Though the field's type is signed 16-bit, the field 118*cdf0e10cSrcweir value is treated as unsigned 16-bit to allow for values up to 119*cdf0e10cSrcweir 60000 and expresses an absolute value that inherits its sign 120*cdf0e10cSrcweir from the parent DST_OFFSET field. 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir @since OOo 3.1 123*cdf0e10cSrcweir */ 124*cdf0e10cSrcweir const short DST_OFFSET_SECOND_MILLIS = 16; 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir /** Total number of fields as of OOo 3.1 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir @since OOo 3.1 129*cdf0e10cSrcweir */ 130*cdf0e10cSrcweir const short FIELD_COUNT2 = 17; 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir}; 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir//============================================================================= 135*cdf0e10cSrcweir}; }; }; }; 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir#endif 138