1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
use crate::common::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSUInteger)]
pub enum NSDateIntervalFormatterStyle {
NSDateIntervalFormatterNoStyle = 0,
NSDateIntervalFormatterShortStyle = 1,
NSDateIntervalFormatterMediumStyle = 2,
NSDateIntervalFormatterLongStyle = 3,
NSDateIntervalFormatterFullStyle = 4,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
pub struct NSDateIntervalFormatter;
#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl ClassType for NSDateIntervalFormatter {
#[inherits(NSObject)]
type Super = NSFormatter;
}
);
#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl NSCoding for NSDateIntervalFormatter {}
#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl NSObjectProtocol for NSDateIntervalFormatter {}
extern_methods!(
#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl NSDateIntervalFormatter {
#[cfg(feature = "Foundation_NSLocale")]
#[method_id(@__retain_semantics Other locale)]
pub unsafe fn locale(&self) -> Id<NSLocale, Shared>;
#[cfg(feature = "Foundation_NSLocale")]
#[method(setLocale:)]
pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);
#[cfg(feature = "Foundation_NSCalendar")]
#[method_id(@__retain_semantics Other calendar)]
pub unsafe fn calendar(&self) -> Id<NSCalendar, Shared>;
#[cfg(feature = "Foundation_NSCalendar")]
#[method(setCalendar:)]
pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>);
#[cfg(feature = "Foundation_NSTimeZone")]
#[method_id(@__retain_semantics Other timeZone)]
pub unsafe fn timeZone(&self) -> Id<NSTimeZone, Shared>;
#[cfg(feature = "Foundation_NSTimeZone")]
#[method(setTimeZone:)]
pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other dateTemplate)]
pub unsafe fn dateTemplate(&self) -> Id<NSString, Shared>;
#[cfg(feature = "Foundation_NSString")]
#[method(setDateTemplate:)]
pub unsafe fn setDateTemplate(&self, date_template: Option<&NSString>);
#[method(dateStyle)]
pub unsafe fn dateStyle(&self) -> NSDateIntervalFormatterStyle;
#[method(setDateStyle:)]
pub unsafe fn setDateStyle(&self, date_style: NSDateIntervalFormatterStyle);
#[method(timeStyle)]
pub unsafe fn timeStyle(&self) -> NSDateIntervalFormatterStyle;
#[method(setTimeStyle:)]
pub unsafe fn setTimeStyle(&self, time_style: NSDateIntervalFormatterStyle);
#[cfg(all(feature = "Foundation_NSDate", feature = "Foundation_NSString"))]
#[method_id(@__retain_semantics Other stringFromDate:toDate:)]
pub unsafe fn stringFromDate_toDate(
&self,
from_date: &NSDate,
to_date: &NSDate,
) -> Id<NSString, Shared>;
#[cfg(all(feature = "Foundation_NSDateInterval", feature = "Foundation_NSString"))]
#[method_id(@__retain_semantics Other stringFromDateInterval:)]
pub unsafe fn stringFromDateInterval(
&self,
date_interval: &NSDateInterval,
) -> Option<Id<NSString, Shared>>;
}
);