1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: CalendarFieldIndex.idl,v $
10 * $Revision: 1.12.128.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef __com_sun_star_i18n_CalendarFieldIndex_idl__
32 #define __com_sun_star_i18n_CalendarFieldIndex_idl__
34 //=============================================================================
36 module com
{ module sun
{ module star
{ module i18n
{
38 //=============================================================================
42 Field indices to be passed to various <type>XCalendar</type> methods.
44 <p> Field is writable only if marked both Get/Set. </p>
46 <p> ZONE_OFFSET and DST_OFFSET cooperate such that both values are added,
47 for example, ZoneOffset=1*60 and DstOffset=1*60 results in a time
48 difference of GMT+2. The calculation in minutes is
49 GMT = LocalTime - ZoneOffset - DstOffset </p>
51 <p> With introduction of ZONE_OFFSET_SECOND_MILLIS and
52 DST_OFFSET_SECOND_MILLIS the exact calculation in milliseconds is
54 - (ZoneOffset*60000 + ZoneOffsetMillis * sign(ZoneOffset))
55 - (DstOffset*60000 + DstOffsetMillis * sign(DstOffset))
58 published constants CalendarFieldIndex
60 /// Get <type>AmPmValue</type>.
61 const short AM_PM
= 0;
62 /// Get/Set day of month [1-31].
63 const short DAY_OF_MONTH
= 1;
64 /// Get day of week [0-6].
65 const short DAY_OF_WEEK
= 2;
67 const short DAY_OF_YEAR
= 3;
68 /** Get daylight saving time offset in minutes, e.g. [0*60..1*60]
69 <p> The DST offset value depends on the actual date set at the
70 calendar and is determined according to the timezone rules of
71 the locale used with the calendar. </p>
72 <p> Note that there is a bug in OpenOffice.org 1.0 / StarOffice 6.0
73 that prevents interpreting this value correctly. </p> */
74 const short DST_OFFSET
= 4;
75 /// Get/Set hour [0-23].
77 /// Get/Set minute [0-59].
78 const short MINUTE
= 6;
79 /// Get/Set second [0-59].
80 const short SECOND
= 7;
81 /// Get/Set milliseconds [0-999].
82 const short MILLISECOND
= 8;
83 /// Get week of month.
84 const short WEEK_OF_MONTH
= 9;
86 const short WEEK_OF_YEAR
= 10;
88 const short YEAR
= 11;
89 /** Get/Set month [0-...].
90 <p> Note that the maximum value is <b>not</b> necessarily 11 for
91 December but depends on the calendar used instead. </p> */
92 const short MONTH
= 12;
93 /// Get/Set era, for example, 0:= Before Christ, 1:= After Christ.
95 /// Get/Set time zone offset in minutes, e.g. [-14*60..14*60]
96 const short ZONE_OFFSET
= 14;
98 /// Total number of fields for < OOo 3.1
99 const short FIELD_COUNT
= 15;
101 /** Get/Set additional offset in milliseconds that <b>adds</b> to
102 the value of ZONE_OFFSET. This may be necessary to correctly
103 interpret historical timezone data that consists of fractions of
104 minutes, e.g. seconds. 1 minute == 60000 milliseconds.
106 @ATTENTION! Though the field's type is signed 16-bit, the field
107 value is treated as unsigned 16-bit to allow for values up to
108 60000 and expresses an absolute value that inherits its sign
109 from the parent ZONE_OFFSET field.
113 const short ZONE_OFFSET_SECOND_MILLIS
= 15;
115 /** Get additional offset in milliseconds that <b>adds</b> to
116 the value of DST_OFFSET. This may be necessary to correctly
117 interpret historical timezone data that consists of fractions of
118 minutes, e.g. seconds. 1 minute == 60000 milliseconds.
120 @ATTENTION! Though the field's type is signed 16-bit, the field
121 value is treated as unsigned 16-bit to allow for values up to
122 60000 and expresses an absolute value that inherits its sign
123 from the parent DST_OFFSET field.
127 const short DST_OFFSET_SECOND_MILLIS
= 16;
129 /** Total number of fields as of OOo 3.1
133 const short FIELD_COUNT2
= 17;
137 //=============================================================================