summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/i18n/CalendarFieldIndex.idl
blob: a2606f229d05d0c1b07b71c9331515d039e81333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/

#ifndef __com_sun_star_i18n_CalendarFieldIndex_idl__
#define __com_sun_star_i18n_CalendarFieldIndex_idl__

//=============================================================================

module com { module sun { module star { module i18n {

//=============================================================================


/**
    Field indices to be passed to various <type>XCalendar</type> methods.

    <p> Field is writable only if marked both Get/Set. </p>

    <p> ZONE_OFFSET and DST_OFFSET cooperate such that both values are added,
    for example, ZoneOffset=1*60 and DstOffset=1*60 results in a time
    difference of GMT+2. The calculation in minutes is
    GMT = LocalTime - ZoneOffset - DstOffset </p>

    <p> With introduction of ZONE_OFFSET_SECOND_MILLIS and
    DST_OFFSET_SECOND_MILLIS the exact calculation in milliseconds is
    GMT = LocalTime
        - (ZoneOffset*60000 + ZoneOffsetMillis * sign(ZoneOffset))
        - (DstOffset*60000 + DstOffsetMillis * sign(DstOffset))
    <p>
 */
published constants CalendarFieldIndex
{
    /// Get     <type>AmPmValue</type>.
    const short AM_PM           = 0;
    /// Get/Set day of month [1-31].
    const short DAY_OF_MONTH    = 1;
    /// Get     day of week [0-6].
    const short DAY_OF_WEEK     = 2;
    /// Get     day of  year.
    const short DAY_OF_YEAR     = 3;
    /** Get     daylight saving time offset in minutes, e.g. [0*60..1*60]
        <p> The DST offset value depends on the actual date set at the
        calendar and is determined according to the timezone rules of
        the locale used with the calendar. </p>
        <p> Note that there is a bug in OpenOffice.org 1.0 / StarOffice 6.0
        that prevents interpreting this value correctly. </p> */
    const short DST_OFFSET      = 4;
    /// Get/Set hour [0-23].
    const short HOUR            = 5;
    /// Get/Set minute [0-59].
    const short MINUTE          = 6;
    /// Get/Set second [0-59].
    const short SECOND          = 7;
    /// Get/Set milliseconds [0-999].
    const short MILLISECOND     = 8;
    /// Get     week of month.
    const short WEEK_OF_MONTH   = 9;
    /// Get     week of year.
    const short WEEK_OF_YEAR    = 10;
    /// Get/Set year.
    const short YEAR            = 11;
    /** Get/Set month [0-...].
        <p> Note that the maximum value is <b>not</b> necessarily 11 for
        December but depends on the calendar used instead. </p> */
    const short MONTH           = 12;
    /// Get/Set era, for example, 0:= Before Christ, 1:= After Christ.
    const short ERA             = 13;
    /// Get/Set time zone offset in minutes, e.g. [-14*60..14*60]
    const short ZONE_OFFSET     = 14;

    /// Total number of fields for &lt; OOo 3.1
    const short FIELD_COUNT     = 15;

    /** Get/Set additional offset in milliseconds that <b>adds</b> to
        the value of ZONE_OFFSET. This may be necessary to correctly
        interpret historical timezone data that consists of fractions of
        minutes, e.g. seconds. 1 minute == 60000 milliseconds.

        @ATTENTION! Though the field's type is signed 16-bit, the field
        value is treated as unsigned 16-bit to allow for values up to
        60000 and expresses an absolute value that inherits its sign
        from the parent ZONE_OFFSET field.

        @since OOo 3.1
     */
    const short ZONE_OFFSET_SECOND_MILLIS = 15;

    /** Get     additional offset in milliseconds that <b>adds</b> to
        the value of DST_OFFSET. This may be necessary to correctly
        interpret historical timezone data that consists of fractions of
        minutes, e.g. seconds. 1 minute == 60000 milliseconds.

        @ATTENTION! Though the field's type is signed 16-bit, the field
        value is treated as unsigned 16-bit to allow for values up to
        60000 and expresses an absolute value that inherits its sign
        from the parent DST_OFFSET field.

        @since OOo 3.1
     */
    const short DST_OFFSET_SECOND_MILLIS  = 16;

    /** Total number of fields as of OOo 3.1

        @since OOo 3.1
     */
    const short FIELD_COUNT2              = 17;

};

//=============================================================================
}; }; }; };

#endif