GNUstep CoreBase Library 0.2
CFDateFormatter.h
1/* CFDateFormatter.h
2
3 Copyright (C) 2011 Free Software Foundation, Inc.
4
5 Written by: Stefan Bidigaray
6 Date: December, 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_CFDATEFORMATTER_H__
28#define __COREFOUNDATION_CFDATEFORMATTER_H__
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_3, GS_API_LATEST)
35
36CF_EXTERN_C_BEGIN
40typedef struct __CFDateFormatter *CFDateFormatterRef;
41
42typedef enum _CFDateFormatterStyle
43{
44 kCFDateFormatterNoStyle = 0,
45 kCFDateFormatterShortStyle = 1,
46 kCFDateFormatterMediumStyle = 2,
47 kCFDateFormatterLongStyle = 3,
48 kCFDateFormatterFullStyle = 4
49} CFDateFormatterStyle;
50
54CF_EXPORT const CFStringRef kCFDateFormatterIsLenient; /* CFBoolean */
55CF_EXPORT const CFStringRef kCFDateFormatterTimeZone; /* CFTimeZone */
56CF_EXPORT const CFStringRef kCFDateFormatterCalendarName; /* CFString */
57CF_EXPORT const CFStringRef kCFDateFormatterDefaultFormat; /* CFString */
58#if OS_API_VERSION(MAC_OS_X_VERSION_10_4, GS_API_LATEST)
59CF_EXPORT const CFStringRef kCFDateFormatterTwoDigitStartDate; /* CFDate */
60CF_EXPORT const CFStringRef kCFDateFormatterDefaultDate; /* CFDate */
61CF_EXPORT const CFStringRef kCFDateFormatterCalendar; /* CFCalendar */
62CF_EXPORT const CFStringRef kCFDateFormatterEraSymbols; /* CFArray */
63CF_EXPORT const CFStringRef kCFDateFormatterMonthSymbols; /* CFArray */
64CF_EXPORT const CFStringRef kCFDateFormatterShortMonthSymbols; /* CFArray */
65CF_EXPORT const CFStringRef kCFDateFormatterWeekdaySymbols; /* CFArray */
66CF_EXPORT const CFStringRef kCFDateFormatterShortWeekdaySymbols; /* CFArray */
67CF_EXPORT const CFStringRef kCFDateFormatterAMSymbol; /* CFString */
68CF_EXPORT const CFStringRef kCFDateFormatterPMSymbol; /* CFString */
69#endif
70#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
71CF_EXPORT const CFStringRef kCFDateFormatterLongEraSymbols; /* CFArray */
72CF_EXPORT const CFStringRef kCFDateFormatterVeryShortMonthSymbols; /* CFArray */
73CF_EXPORT const CFStringRef kCFDateFormatterStandaloneMonthSymbols; /* CFArray */
74CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneMonthSymbols; /* CFArray */
75CF_EXPORT const CFStringRef kCFDateFormatterVeryShortStandaloneMonthSymbols; /* CFArray */
76CF_EXPORT const CFStringRef kCFDateFormatterVeryShortWeekdaySymbols; /* CFArray */
77CF_EXPORT const CFStringRef kCFDateFormatterStandaloneWeekdaySymbols; /* CFArray */
78CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneWeekdaySymbols; /* CFArray */
79CF_EXPORT const CFStringRef kCFDateFormatterVeryShortStandaloneWeekdaySymbols; /* CFArray */
80CF_EXPORT const CFStringRef kCFDateFormatterQuarterSymbols; /* CFArray */
81CF_EXPORT const CFStringRef kCFDateFormatterShortQuarterSymbols; /* CFArray */
82CF_EXPORT const CFStringRef kCFDateFormatterStandaloneQuarterSymbols; /* CFArray */
83CF_EXPORT const CFStringRef kCFDateFormatterShortStandaloneQuarterSymbols; /* CFArray */
84CF_EXPORT const CFStringRef kCFDateFormatterGregorianStartDate; /* CFDate */
85#endif
90CF_EXPORT CFDateFormatterRef
91CFDateFormatterCreate (CFAllocatorRef alloc, CFLocaleRef locale,
92 CFDateFormatterStyle dateStyle,
93 CFDateFormatterStyle timeStyle);
99CF_EXPORT void
100CFDateFormatterSetFormat (CFDateFormatterRef fmt, CFStringRef formatString);
101
102CF_EXPORT void
103CFDateFormatterSetProperty (CFDateFormatterRef fmt, CFStringRef key,
104 CFTypeRef value);
110CF_EXPORT CFDateRef
111CFDateFormatterCreateDateFromString (CFAllocatorRef alloc,
112 CFDateFormatterRef fmt, CFStringRef string,
113 CFRange * rangep);
114
115CF_EXPORT Boolean
116CFDateFormatterGetAbsoluteTimeFromString (CFDateFormatterRef fmt,
117 CFStringRef string, CFRange * rangep,
118 CFAbsoluteTime * atp);
124CF_EXPORT CFStringRef
125CFDateFormatterCreateStringWithAbsoluteTime (CFAllocatorRef alloc,
126 CFDateFormatterRef fmt,
127 CFAbsoluteTime at);
128
129CF_EXPORT CFStringRef
130CFDateFormatterCreateStringWithDate (CFAllocatorRef alloc,
131 CFDateFormatterRef fmt, CFDateRef date);
132
133CF_EXPORT CFStringRef
134CFDateFormatterCreateDateFormatFromTemplate (CFAllocatorRef alloc,
135 CFStringRef templ,
136 CFOptionFlags options,
137 CFLocaleRef locale);
143CF_EXPORT CFTypeRef
144CFDateFormatterCopyProperty (CFDateFormatterRef fmt, CFStringRef key);
145
146CF_EXPORT CFDateFormatterStyle
147CFDateFormatterGetDateStyle (CFDateFormatterRef fmt);
148
149CF_EXPORT CFStringRef CFDateFormatterGetFormat (CFDateFormatterRef fmt);
150
151CF_EXPORT CFLocaleRef CFDateFormatterGetLocale (CFDateFormatterRef fmt);
152
153CF_EXPORT CFDateFormatterStyle
154CFDateFormatterGetTimeStyle (CFDateFormatterRef fmt);
160CF_EXPORT CFTypeID CFDateFormatterGetTypeID (void);
164CF_EXTERN_C_END
165
166#endif /* MAC_OS_X_VERSION_10_3 */
167
168#endif /* __COREFOUNDATION_CFDATEFORMATTER_H__ */
169
unsigned long CFOptionFlags
Definition CFBase.h:163
Definition CFBase.h:172
const struct __CFAllocator * CFAllocatorRef
A reference to a CFAllocator object.
Definition CFBase.h:301