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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSTimer;

    unsafe impl ClassType for NSTimer {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for NSTimer {}

extern_methods!(
    unsafe impl NSTimer {
        #[cfg(all(feature = "NSDate", feature = "NSInvocation"))]
        #[method_id(@__retain_semantics Other timerWithTimeInterval:invocation:repeats:)]
        pub unsafe fn timerWithTimeInterval_invocation_repeats(
            ti: NSTimeInterval,
            invocation: &NSInvocation,
            yes_or_no: bool,
        ) -> Retained<NSTimer>;

        #[cfg(all(feature = "NSDate", feature = "NSInvocation"))]
        #[method_id(@__retain_semantics Other scheduledTimerWithTimeInterval:invocation:repeats:)]
        pub unsafe fn scheduledTimerWithTimeInterval_invocation_repeats(
            ti: NSTimeInterval,
            invocation: &NSInvocation,
            yes_or_no: bool,
        ) -> Retained<NSTimer>;

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Other timerWithTimeInterval:target:selector:userInfo:repeats:)]
        pub unsafe fn timerWithTimeInterval_target_selector_userInfo_repeats(
            ti: NSTimeInterval,
            a_target: &AnyObject,
            a_selector: Sel,
            user_info: Option<&AnyObject>,
            yes_or_no: bool,
        ) -> Retained<NSTimer>;

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Other scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:)]
        pub unsafe fn scheduledTimerWithTimeInterval_target_selector_userInfo_repeats(
            ti: NSTimeInterval,
            a_target: &AnyObject,
            a_selector: Sel,
            user_info: Option<&AnyObject>,
            yes_or_no: bool,
        ) -> Retained<NSTimer>;

        #[cfg(all(feature = "NSDate", feature = "block2"))]
        #[method_id(@__retain_semantics Other timerWithTimeInterval:repeats:block:)]
        pub unsafe fn timerWithTimeInterval_repeats_block(
            interval: NSTimeInterval,
            repeats: bool,
            block: &block2::Block<dyn Fn(NonNull<NSTimer>)>,
        ) -> Retained<NSTimer>;

        #[cfg(all(feature = "NSDate", feature = "block2"))]
        #[method_id(@__retain_semantics Other scheduledTimerWithTimeInterval:repeats:block:)]
        pub unsafe fn scheduledTimerWithTimeInterval_repeats_block(
            interval: NSTimeInterval,
            repeats: bool,
            block: &block2::Block<dyn Fn(NonNull<NSTimer>)>,
        ) -> Retained<NSTimer>;

        #[cfg(all(feature = "NSDate", feature = "block2"))]
        #[method_id(@__retain_semantics Init initWithFireDate:interval:repeats:block:)]
        pub unsafe fn initWithFireDate_interval_repeats_block(
            this: Allocated<Self>,
            date: &NSDate,
            interval: NSTimeInterval,
            repeats: bool,
            block: &block2::Block<dyn Fn(NonNull<NSTimer>)>,
        ) -> Retained<Self>;

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Init initWithFireDate:interval:target:selector:userInfo:repeats:)]
        pub unsafe fn initWithFireDate_interval_target_selector_userInfo_repeats(
            this: Allocated<Self>,
            date: &NSDate,
            ti: NSTimeInterval,
            t: &AnyObject,
            s: Sel,
            ui: Option<&AnyObject>,
            rep: bool,
        ) -> Retained<Self>;

        #[method(fire)]
        pub unsafe fn fire(&self);

        #[cfg(feature = "NSDate")]
        #[method_id(@__retain_semantics Other fireDate)]
        pub unsafe fn fireDate(&self) -> Retained<NSDate>;

        #[cfg(feature = "NSDate")]
        #[method(setFireDate:)]
        pub unsafe fn setFireDate(&self, fire_date: &NSDate);

        #[cfg(feature = "NSDate")]
        #[method(timeInterval)]
        pub unsafe fn timeInterval(&self) -> NSTimeInterval;

        #[cfg(feature = "NSDate")]
        #[method(tolerance)]
        pub unsafe fn tolerance(&self) -> NSTimeInterval;

        #[cfg(feature = "NSDate")]
        #[method(setTolerance:)]
        pub unsafe fn setTolerance(&self, tolerance: NSTimeInterval);

        #[method(invalidate)]
        pub unsafe fn invalidate(&self);

        #[method(isValid)]
        pub unsafe fn isValid(&self) -> bool;

        #[method_id(@__retain_semantics Other userInfo)]
        pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSTimer {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);