core_foundation_sys/
date_formatter.rs1use std::os::raw::c_void;
11
12use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFRange, CFTypeID, CFTypeRef};
13use crate::date::{CFAbsoluteTime, CFDateRef};
14use crate::locale::CFLocaleRef;
15use crate::string::CFStringRef;
16
17#[repr(C)]
18pub struct __CFDateFormatter(c_void);
19pub type CFDateFormatterRef = *mut __CFDateFormatter;
20
21pub type CFDateFormatterKey = CFStringRef;
22pub type CFDateFormatterStyle = CFIndex;
23pub type CFISO8601DateFormatOptions = CFOptionFlags;
24
25pub const kCFDateFormatterNoStyle: CFDateFormatterStyle = 0;
27pub const kCFDateFormatterShortStyle: CFDateFormatterStyle = 1;
28pub const kCFDateFormatterMediumStyle: CFDateFormatterStyle = 2;
29pub const kCFDateFormatterLongStyle: CFDateFormatterStyle = 3;
30pub const kCFDateFormatterFullStyle: CFDateFormatterStyle = 4;
31
32extern "C" {
48 pub static kCFDateFormatterIsLenient: CFDateFormatterKey; pub static kCFDateFormatterTimeZone: CFDateFormatterKey; pub static kCFDateFormatterCalendarName: CFDateFormatterKey; pub static kCFDateFormatterDefaultFormat: CFDateFormatterKey; pub static kCFDateFormatterTwoDigitStartDate: CFDateFormatterKey; pub static kCFDateFormatterDefaultDate: CFDateFormatterKey; pub static kCFDateFormatterCalendar: CFDateFormatterKey; pub static kCFDateFormatterEraSymbols: CFDateFormatterKey; pub static kCFDateFormatterMonthSymbols: CFDateFormatterKey; pub static kCFDateFormatterShortMonthSymbols: CFDateFormatterKey; pub static kCFDateFormatterWeekdaySymbols: CFDateFormatterKey; pub static kCFDateFormatterShortWeekdaySymbols: CFDateFormatterKey; pub static kCFDateFormatterAMSymbol: CFDateFormatterKey; pub static kCFDateFormatterPMSymbol: CFDateFormatterKey; pub static kCFDateFormatterLongEraSymbols: CFDateFormatterKey; pub static kCFDateFormatterVeryShortMonthSymbols: CFDateFormatterKey; pub static kCFDateFormatterStandaloneMonthSymbols: CFDateFormatterKey; pub static kCFDateFormatterShortStandaloneMonthSymbols: CFDateFormatterKey; pub static kCFDateFormatterVeryShortStandaloneMonthSymbols: CFDateFormatterKey; pub static kCFDateFormatterVeryShortWeekdaySymbols: CFDateFormatterKey; pub static kCFDateFormatterStandaloneWeekdaySymbols: CFDateFormatterKey; pub static kCFDateFormatterShortStandaloneWeekdaySymbols: CFDateFormatterKey; pub static kCFDateFormatterVeryShortStandaloneWeekdaySymbols: CFDateFormatterKey; pub static kCFDateFormatterQuarterSymbols: CFDateFormatterKey; pub static kCFDateFormatterShortQuarterSymbols: CFDateFormatterKey; pub static kCFDateFormatterStandaloneQuarterSymbols: CFDateFormatterKey; pub static kCFDateFormatterShortStandaloneQuarterSymbols: CFDateFormatterKey; pub static kCFDateFormatterGregorianStartDate: CFDateFormatterKey; pub static kCFDateFormatterDoesRelativeDateFormattingKey: CFDateFormatterKey; pub fn CFDateFormatterCreate(
87 allocator: CFAllocatorRef,
88 locale: CFLocaleRef,
89 dateStyle: CFDateFormatterStyle,
90 timeStyle: CFDateFormatterStyle,
91 ) -> CFDateFormatterRef;
92
93 pub fn CFDateFormatterSetFormat(formatter: CFDateFormatterRef, formatString: CFStringRef);
95 pub fn CFDateFormatterSetProperty(
96 formatter: CFDateFormatterRef,
97 key: CFStringRef,
98 value: CFTypeRef,
99 );
100
101 pub fn CFDateFormatterCreateDateFromString(
103 allocator: CFAllocatorRef,
104 formatter: CFDateFormatterRef,
105 string: CFStringRef,
106 rangep: *mut CFRange,
107 ) -> CFDateRef;
108 pub fn CFDateFormatterGetAbsoluteTimeFromString(
109 formatter: CFDateFormatterRef,
110 string: CFStringRef,
111 rangep: *mut CFRange,
112 atp: *mut CFAbsoluteTime,
113 ) -> Boolean;
114
115 pub fn CFDateFormatterCreateStringWithAbsoluteTime(
117 allocator: CFAllocatorRef,
118 formatter: CFDateFormatterRef,
119 at: CFAbsoluteTime,
120 ) -> CFStringRef;
121 pub fn CFDateFormatterCreateStringWithDate(
122 allocator: CFAllocatorRef,
123 formatter: CFDateFormatterRef,
124 date: CFDateRef,
125 ) -> CFStringRef;
126 pub fn CFDateFormatterCreateDateFormatFromTemplate(
127 allocator: CFAllocatorRef,
128 tmplate: CFStringRef,
129 options: CFOptionFlags,
130 locale: CFLocaleRef,
131 ) -> CFStringRef;
132
133 pub fn CFDateFormatterCopyProperty(
135 formatter: CFDateFormatterRef,
136 key: CFDateFormatterKey,
137 ) -> CFTypeRef;
138 pub fn CFDateFormatterGetDateStyle(formatter: CFDateFormatterRef) -> CFDateFormatterStyle;
139 pub fn CFDateFormatterGetFormat(formatter: CFDateFormatterRef) -> CFStringRef;
140 pub fn CFDateFormatterGetLocale(formatter: CFDateFormatterRef) -> CFLocaleRef;
141 pub fn CFDateFormatterGetTimeStyle(formatter: CFDateFormatterRef) -> CFDateFormatterStyle;
142
143 pub fn CFDateFormatterGetTypeID() -> CFTypeID;
145
146 }