objc2_foundation/generated/
NSDateFormatter.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdateformatterstyle?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSDateFormatterStyle(pub NSUInteger);
14impl NSDateFormatterStyle {
15    #[doc(alias = "NSDateFormatterNoStyle")]
16    pub const NoStyle: Self = Self(0);
17    #[doc(alias = "NSDateFormatterShortStyle")]
18    pub const ShortStyle: Self = Self(1);
19    #[doc(alias = "NSDateFormatterMediumStyle")]
20    pub const MediumStyle: Self = Self(2);
21    #[doc(alias = "NSDateFormatterLongStyle")]
22    pub const LongStyle: Self = Self(3);
23    #[doc(alias = "NSDateFormatterFullStyle")]
24    pub const FullStyle: Self = Self(4);
25}
26
27unsafe impl Encode for NSDateFormatterStyle {
28    const ENCODING: Encoding = NSUInteger::ENCODING;
29}
30
31unsafe impl RefEncode for NSDateFormatterStyle {
32    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdateformatterbehavior?language=objc)
36// NS_ENUM
37#[repr(transparent)]
38#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
39pub struct NSDateFormatterBehavior(pub NSUInteger);
40impl NSDateFormatterBehavior {
41    #[doc(alias = "NSDateFormatterBehaviorDefault")]
42    pub const BehaviorDefault: Self = Self(0);
43    #[doc(alias = "NSDateFormatterBehavior10_0")]
44    pub const Behavior10_0: Self = Self(1000);
45    #[doc(alias = "NSDateFormatterBehavior10_4")]
46    pub const Behavior10_4: Self = Self(1040);
47}
48
49unsafe impl Encode for NSDateFormatterBehavior {
50    const ENCODING: Encoding = NSUInteger::ENCODING;
51}
52
53unsafe impl RefEncode for NSDateFormatterBehavior {
54    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
55}
56
57extern_class!(
58    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsdateformatter?language=objc)
59    #[unsafe(super(NSFormatter, NSObject))]
60    #[derive(Debug, PartialEq, Eq, Hash)]
61    #[cfg(feature = "NSFormatter")]
62    pub struct NSDateFormatter;
63);
64
65#[cfg(feature = "NSFormatter")]
66unsafe impl Send for NSDateFormatter {}
67
68#[cfg(feature = "NSFormatter")]
69unsafe impl Sync for NSDateFormatter {}
70
71#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
72extern_conformance!(
73    unsafe impl NSCoding for NSDateFormatter {}
74);
75
76#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
77extern_conformance!(
78    unsafe impl NSCopying for NSDateFormatter {}
79);
80
81#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
82unsafe impl CopyingHelper for NSDateFormatter {
83    type Result = Self;
84}
85
86#[cfg(feature = "NSFormatter")]
87extern_conformance!(
88    unsafe impl NSObjectProtocol for NSDateFormatter {}
89);
90
91#[cfg(feature = "NSFormatter")]
92impl NSDateFormatter {
93    extern_methods!(
94        #[unsafe(method(formattingContext))]
95        #[unsafe(method_family = none)]
96        pub fn formattingContext(&self) -> NSFormattingContext;
97
98        /// Setter for [`formattingContext`][Self::formattingContext].
99        #[unsafe(method(setFormattingContext:))]
100        #[unsafe(method_family = none)]
101        pub fn setFormattingContext(&self, formatting_context: NSFormattingContext);
102
103        #[cfg(all(feature = "NSError", feature = "NSRange", feature = "NSString"))]
104        /// # Safety
105        ///
106        /// - `obj` should be of the correct type.
107        /// - `rangep` must be a valid pointer or null.
108        #[unsafe(method(getObjectValue:forString:range:error:_))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn getObjectValue_forString_range_error(
111            &self,
112            obj: Option<&mut Option<Retained<AnyObject>>>,
113            string: &NSString,
114            rangep: *mut NSRange,
115        ) -> Result<(), Retained<NSError>>;
116
117        #[cfg(all(feature = "NSDate", feature = "NSString"))]
118        #[unsafe(method(stringFromDate:))]
119        #[unsafe(method_family = none)]
120        pub fn stringFromDate(&self, date: &NSDate) -> Retained<NSString>;
121
122        #[cfg(all(feature = "NSDate", feature = "NSString"))]
123        #[unsafe(method(dateFromString:))]
124        #[unsafe(method_family = none)]
125        pub fn dateFromString(&self, string: &NSString) -> Option<Retained<NSDate>>;
126
127        #[cfg(all(feature = "NSDate", feature = "NSString"))]
128        #[unsafe(method(localizedStringFromDate:dateStyle:timeStyle:))]
129        #[unsafe(method_family = none)]
130        pub fn localizedStringFromDate_dateStyle_timeStyle(
131            date: &NSDate,
132            dstyle: NSDateFormatterStyle,
133            tstyle: NSDateFormatterStyle,
134        ) -> Retained<NSString>;
135
136        #[cfg(all(feature = "NSLocale", feature = "NSString"))]
137        #[unsafe(method(dateFormatFromTemplate:options:locale:))]
138        #[unsafe(method_family = none)]
139        pub fn dateFormatFromTemplate_options_locale(
140            tmplate: &NSString,
141            opts: NSUInteger,
142            locale: Option<&NSLocale>,
143        ) -> Option<Retained<NSString>>;
144
145        #[unsafe(method(defaultFormatterBehavior))]
146        #[unsafe(method_family = none)]
147        pub fn defaultFormatterBehavior() -> NSDateFormatterBehavior;
148
149        /// Setter for [`defaultFormatterBehavior`][Self::defaultFormatterBehavior].
150        #[unsafe(method(setDefaultFormatterBehavior:))]
151        #[unsafe(method_family = none)]
152        pub fn setDefaultFormatterBehavior(default_formatter_behavior: NSDateFormatterBehavior);
153
154        #[cfg(feature = "NSString")]
155        #[unsafe(method(setLocalizedDateFormatFromTemplate:))]
156        #[unsafe(method_family = none)]
157        pub fn setLocalizedDateFormatFromTemplate(&self, date_format_template: &NSString);
158
159        #[cfg(feature = "NSString")]
160        #[unsafe(method(dateFormat))]
161        #[unsafe(method_family = none)]
162        pub fn dateFormat(&self) -> Retained<NSString>;
163
164        #[cfg(feature = "NSString")]
165        /// Setter for [`dateFormat`][Self::dateFormat].
166        ///
167        /// This is [copied][crate::NSCopying::copy] when set.
168        #[unsafe(method(setDateFormat:))]
169        #[unsafe(method_family = none)]
170        pub fn setDateFormat(&self, date_format: Option<&NSString>);
171
172        #[unsafe(method(dateStyle))]
173        #[unsafe(method_family = none)]
174        pub fn dateStyle(&self) -> NSDateFormatterStyle;
175
176        /// Setter for [`dateStyle`][Self::dateStyle].
177        #[unsafe(method(setDateStyle:))]
178        #[unsafe(method_family = none)]
179        pub fn setDateStyle(&self, date_style: NSDateFormatterStyle);
180
181        #[unsafe(method(timeStyle))]
182        #[unsafe(method_family = none)]
183        pub fn timeStyle(&self) -> NSDateFormatterStyle;
184
185        /// Setter for [`timeStyle`][Self::timeStyle].
186        #[unsafe(method(setTimeStyle:))]
187        #[unsafe(method_family = none)]
188        pub fn setTimeStyle(&self, time_style: NSDateFormatterStyle);
189
190        #[cfg(feature = "NSLocale")]
191        #[unsafe(method(locale))]
192        #[unsafe(method_family = none)]
193        pub fn locale(&self) -> Retained<NSLocale>;
194
195        #[cfg(feature = "NSLocale")]
196        /// Setter for [`locale`][Self::locale].
197        ///
198        /// This is [copied][crate::NSCopying::copy] when set.
199        #[unsafe(method(setLocale:))]
200        #[unsafe(method_family = none)]
201        pub fn setLocale(&self, locale: Option<&NSLocale>);
202
203        #[unsafe(method(generatesCalendarDates))]
204        #[unsafe(method_family = none)]
205        pub fn generatesCalendarDates(&self) -> bool;
206
207        /// Setter for [`generatesCalendarDates`][Self::generatesCalendarDates].
208        #[unsafe(method(setGeneratesCalendarDates:))]
209        #[unsafe(method_family = none)]
210        pub fn setGeneratesCalendarDates(&self, generates_calendar_dates: bool);
211
212        #[unsafe(method(formatterBehavior))]
213        #[unsafe(method_family = none)]
214        pub fn formatterBehavior(&self) -> NSDateFormatterBehavior;
215
216        /// Setter for [`formatterBehavior`][Self::formatterBehavior].
217        #[unsafe(method(setFormatterBehavior:))]
218        #[unsafe(method_family = none)]
219        pub fn setFormatterBehavior(&self, formatter_behavior: NSDateFormatterBehavior);
220
221        #[cfg(feature = "NSTimeZone")]
222        #[unsafe(method(timeZone))]
223        #[unsafe(method_family = none)]
224        pub fn timeZone(&self) -> Retained<NSTimeZone>;
225
226        #[cfg(feature = "NSTimeZone")]
227        /// Setter for [`timeZone`][Self::timeZone].
228        ///
229        /// This is [copied][crate::NSCopying::copy] when set.
230        #[unsafe(method(setTimeZone:))]
231        #[unsafe(method_family = none)]
232        pub fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
233
234        #[cfg(feature = "NSCalendar")]
235        #[unsafe(method(calendar))]
236        #[unsafe(method_family = none)]
237        pub fn calendar(&self) -> Retained<NSCalendar>;
238
239        #[cfg(feature = "NSCalendar")]
240        /// Setter for [`calendar`][Self::calendar].
241        ///
242        /// This is [copied][crate::NSCopying::copy] when set.
243        #[unsafe(method(setCalendar:))]
244        #[unsafe(method_family = none)]
245        pub fn setCalendar(&self, calendar: Option<&NSCalendar>);
246
247        #[unsafe(method(isLenient))]
248        #[unsafe(method_family = none)]
249        pub fn isLenient(&self) -> bool;
250
251        /// Setter for [`isLenient`][Self::isLenient].
252        #[unsafe(method(setLenient:))]
253        #[unsafe(method_family = none)]
254        pub fn setLenient(&self, lenient: bool);
255
256        #[cfg(feature = "NSDate")]
257        #[unsafe(method(twoDigitStartDate))]
258        #[unsafe(method_family = none)]
259        pub fn twoDigitStartDate(&self) -> Option<Retained<NSDate>>;
260
261        #[cfg(feature = "NSDate")]
262        /// Setter for [`twoDigitStartDate`][Self::twoDigitStartDate].
263        ///
264        /// This is [copied][crate::NSCopying::copy] when set.
265        #[unsafe(method(setTwoDigitStartDate:))]
266        #[unsafe(method_family = none)]
267        pub fn setTwoDigitStartDate(&self, two_digit_start_date: Option<&NSDate>);
268
269        #[cfg(feature = "NSDate")]
270        #[unsafe(method(defaultDate))]
271        #[unsafe(method_family = none)]
272        pub fn defaultDate(&self) -> Option<Retained<NSDate>>;
273
274        #[cfg(feature = "NSDate")]
275        /// Setter for [`defaultDate`][Self::defaultDate].
276        ///
277        /// This is [copied][crate::NSCopying::copy] when set.
278        #[unsafe(method(setDefaultDate:))]
279        #[unsafe(method_family = none)]
280        pub fn setDefaultDate(&self, default_date: Option<&NSDate>);
281
282        #[cfg(all(feature = "NSArray", feature = "NSString"))]
283        #[unsafe(method(eraSymbols))]
284        #[unsafe(method_family = none)]
285        pub fn eraSymbols(&self) -> Retained<NSArray<NSString>>;
286
287        #[cfg(all(feature = "NSArray", feature = "NSString"))]
288        /// Setter for [`eraSymbols`][Self::eraSymbols].
289        ///
290        /// This is [copied][crate::NSCopying::copy] when set.
291        #[unsafe(method(setEraSymbols:))]
292        #[unsafe(method_family = none)]
293        pub fn setEraSymbols(&self, era_symbols: Option<&NSArray<NSString>>);
294
295        #[cfg(all(feature = "NSArray", feature = "NSString"))]
296        #[unsafe(method(monthSymbols))]
297        #[unsafe(method_family = none)]
298        pub fn monthSymbols(&self) -> Retained<NSArray<NSString>>;
299
300        #[cfg(all(feature = "NSArray", feature = "NSString"))]
301        /// Setter for [`monthSymbols`][Self::monthSymbols].
302        ///
303        /// This is [copied][crate::NSCopying::copy] when set.
304        #[unsafe(method(setMonthSymbols:))]
305        #[unsafe(method_family = none)]
306        pub fn setMonthSymbols(&self, month_symbols: Option<&NSArray<NSString>>);
307
308        #[cfg(all(feature = "NSArray", feature = "NSString"))]
309        #[unsafe(method(shortMonthSymbols))]
310        #[unsafe(method_family = none)]
311        pub fn shortMonthSymbols(&self) -> Retained<NSArray<NSString>>;
312
313        #[cfg(all(feature = "NSArray", feature = "NSString"))]
314        /// Setter for [`shortMonthSymbols`][Self::shortMonthSymbols].
315        ///
316        /// This is [copied][crate::NSCopying::copy] when set.
317        #[unsafe(method(setShortMonthSymbols:))]
318        #[unsafe(method_family = none)]
319        pub fn setShortMonthSymbols(&self, short_month_symbols: Option<&NSArray<NSString>>);
320
321        #[cfg(all(feature = "NSArray", feature = "NSString"))]
322        #[unsafe(method(weekdaySymbols))]
323        #[unsafe(method_family = none)]
324        pub fn weekdaySymbols(&self) -> Retained<NSArray<NSString>>;
325
326        #[cfg(all(feature = "NSArray", feature = "NSString"))]
327        /// Setter for [`weekdaySymbols`][Self::weekdaySymbols].
328        ///
329        /// This is [copied][crate::NSCopying::copy] when set.
330        #[unsafe(method(setWeekdaySymbols:))]
331        #[unsafe(method_family = none)]
332        pub fn setWeekdaySymbols(&self, weekday_symbols: Option<&NSArray<NSString>>);
333
334        #[cfg(all(feature = "NSArray", feature = "NSString"))]
335        #[unsafe(method(shortWeekdaySymbols))]
336        #[unsafe(method_family = none)]
337        pub fn shortWeekdaySymbols(&self) -> Retained<NSArray<NSString>>;
338
339        #[cfg(all(feature = "NSArray", feature = "NSString"))]
340        /// Setter for [`shortWeekdaySymbols`][Self::shortWeekdaySymbols].
341        ///
342        /// This is [copied][crate::NSCopying::copy] when set.
343        #[unsafe(method(setShortWeekdaySymbols:))]
344        #[unsafe(method_family = none)]
345        pub fn setShortWeekdaySymbols(&self, short_weekday_symbols: Option<&NSArray<NSString>>);
346
347        #[cfg(feature = "NSString")]
348        #[unsafe(method(AMSymbol))]
349        #[unsafe(method_family = none)]
350        pub fn AMSymbol(&self) -> Retained<NSString>;
351
352        #[cfg(feature = "NSString")]
353        /// Setter for [`AMSymbol`][Self::AMSymbol].
354        ///
355        /// This is [copied][crate::NSCopying::copy] when set.
356        #[unsafe(method(setAMSymbol:))]
357        #[unsafe(method_family = none)]
358        pub fn setAMSymbol(&self, am_symbol: Option<&NSString>);
359
360        #[cfg(feature = "NSString")]
361        #[unsafe(method(PMSymbol))]
362        #[unsafe(method_family = none)]
363        pub fn PMSymbol(&self) -> Retained<NSString>;
364
365        #[cfg(feature = "NSString")]
366        /// Setter for [`PMSymbol`][Self::PMSymbol].
367        ///
368        /// This is [copied][crate::NSCopying::copy] when set.
369        #[unsafe(method(setPMSymbol:))]
370        #[unsafe(method_family = none)]
371        pub fn setPMSymbol(&self, pm_symbol: Option<&NSString>);
372
373        #[cfg(all(feature = "NSArray", feature = "NSString"))]
374        #[unsafe(method(longEraSymbols))]
375        #[unsafe(method_family = none)]
376        pub fn longEraSymbols(&self) -> Retained<NSArray<NSString>>;
377
378        #[cfg(all(feature = "NSArray", feature = "NSString"))]
379        /// Setter for [`longEraSymbols`][Self::longEraSymbols].
380        ///
381        /// This is [copied][crate::NSCopying::copy] when set.
382        #[unsafe(method(setLongEraSymbols:))]
383        #[unsafe(method_family = none)]
384        pub fn setLongEraSymbols(&self, long_era_symbols: Option<&NSArray<NSString>>);
385
386        #[cfg(all(feature = "NSArray", feature = "NSString"))]
387        #[unsafe(method(veryShortMonthSymbols))]
388        #[unsafe(method_family = none)]
389        pub fn veryShortMonthSymbols(&self) -> Retained<NSArray<NSString>>;
390
391        #[cfg(all(feature = "NSArray", feature = "NSString"))]
392        /// Setter for [`veryShortMonthSymbols`][Self::veryShortMonthSymbols].
393        ///
394        /// This is [copied][crate::NSCopying::copy] when set.
395        #[unsafe(method(setVeryShortMonthSymbols:))]
396        #[unsafe(method_family = none)]
397        pub fn setVeryShortMonthSymbols(
398            &self,
399            very_short_month_symbols: Option<&NSArray<NSString>>,
400        );
401
402        #[cfg(all(feature = "NSArray", feature = "NSString"))]
403        #[unsafe(method(standaloneMonthSymbols))]
404        #[unsafe(method_family = none)]
405        pub fn standaloneMonthSymbols(&self) -> Retained<NSArray<NSString>>;
406
407        #[cfg(all(feature = "NSArray", feature = "NSString"))]
408        /// Setter for [`standaloneMonthSymbols`][Self::standaloneMonthSymbols].
409        ///
410        /// This is [copied][crate::NSCopying::copy] when set.
411        #[unsafe(method(setStandaloneMonthSymbols:))]
412        #[unsafe(method_family = none)]
413        pub fn setStandaloneMonthSymbols(
414            &self,
415            standalone_month_symbols: Option<&NSArray<NSString>>,
416        );
417
418        #[cfg(all(feature = "NSArray", feature = "NSString"))]
419        #[unsafe(method(shortStandaloneMonthSymbols))]
420        #[unsafe(method_family = none)]
421        pub fn shortStandaloneMonthSymbols(&self) -> Retained<NSArray<NSString>>;
422
423        #[cfg(all(feature = "NSArray", feature = "NSString"))]
424        /// Setter for [`shortStandaloneMonthSymbols`][Self::shortStandaloneMonthSymbols].
425        ///
426        /// This is [copied][crate::NSCopying::copy] when set.
427        #[unsafe(method(setShortStandaloneMonthSymbols:))]
428        #[unsafe(method_family = none)]
429        pub fn setShortStandaloneMonthSymbols(
430            &self,
431            short_standalone_month_symbols: Option<&NSArray<NSString>>,
432        );
433
434        #[cfg(all(feature = "NSArray", feature = "NSString"))]
435        #[unsafe(method(veryShortStandaloneMonthSymbols))]
436        #[unsafe(method_family = none)]
437        pub fn veryShortStandaloneMonthSymbols(&self) -> Retained<NSArray<NSString>>;
438
439        #[cfg(all(feature = "NSArray", feature = "NSString"))]
440        /// Setter for [`veryShortStandaloneMonthSymbols`][Self::veryShortStandaloneMonthSymbols].
441        ///
442        /// This is [copied][crate::NSCopying::copy] when set.
443        #[unsafe(method(setVeryShortStandaloneMonthSymbols:))]
444        #[unsafe(method_family = none)]
445        pub fn setVeryShortStandaloneMonthSymbols(
446            &self,
447            very_short_standalone_month_symbols: Option<&NSArray<NSString>>,
448        );
449
450        #[cfg(all(feature = "NSArray", feature = "NSString"))]
451        #[unsafe(method(veryShortWeekdaySymbols))]
452        #[unsafe(method_family = none)]
453        pub fn veryShortWeekdaySymbols(&self) -> Retained<NSArray<NSString>>;
454
455        #[cfg(all(feature = "NSArray", feature = "NSString"))]
456        /// Setter for [`veryShortWeekdaySymbols`][Self::veryShortWeekdaySymbols].
457        ///
458        /// This is [copied][crate::NSCopying::copy] when set.
459        #[unsafe(method(setVeryShortWeekdaySymbols:))]
460        #[unsafe(method_family = none)]
461        pub fn setVeryShortWeekdaySymbols(
462            &self,
463            very_short_weekday_symbols: Option<&NSArray<NSString>>,
464        );
465
466        #[cfg(all(feature = "NSArray", feature = "NSString"))]
467        #[unsafe(method(standaloneWeekdaySymbols))]
468        #[unsafe(method_family = none)]
469        pub fn standaloneWeekdaySymbols(&self) -> Retained<NSArray<NSString>>;
470
471        #[cfg(all(feature = "NSArray", feature = "NSString"))]
472        /// Setter for [`standaloneWeekdaySymbols`][Self::standaloneWeekdaySymbols].
473        ///
474        /// This is [copied][crate::NSCopying::copy] when set.
475        #[unsafe(method(setStandaloneWeekdaySymbols:))]
476        #[unsafe(method_family = none)]
477        pub fn setStandaloneWeekdaySymbols(
478            &self,
479            standalone_weekday_symbols: Option<&NSArray<NSString>>,
480        );
481
482        #[cfg(all(feature = "NSArray", feature = "NSString"))]
483        #[unsafe(method(shortStandaloneWeekdaySymbols))]
484        #[unsafe(method_family = none)]
485        pub fn shortStandaloneWeekdaySymbols(&self) -> Retained<NSArray<NSString>>;
486
487        #[cfg(all(feature = "NSArray", feature = "NSString"))]
488        /// Setter for [`shortStandaloneWeekdaySymbols`][Self::shortStandaloneWeekdaySymbols].
489        ///
490        /// This is [copied][crate::NSCopying::copy] when set.
491        #[unsafe(method(setShortStandaloneWeekdaySymbols:))]
492        #[unsafe(method_family = none)]
493        pub fn setShortStandaloneWeekdaySymbols(
494            &self,
495            short_standalone_weekday_symbols: Option<&NSArray<NSString>>,
496        );
497
498        #[cfg(all(feature = "NSArray", feature = "NSString"))]
499        #[unsafe(method(veryShortStandaloneWeekdaySymbols))]
500        #[unsafe(method_family = none)]
501        pub fn veryShortStandaloneWeekdaySymbols(&self) -> Retained<NSArray<NSString>>;
502
503        #[cfg(all(feature = "NSArray", feature = "NSString"))]
504        /// Setter for [`veryShortStandaloneWeekdaySymbols`][Self::veryShortStandaloneWeekdaySymbols].
505        ///
506        /// This is [copied][crate::NSCopying::copy] when set.
507        #[unsafe(method(setVeryShortStandaloneWeekdaySymbols:))]
508        #[unsafe(method_family = none)]
509        pub fn setVeryShortStandaloneWeekdaySymbols(
510            &self,
511            very_short_standalone_weekday_symbols: Option<&NSArray<NSString>>,
512        );
513
514        #[cfg(all(feature = "NSArray", feature = "NSString"))]
515        #[unsafe(method(quarterSymbols))]
516        #[unsafe(method_family = none)]
517        pub fn quarterSymbols(&self) -> Retained<NSArray<NSString>>;
518
519        #[cfg(all(feature = "NSArray", feature = "NSString"))]
520        /// Setter for [`quarterSymbols`][Self::quarterSymbols].
521        ///
522        /// This is [copied][crate::NSCopying::copy] when set.
523        #[unsafe(method(setQuarterSymbols:))]
524        #[unsafe(method_family = none)]
525        pub fn setQuarterSymbols(&self, quarter_symbols: Option<&NSArray<NSString>>);
526
527        #[cfg(all(feature = "NSArray", feature = "NSString"))]
528        #[unsafe(method(shortQuarterSymbols))]
529        #[unsafe(method_family = none)]
530        pub fn shortQuarterSymbols(&self) -> Retained<NSArray<NSString>>;
531
532        #[cfg(all(feature = "NSArray", feature = "NSString"))]
533        /// Setter for [`shortQuarterSymbols`][Self::shortQuarterSymbols].
534        ///
535        /// This is [copied][crate::NSCopying::copy] when set.
536        #[unsafe(method(setShortQuarterSymbols:))]
537        #[unsafe(method_family = none)]
538        pub fn setShortQuarterSymbols(&self, short_quarter_symbols: Option<&NSArray<NSString>>);
539
540        #[cfg(all(feature = "NSArray", feature = "NSString"))]
541        #[unsafe(method(standaloneQuarterSymbols))]
542        #[unsafe(method_family = none)]
543        pub fn standaloneQuarterSymbols(&self) -> Retained<NSArray<NSString>>;
544
545        #[cfg(all(feature = "NSArray", feature = "NSString"))]
546        /// Setter for [`standaloneQuarterSymbols`][Self::standaloneQuarterSymbols].
547        ///
548        /// This is [copied][crate::NSCopying::copy] when set.
549        #[unsafe(method(setStandaloneQuarterSymbols:))]
550        #[unsafe(method_family = none)]
551        pub fn setStandaloneQuarterSymbols(
552            &self,
553            standalone_quarter_symbols: Option<&NSArray<NSString>>,
554        );
555
556        #[cfg(all(feature = "NSArray", feature = "NSString"))]
557        #[unsafe(method(shortStandaloneQuarterSymbols))]
558        #[unsafe(method_family = none)]
559        pub fn shortStandaloneQuarterSymbols(&self) -> Retained<NSArray<NSString>>;
560
561        #[cfg(all(feature = "NSArray", feature = "NSString"))]
562        /// Setter for [`shortStandaloneQuarterSymbols`][Self::shortStandaloneQuarterSymbols].
563        ///
564        /// This is [copied][crate::NSCopying::copy] when set.
565        #[unsafe(method(setShortStandaloneQuarterSymbols:))]
566        #[unsafe(method_family = none)]
567        pub fn setShortStandaloneQuarterSymbols(
568            &self,
569            short_standalone_quarter_symbols: Option<&NSArray<NSString>>,
570        );
571
572        #[cfg(feature = "NSDate")]
573        #[unsafe(method(gregorianStartDate))]
574        #[unsafe(method_family = none)]
575        pub fn gregorianStartDate(&self) -> Option<Retained<NSDate>>;
576
577        #[cfg(feature = "NSDate")]
578        /// Setter for [`gregorianStartDate`][Self::gregorianStartDate].
579        ///
580        /// This is [copied][crate::NSCopying::copy] when set.
581        #[unsafe(method(setGregorianStartDate:))]
582        #[unsafe(method_family = none)]
583        pub fn setGregorianStartDate(&self, gregorian_start_date: Option<&NSDate>);
584
585        #[unsafe(method(doesRelativeDateFormatting))]
586        #[unsafe(method_family = none)]
587        pub fn doesRelativeDateFormatting(&self) -> bool;
588
589        /// Setter for [`doesRelativeDateFormatting`][Self::doesRelativeDateFormatting].
590        #[unsafe(method(setDoesRelativeDateFormatting:))]
591        #[unsafe(method_family = none)]
592        pub fn setDoesRelativeDateFormatting(&self, does_relative_date_formatting: bool);
593    );
594}
595
596/// Methods declared on superclass `NSObject`.
597#[cfg(feature = "NSFormatter")]
598impl NSDateFormatter {
599    extern_methods!(
600        #[unsafe(method(init))]
601        #[unsafe(method_family = init)]
602        pub fn init(this: Allocated<Self>) -> Retained<Self>;
603
604        #[unsafe(method(new))]
605        #[unsafe(method_family = new)]
606        pub fn new() -> Retained<Self>;
607    );
608}
609
610#[cfg(feature = "NSFormatter")]
611impl DefaultRetained for NSDateFormatter {
612    #[inline]
613    fn default_retained() -> Retained<Self> {
614        Self::new()
615    }
616}
617
618/// NSDateFormatterCompatibility.
619#[cfg(feature = "NSFormatter")]
620impl NSDateFormatter {
621    extern_methods!(
622        #[cfg(feature = "NSString")]
623        #[deprecated = "Create an NSDateFormatter with `init` and set the dateFormat property instead."]
624        #[unsafe(method(initWithDateFormat:allowNaturalLanguage:))]
625        #[unsafe(method_family = init)]
626        pub fn initWithDateFormat_allowNaturalLanguage(
627            this: Allocated<Self>,
628            format: &NSString,
629            flag: bool,
630        ) -> Retained<Self>;
631
632        #[deprecated = "There is no replacement"]
633        #[unsafe(method(allowsNaturalLanguage))]
634        #[unsafe(method_family = none)]
635        pub fn allowsNaturalLanguage(&self) -> bool;
636    );
637}