1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_i18n_CalendarFieldIndex_idl__
29#define __com_sun_star_i18n_CalendarFieldIndex_idl__
30
31//=============================================================================
32
33module com { module sun { module star { module i18n {
34
35//=============================================================================
36
37
38/**
39    Field indices to be passed to various <type>XCalendar</type> methods.
40
41    <p> Field is writable only if marked both Get/Set. </p>
42
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>
47
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>
54 */
55published constants CalendarFieldIndex
56{
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;
94
95    /// Total number of fields for &lt; OOo 3.1
96    const short FIELD_COUNT     = 15;
97
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.
102
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.
107
108        @since OOo 3.1
109     */
110    const short ZONE_OFFSET_SECOND_MILLIS = 15;
111
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.
116
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.
121
122        @since OOo 3.1
123     */
124    const short DST_OFFSET_SECOND_MILLIS  = 16;
125
126    /** Total number of fields as of OOo 3.1
127
128        @since OOo 3.1
129     */
130    const short FIELD_COUNT2              = 17;
131
132};
133
134//=============================================================================
135}; }; }; };
136
137#endif
138