1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef __com_sun_star_i18n_CalendarFieldIndex_idl__
21 #define __com_sun_star_i18n_CalendarFieldIndex_idl__
24 module com
{ module sun
{ module star
{ module i18n
{
29 Field indices to be passed to various XCalendar methods.
31 <p> Field is writable only if marked both Get/Set. </p>
33 <p> ZONE_OFFSET and DST_OFFSET cooperate such that both values are added,
34 for example, ZoneOffset=1*60 and DstOffset=1*60 results in a time
35 difference of GMT+2. The calculation in minutes is
36 GMT = LocalTime - ZoneOffset - DstOffset </p>
38 <p> With introduction of ZONE_OFFSET_SECOND_MILLIS and
39 DST_OFFSET_SECOND_MILLIS the exact calculation in milliseconds is
41 - (ZoneOffset*60000 + ZoneOffsetMillis * sign(ZoneOffset))
42 - (DstOffset*60000 + DstOffsetMillis * sign(DstOffset))
45 published constants CalendarFieldIndex
48 const short AM_PM
= 0;
49 /// Get/Set day of month [1-31].
50 const short DAY_OF_MONTH
= 1;
51 /// Get day of week [0-6].
52 const short DAY_OF_WEEK
= 2;
54 const short DAY_OF_YEAR
= 3;
55 /** Get daylight saving time offset in minutes, e.g. [0*60..1*60]
56 <p> The DST offset value depends on the actual date set at the
57 calendar and is determined according to the timezone rules of
58 the locale used with the calendar. </p>
59 <p> Note that there is a bug in OpenOffice.org 1.0 / StarOffice 6.0
60 that prevents interpreting this value correctly. </p> */
61 const short DST_OFFSET
= 4;
62 /// Get/Set hour [0-23].
64 /// Get/Set minute [0-59].
65 const short MINUTE
= 6;
66 /// Get/Set second [0-59].
67 const short SECOND
= 7;
68 /// Get/Set milliseconds [0-999].
69 const short MILLISECOND
= 8;
70 /// Get week of month.
71 const short WEEK_OF_MONTH
= 9;
73 const short WEEK_OF_YEAR
= 10;
75 const short YEAR
= 11;
76 /** Get/Set month [0-...].
77 <p> Note that the maximum value is <b>not</b> necessarily 11 for
78 December but depends on the calendar used instead. </p> */
79 const short MONTH
= 12;
80 /// Get/Set era, for example, 0:= Before Christ, 1:= After Christ.
82 /// Get/Set time zone offset in minutes, e.g. [-14*60..14*60]
83 const short ZONE_OFFSET
= 14;
85 /// Total number of fields for < OOo 3.1
86 const short FIELD_COUNT
= 15;
88 /** Get/Set additional offset in milliseconds that <b>adds</b> to
89 the value of ZONE_OFFSET. This may be necessary to correctly
90 interpret historical timezone data that consists of fractions of
91 minutes, e.g. seconds. 1 minute == 60000 milliseconds.
93 @attention Though the field's type is signed 16-bit, the field
94 value is treated as unsigned 16-bit to allow for values up to
95 60000 and expresses an absolute value that inherits its sign
96 from the parent ZONE_OFFSET field.
100 const short ZONE_OFFSET_SECOND_MILLIS
= 15;
102 /** Get additional offset in milliseconds that <b>adds</b> to
103 the value of DST_OFFSET. This may be necessary to correctly
104 interpret historical timezone data that consists of fractions of
105 minutes, e.g. seconds. 1 minute == 60000 milliseconds.
107 @attention Though the field's type is signed 16-bit, the field
108 value is treated as unsigned 16-bit to allow for values up to
109 60000 and expresses an absolute value that inherits its sign
110 from the parent DST_OFFSET field.
114 const short DST_OFFSET_SECOND_MILLIS
= 16;
116 /** Total number of fields as of OOo 3.1
120 const short FIELD_COUNT2
= 17;
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */