1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_i18n_CalendarFieldIndex_idl__
25cdf0e10cSrcweir#define __com_sun_star_i18n_CalendarFieldIndex_idl__
26cdf0e10cSrcweir
27cdf0e10cSrcweir//=============================================================================
28cdf0e10cSrcweir
29cdf0e10cSrcweirmodule com { module sun { module star { module i18n {
30cdf0e10cSrcweir
31cdf0e10cSrcweir//=============================================================================
32cdf0e10cSrcweir
33cdf0e10cSrcweir
34cdf0e10cSrcweir/**
35cdf0e10cSrcweir    Field indices to be passed to various <type>XCalendar</type> methods.
36cdf0e10cSrcweir
37cdf0e10cSrcweir    <p> Field is writable only if marked both Get/Set. </p>
38cdf0e10cSrcweir
39cdf0e10cSrcweir    <p> ZONE_OFFSET and DST_OFFSET cooperate such that both values are added,
40cdf0e10cSrcweir    for example, ZoneOffset=1*60 and DstOffset=1*60 results in a time
41cdf0e10cSrcweir    difference of GMT+2. The calculation in minutes is
42cdf0e10cSrcweir    GMT = LocalTime - ZoneOffset - DstOffset </p>
43cdf0e10cSrcweir
44cdf0e10cSrcweir    <p> With introduction of ZONE_OFFSET_SECOND_MILLIS and
45cdf0e10cSrcweir    DST_OFFSET_SECOND_MILLIS the exact calculation in milliseconds is
46cdf0e10cSrcweir    GMT = LocalTime
47cdf0e10cSrcweir        - (ZoneOffset*60000 + ZoneOffsetMillis * sign(ZoneOffset))
48cdf0e10cSrcweir        - (DstOffset*60000 + DstOffsetMillis * sign(DstOffset))
49cdf0e10cSrcweir    <p>
50cdf0e10cSrcweir */
51cdf0e10cSrcweirpublished constants CalendarFieldIndex
52cdf0e10cSrcweir{
53cdf0e10cSrcweir    /// Get     <type>AmPmValue</type>.
54cdf0e10cSrcweir    const short AM_PM           = 0;
55cdf0e10cSrcweir    /// Get/Set day of month [1-31].
56cdf0e10cSrcweir    const short DAY_OF_MONTH    = 1;
57cdf0e10cSrcweir    /// Get     day of week [0-6].
58cdf0e10cSrcweir    const short DAY_OF_WEEK     = 2;
59cdf0e10cSrcweir    /// Get     day of  year.
60cdf0e10cSrcweir    const short DAY_OF_YEAR     = 3;
61cdf0e10cSrcweir    /** Get     daylight saving time offset in minutes, e.g. [0*60..1*60]
62cdf0e10cSrcweir        <p> The DST offset value depends on the actual date set at the
63cdf0e10cSrcweir        calendar and is determined according to the timezone rules of
64cdf0e10cSrcweir        the locale used with the calendar. </p>
65cdf0e10cSrcweir        <p> Note that there is a bug in OpenOffice.org 1.0 / StarOffice 6.0
66cdf0e10cSrcweir        that prevents interpreting this value correctly. </p> */
67cdf0e10cSrcweir    const short DST_OFFSET      = 4;
68cdf0e10cSrcweir    /// Get/Set hour [0-23].
69cdf0e10cSrcweir    const short HOUR            = 5;
70cdf0e10cSrcweir    /// Get/Set minute [0-59].
71cdf0e10cSrcweir    const short MINUTE          = 6;
72cdf0e10cSrcweir    /// Get/Set second [0-59].
73cdf0e10cSrcweir    const short SECOND          = 7;
74cdf0e10cSrcweir    /// Get/Set milliseconds [0-999].
75cdf0e10cSrcweir    const short MILLISECOND     = 8;
76cdf0e10cSrcweir    /// Get     week of month.
77cdf0e10cSrcweir    const short WEEK_OF_MONTH   = 9;
78cdf0e10cSrcweir    /// Get     week of year.
79cdf0e10cSrcweir    const short WEEK_OF_YEAR    = 10;
80cdf0e10cSrcweir    /// Get/Set year.
81cdf0e10cSrcweir    const short YEAR            = 11;
82cdf0e10cSrcweir    /** Get/Set month [0-...].
83cdf0e10cSrcweir        <p> Note that the maximum value is <b>not</b> necessarily 11 for
84cdf0e10cSrcweir        December but depends on the calendar used instead. </p> */
85cdf0e10cSrcweir    const short MONTH           = 12;
86cdf0e10cSrcweir    /// Get/Set era, for example, 0:= Before Christ, 1:= After Christ.
87cdf0e10cSrcweir    const short ERA             = 13;
88cdf0e10cSrcweir    /// Get/Set time zone offset in minutes, e.g. [-14*60..14*60]
89cdf0e10cSrcweir    const short ZONE_OFFSET     = 14;
90cdf0e10cSrcweir
91*d695a2a0SJürgen Schmidt    /// Total number of fields for &lt; OpenOffice 3.1
92cdf0e10cSrcweir    const short FIELD_COUNT     = 15;
93cdf0e10cSrcweir
94cdf0e10cSrcweir    /** Get/Set additional offset in milliseconds that <b>adds</b> to
95cdf0e10cSrcweir        the value of ZONE_OFFSET. This may be necessary to correctly
96cdf0e10cSrcweir        interpret historical timezone data that consists of fractions of
97cdf0e10cSrcweir        minutes, e.g. seconds. 1 minute == 60000 milliseconds.
98cdf0e10cSrcweir
99cdf0e10cSrcweir        @ATTENTION! Though the field's type is signed 16-bit, the field
100cdf0e10cSrcweir        value is treated as unsigned 16-bit to allow for values up to
101cdf0e10cSrcweir        60000 and expresses an absolute value that inherits its sign
102cdf0e10cSrcweir        from the parent ZONE_OFFSET field.
103cdf0e10cSrcweir
104*d695a2a0SJürgen Schmidt        @since OpenOffice 3.1
105cdf0e10cSrcweir     */
106cdf0e10cSrcweir    const short ZONE_OFFSET_SECOND_MILLIS = 15;
107cdf0e10cSrcweir
108cdf0e10cSrcweir    /** Get     additional offset in milliseconds that <b>adds</b> to
109cdf0e10cSrcweir        the value of DST_OFFSET. This may be necessary to correctly
110cdf0e10cSrcweir        interpret historical timezone data that consists of fractions of
111cdf0e10cSrcweir        minutes, e.g. seconds. 1 minute == 60000 milliseconds.
112cdf0e10cSrcweir
113cdf0e10cSrcweir        @ATTENTION! Though the field's type is signed 16-bit, the field
114cdf0e10cSrcweir        value is treated as unsigned 16-bit to allow for values up to
115cdf0e10cSrcweir        60000 and expresses an absolute value that inherits its sign
116cdf0e10cSrcweir        from the parent DST_OFFSET field.
117cdf0e10cSrcweir
118*d695a2a0SJürgen Schmidt        @since OpenOffice 3.1
119cdf0e10cSrcweir     */
120cdf0e10cSrcweir    const short DST_OFFSET_SECOND_MILLIS  = 16;
121cdf0e10cSrcweir
122*d695a2a0SJürgen Schmidt    /** Total number of fields as of OpenOffice 3.1
123cdf0e10cSrcweir
124*d695a2a0SJürgen Schmidt        @since OpenOffice 3.1
125cdf0e10cSrcweir     */
126cdf0e10cSrcweir    const short FIELD_COUNT2              = 17;
127cdf0e10cSrcweir
128cdf0e10cSrcweir};
129cdf0e10cSrcweir
130cdf0e10cSrcweir//=============================================================================
131cdf0e10cSrcweir}; }; }; };
132cdf0e10cSrcweir
133cdf0e10cSrcweir#endif
134