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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

// NS_ENUM
#[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIActionSheetStyle(pub NSInteger);
impl UIActionSheetStyle {
    #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
    #[doc(alias = "UIActionSheetStyleAutomatic")]
    pub const Automatic: Self = Self(-1);
    #[cfg(feature = "UIInterface")]
    #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
    #[doc(alias = "UIActionSheetStyleDefault")]
    pub const Default: Self = Self(UIBarStyle::Default.0);
    #[cfg(feature = "UIInterface")]
    #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
    #[doc(alias = "UIActionSheetStyleBlackTranslucent")]
    pub const BlackTranslucent: Self = Self(UIBarStyle::BlackTranslucent.0);
    #[cfg(feature = "UIInterface")]
    #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead."]
    #[doc(alias = "UIActionSheetStyleBlackOpaque")]
    pub const BlackOpaque: Self = Self(UIBarStyle::BlackOpaque.0);
}

unsafe impl Encode for UIActionSheetStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIActionSheetStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
    pub struct UIActionSheet;

    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    unsafe impl ClassType for UIActionSheet {
        #[inherits(UIResponder, NSObject)]
        type Super = UIView;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
unsafe impl CALayerDelegate for UIActionSheet {}

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSCoding for UIActionSheet {}

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl NSObjectProtocol for UIActionSheet {}

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearance for UIActionSheet {}

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIAppearanceContainer for UIActionSheet {}

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UICoordinateSpace for UIActionSheet {}

#[cfg(all(
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
unsafe impl UIDynamicItem for UIActionSheet {}

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusEnvironment for UIActionSheet {}

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItem for UIActionSheet {}

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
unsafe impl UIFocusItemContainer for UIActionSheet {}

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
unsafe impl UIResponderStandardEditActions for UIActionSheet {}

#[cfg(all(
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIView"
))]
unsafe impl UITraitEnvironment for UIActionSheet {}

extern_methods!(
    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIActionSheet {
        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIActionSheetDelegate>>>;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UIActionSheetDelegate>>,
        );

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method_id(@__retain_semantics Other title)]
        pub unsafe fn title(&self) -> Retained<NSString>;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(setTitle:)]
        pub unsafe fn setTitle(&self, title: &NSString);

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(actionSheetStyle)]
        pub unsafe fn actionSheetStyle(&self) -> UIActionSheetStyle;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(setActionSheetStyle:)]
        pub unsafe fn setActionSheetStyle(&self, action_sheet_style: UIActionSheetStyle);

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(addButtonWithTitle:)]
        pub unsafe fn addButtonWithTitle(&self, title: Option<&NSString>) -> NSInteger;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method_id(@__retain_semantics Other buttonTitleAtIndex:)]
        pub unsafe fn buttonTitleAtIndex(
            &self,
            button_index: NSInteger,
        ) -> Option<Retained<NSString>>;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(numberOfButtons)]
        pub unsafe fn numberOfButtons(&self) -> NSInteger;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(cancelButtonIndex)]
        pub unsafe fn cancelButtonIndex(&self) -> NSInteger;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(setCancelButtonIndex:)]
        pub unsafe fn setCancelButtonIndex(&self, cancel_button_index: NSInteger);

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(destructiveButtonIndex)]
        pub unsafe fn destructiveButtonIndex(&self) -> NSInteger;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(setDestructiveButtonIndex:)]
        pub unsafe fn setDestructiveButtonIndex(&self, destructive_button_index: NSInteger);

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(firstOtherButtonIndex)]
        pub unsafe fn firstOtherButtonIndex(&self) -> NSInteger;

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(isVisible)]
        pub unsafe fn isVisible(&self) -> bool;

        #[cfg(feature = "UIToolbar")]
        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(showFromToolbar:)]
        pub unsafe fn showFromToolbar(&self, view: &UIToolbar);

        #[cfg(feature = "UITabBar")]
        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(showFromTabBar:)]
        pub unsafe fn showFromTabBar(&self, view: &UITabBar);

        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
        #[method(showFromBarButtonItem:animated:)]
        pub unsafe fn showFromBarButtonItem_animated(&self, item: &UIBarButtonItem, animated: bool);

        #[method(showFromRect:inView:animated:)]
        pub unsafe fn showFromRect_inView_animated(
            &self,
            rect: CGRect,
            view: &UIView,
            animated: bool,
        );

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(showInView:)]
        pub unsafe fn showInView(&self, view: &UIView);

        #[deprecated = "UIActionSheet is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet instead"]
        #[method(dismissWithClickedButtonIndex:animated:)]
        pub unsafe fn dismissWithClickedButtonIndex_animated(
            &self,
            button_index: NSInteger,
            animated: bool,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `UIView`
    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIActionSheet {
        #[method_id(@__retain_semantics Init initWithFrame:)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    unsafe impl UIActionSheet {
        #[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(mtm: MainThreadMarker) -> Retained<Self>;
    }
);

extern_protocol!(
    pub unsafe trait UIActionSheetDelegate: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[deprecated = "Use UIAlertController instead."]
        #[optional]
        #[method(actionSheet:clickedButtonAtIndex:)]
        unsafe fn actionSheet_clickedButtonAtIndex(
            &self,
            action_sheet: &UIActionSheet,
            button_index: NSInteger,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[deprecated = "Use UIAlertController instead."]
        #[optional]
        #[method(actionSheetCancel:)]
        unsafe fn actionSheetCancel(&self, action_sheet: &UIActionSheet);

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[deprecated = "Use UIAlertController instead."]
        #[optional]
        #[method(willPresentActionSheet:)]
        unsafe fn willPresentActionSheet(&self, action_sheet: &UIActionSheet);

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[deprecated = "Use UIAlertController instead."]
        #[optional]
        #[method(didPresentActionSheet:)]
        unsafe fn didPresentActionSheet(&self, action_sheet: &UIActionSheet);

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[deprecated = "Use UIAlertController instead."]
        #[optional]
        #[method(actionSheet:willDismissWithButtonIndex:)]
        unsafe fn actionSheet_willDismissWithButtonIndex(
            &self,
            action_sheet: &UIActionSheet,
            button_index: NSInteger,
        );

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[deprecated = "Use UIAlertController instead."]
        #[optional]
        #[method(actionSheet:didDismissWithButtonIndex:)]
        unsafe fn actionSheet_didDismissWithButtonIndex(
            &self,
            action_sheet: &UIActionSheet,
            button_index: NSInteger,
        );
    }

    unsafe impl ProtocolType for dyn UIActionSheetDelegate {}
);