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