GNUstep CoreBase Library 0.2
CFCalendar.h
1/* CFCalendar.h
2
3 Copyright (C) 2011 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: March, 2011
7
8 This file is part of the GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library 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 GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFCALENDAR__
28#define __COREFOUNDATION_CFCALENDAR__ 1
29
30#include <CoreFoundation/CFBase.h>
31#include <CoreFoundation/CFDate.h>
32#include <CoreFoundation/CFLocale.h>
33
34#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
35
36CF_EXTERN_C_BEGIN
42typedef struct __CFCalendar *CFCalendarRef;
43
44typedef enum
45{
46 kCFCalendarUnitEra = (1UL << 1),
47 kCFCalendarUnitYear = (1UL << 2),
48 kCFCalendarUnitMonth = (1UL << 3),
49 kCFCalendarUnitDay = (1UL << 4),
50 kCFCalendarUnitHour = (1UL << 5),
51 kCFCalendarUnitMinute = (1UL << 6),
52 kCFCalendarUnitSecond = (1UL << 7),
53 kCFCalendarUnitWeek = (1UL << 8),
54 kCFCalendarUnitWeekday = (1UL << 9),
55 kCFCalendarUnitWeekdayOrdinal = (1UL << 10),
56#if OS_API_VERSION(MAC_OS_X_VERSION_10_6, GS_API_LATEST)
57 kCFCalendarUnitQuarter = (1UL << 11),
58#endif
59} CFCalendarUnit;
60
61enum
62{
63 kCFCalendarComponentsWrap = (1UL << 0)
64};
65
69CF_EXPORT CFCalendarRef CFCalendarCopyCurrent (void);
70
71CF_EXPORT CFCalendarRef
72CFCalendarCreateWithIdentifier (CFAllocatorRef allocator, CFStringRef ident);
78CF_EXPORT Boolean
79CFCalendarAddComponents (CFCalendarRef cal, CFAbsoluteTime * at,
80 CFOptionFlags options, const char *componentDesc, ...);
81
82CF_EXPORT Boolean
83CFCalendarComposeAbsoluteTime (CFCalendarRef cal, CFAbsoluteTime * at,
84 const char *componentDesc, ...);
85
86CF_EXPORT Boolean
87CFCalendarDecomposeAbsoluteTime (CFCalendarRef cal, CFAbsoluteTime at,
88 const char *componentDesc, ...);
89
90CF_EXPORT Boolean
91CFCalendarGetComponentDifference (CFCalendarRef cal, CFAbsoluteTime startinAT,
92 CFAbsoluteTime resultAT,
93 CFOptionFlags options,
94 const char *componentDesc, ...);
100CF_EXPORT CFRange
101CFCalendarGetRangeOfUnit (CFCalendarRef cal, CFCalendarUnit smallerUnit,
102 CFCalendarUnit biggerUnit, CFAbsoluteTime at);
103
104CF_EXPORT CFIndex
105CFCalendarGetOrdinalityOfUnit (CFCalendarRef cal, CFCalendarUnit smallerUnit,
106 CFCalendarUnit biggerUnit, CFAbsoluteTime at);
107
108CF_EXPORT CFRange
109CFCalendarGetMaximumRangeOfUnit (CFCalendarRef cal, CFCalendarUnit unit);
110
111CF_EXPORT CFRange
112CFCalendarGetMinimumRangeOfUnit (CFCalendarRef cal, CFCalendarUnit unit);
113
114#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
115CF_EXPORT Boolean
116CFCalendarGetTimeRangeOfUnit (CFCalendarRef cal, CFCalendarUnit unit,
117 CFAbsoluteTime at, CFAbsoluteTime * startp,
118 CFTimeInterval * tip);
119#endif
125CF_EXPORT CFTimeZoneRef CFCalendarCopyTimeZone (CFCalendarRef cal);
126
127CF_EXPORT void CFCalendarSetTimeZone (CFCalendarRef cal, CFTimeZoneRef tz);
133CF_EXPORT CFStringRef CFCalendarGetIdentifier (CFCalendarRef cal);
139CF_EXPORT CFLocaleRef CFCalendarCopyLocale (CFCalendarRef cal);
140
141CF_EXPORT void CFCalendarSetLocale (CFCalendarRef cal, CFLocaleRef locale);
147CF_EXPORT CFIndex CFCalendarGetFirstWeekday (CFCalendarRef cal);
148
149CF_EXPORT void CFCalendarSetFirstWeekday (CFCalendarRef cal, CFIndex wkdy);
150
151CF_EXPORT CFIndex CFCalendarGetMinimumDaysInFirstWeek (CFCalendarRef cal);
152
153CF_EXPORT void
154CFCalendarSetMinimumDaysInFirstWeek (CFCalendarRef cal, CFIndex mwd);
160CF_EXPORT CFTypeID CFCalendarGetTypeID (void);
164CF_EXTERN_C_END
165#endif /* MAC_OS_X_VERSION_10_4 */
166#endif /* __COREFOUNDATION_CFCALENDAR__ */
unsigned long CFOptionFlags
Definition CFBase.h:163
signed long CFIndex
Definition CFBase.h:165
Definition CFBase.h:172
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301
struct __CFCalendar * CFCalendarRef
Definition CFCalendar.h:42