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