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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_TYPED_EXTENSIBLE_ENUM
pub type UIPasteboardName = NSString;

extern "C" {
    pub static UIPasteboardNameGeneral: &'static UIPasteboardName;
}

extern "C" {
    pub static UIPasteboardNameFind: &'static NSString;
}

// NS_TYPED_ENUM
pub type UIPasteboardDetectionPattern = NSString;

extern "C" {
    pub static UIPasteboardDetectionPatternProbableWebURL: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternProbableWebSearch: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternNumber: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternLink: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternPhoneNumber: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternEmailAddress: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternPostalAddress: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternCalendarEvent: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternShipmentTrackingNumber:
        &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternFlightNumber: &'static UIPasteboardDetectionPattern;
}

extern "C" {
    pub static UIPasteboardDetectionPatternMoneyAmount: &'static UIPasteboardDetectionPattern;
}

// NS_TYPED_ENUM
pub type UIPasteboardOption = NSString;

extern "C" {
    pub static UIPasteboardOptionExpirationDate: &'static UIPasteboardOption;
}

extern "C" {
    pub static UIPasteboardOptionLocalOnly: &'static UIPasteboardOption;
}

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

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

unsafe impl Send for UIPasteboard {}

unsafe impl Sync for UIPasteboard {}

unsafe impl NSObjectProtocol for UIPasteboard {}

extern_methods!(
    unsafe impl UIPasteboard {
        #[method_id(@__retain_semantics Other generalPasteboard)]
        pub unsafe fn generalPasteboard() -> Retained<UIPasteboard>;

        #[method_id(@__retain_semantics Other pasteboardWithName:create:)]
        pub unsafe fn pasteboardWithName_create(
            pasteboard_name: &UIPasteboardName,
            create: bool,
        ) -> Option<Retained<UIPasteboard>>;

        #[method_id(@__retain_semantics Other pasteboardWithUniqueName)]
        pub unsafe fn pasteboardWithUniqueName() -> Retained<UIPasteboard>;

        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Retained<UIPasteboardName>;

        #[method(removePasteboardWithName:)]
        pub unsafe fn removePasteboardWithName(pasteboard_name: &UIPasteboardName);

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

        #[deprecated = "Do not set persistence on pasteboards. This property is set automatically."]
        #[method(setPersistent:)]
        pub unsafe fn setPersistent(&self, persistent: bool);

        #[method(changeCount)]
        pub unsafe fn changeCount(&self) -> NSInteger;

        #[method_id(@__retain_semantics Other itemProviders)]
        pub unsafe fn itemProviders(&self) -> Retained<NSArray<NSItemProvider>>;

        #[method(setItemProviders:)]
        pub unsafe fn setItemProviders(&self, item_providers: &NSArray<NSItemProvider>);

        #[method(setItemProviders:localOnly:expirationDate:)]
        pub unsafe fn setItemProviders_localOnly_expirationDate(
            &self,
            item_providers: &NSArray<NSItemProvider>,
            local_only: bool,
            expiration_date: Option<&NSDate>,
        );

        #[method(setObjects:)]
        pub unsafe fn setObjects(
            &self,
            objects: &NSArray<ProtocolObject<dyn NSItemProviderWriting>>,
        );

        #[method(setObjects:localOnly:expirationDate:)]
        pub unsafe fn setObjects_localOnly_expirationDate(
            &self,
            objects: &NSArray<ProtocolObject<dyn NSItemProviderWriting>>,
            local_only: bool,
            expiration_date: Option<&NSDate>,
        );

        #[method_id(@__retain_semantics Other pasteboardTypes)]
        pub unsafe fn pasteboardTypes(&self) -> Retained<NSArray<NSString>>;

        #[method(containsPasteboardTypes:)]
        pub unsafe fn containsPasteboardTypes(&self, pasteboard_types: &NSArray<NSString>) -> bool;

        #[method_id(@__retain_semantics Other dataForPasteboardType:)]
        pub unsafe fn dataForPasteboardType(
            &self,
            pasteboard_type: &NSString,
        ) -> Option<Retained<NSData>>;

        #[method_id(@__retain_semantics Other valueForPasteboardType:)]
        pub unsafe fn valueForPasteboardType(
            &self,
            pasteboard_type: &NSString,
        ) -> Option<Retained<AnyObject>>;

        #[method(setValue:forPasteboardType:)]
        pub unsafe fn setValue_forPasteboardType(
            &self,
            value: &AnyObject,
            pasteboard_type: &NSString,
        );

        #[method(setData:forPasteboardType:)]
        pub unsafe fn setData_forPasteboardType(&self, data: &NSData, pasteboard_type: &NSString);

        #[method(numberOfItems)]
        pub unsafe fn numberOfItems(&self) -> NSInteger;

        #[method_id(@__retain_semantics Other pasteboardTypesForItemSet:)]
        pub unsafe fn pasteboardTypesForItemSet(
            &self,
            item_set: Option<&NSIndexSet>,
        ) -> Option<Retained<NSArray<NSArray<NSString>>>>;

        #[method(containsPasteboardTypes:inItemSet:)]
        pub unsafe fn containsPasteboardTypes_inItemSet(
            &self,
            pasteboard_types: &NSArray<NSString>,
            item_set: Option<&NSIndexSet>,
        ) -> bool;

        #[method_id(@__retain_semantics Other itemSetWithPasteboardTypes:)]
        pub unsafe fn itemSetWithPasteboardTypes(
            &self,
            pasteboard_types: &NSArray<NSString>,
        ) -> Option<Retained<NSIndexSet>>;

        #[method_id(@__retain_semantics Other valuesForPasteboardType:inItemSet:)]
        pub unsafe fn valuesForPasteboardType_inItemSet(
            &self,
            pasteboard_type: &NSString,
            item_set: Option<&NSIndexSet>,
        ) -> Option<Retained<NSArray>>;

        #[method_id(@__retain_semantics Other dataForPasteboardType:inItemSet:)]
        pub unsafe fn dataForPasteboardType_inItemSet(
            &self,
            pasteboard_type: &NSString,
            item_set: Option<&NSIndexSet>,
        ) -> Option<Retained<NSArray<NSData>>>;

        #[method_id(@__retain_semantics Other items)]
        pub unsafe fn items(&self) -> Retained<NSArray<NSDictionary<NSString, AnyObject>>>;

        #[method(setItems:)]
        pub unsafe fn setItems(&self, items: &NSArray<NSDictionary<NSString, AnyObject>>);

        #[method(addItems:)]
        pub unsafe fn addItems(&self, items: &NSArray<NSDictionary<NSString, AnyObject>>);

        #[method(setItems:options:)]
        pub unsafe fn setItems_options(
            &self,
            items: &NSArray<NSDictionary<NSString, AnyObject>>,
            options: &NSDictionary<UIPasteboardOption, AnyObject>,
        );

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

        #[method(setString:)]
        pub unsafe fn setString(&self, string: Option<&NSString>);

        #[method_id(@__retain_semantics Other strings)]
        pub unsafe fn strings(&self) -> Option<Retained<NSArray<NSString>>>;

        #[method(setStrings:)]
        pub unsafe fn setStrings(&self, strings: Option<&NSArray<NSString>>);

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

        #[method(setURL:)]
        pub unsafe fn setURL(&self, url: Option<&NSURL>);

        #[method_id(@__retain_semantics Other URLs)]
        pub unsafe fn URLs(&self) -> Option<Retained<NSArray<NSURL>>>;

        #[method(setURLs:)]
        pub unsafe fn setURLs(&self, ur_ls: Option<&NSArray<NSURL>>);

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

        #[cfg(feature = "UIImage")]
        #[method(setImage:)]
        pub unsafe fn setImage(&self, image: Option<&UIImage>);

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other images)]
        pub unsafe fn images(&self) -> Option<Retained<NSArray<UIImage>>>;

        #[cfg(feature = "UIImage")]
        #[method(setImages:)]
        pub unsafe fn setImages(&self, images: Option<&NSArray<UIImage>>);

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

        #[cfg(feature = "UIColor")]
        #[method(setColor:)]
        pub unsafe fn setColor(&self, color: Option<&UIColor>);

        #[cfg(feature = "UIColor")]
        #[method_id(@__retain_semantics Other colors)]
        pub unsafe fn colors(&self) -> Option<Retained<NSArray<UIColor>>>;

        #[cfg(feature = "UIColor")]
        #[method(setColors:)]
        pub unsafe fn setColors(&self, colors: Option<&NSArray<UIColor>>);

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

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

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

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

        #[cfg(feature = "block2")]
        #[method(detectPatternsForPatterns:completionHandler:)]
        pub unsafe fn detectPatternsForPatterns_completionHandler(
            &self,
            patterns: &NSSet<UIPasteboardDetectionPattern>,
            completion_handler: &block2::Block<
                dyn Fn(*mut NSSet<UIPasteboardDetectionPattern>, *mut NSError),
            >,
        );

        #[cfg(feature = "block2")]
        #[method(detectPatternsForPatterns:inItemSet:completionHandler:)]
        pub unsafe fn detectPatternsForPatterns_inItemSet_completionHandler(
            &self,
            patterns: &NSSet<UIPasteboardDetectionPattern>,
            item_set: Option<&NSIndexSet>,
            completion_handler: &block2::Block<
                dyn Fn(*mut NSArray<NSSet<UIPasteboardDetectionPattern>>, *mut NSError),
            >,
        );

        #[cfg(feature = "block2")]
        #[method(detectValuesForPatterns:completionHandler:)]
        pub unsafe fn detectValuesForPatterns_completionHandler(
            &self,
            patterns: &NSSet<UIPasteboardDetectionPattern>,
            completion_handler: &block2::Block<
                dyn Fn(*mut NSDictionary<UIPasteboardDetectionPattern, AnyObject>, *mut NSError),
            >,
        );

        #[cfg(feature = "block2")]
        #[method(detectValuesForPatterns:inItemSet:completionHandler:)]
        pub unsafe fn detectValuesForPatterns_inItemSet_completionHandler(
            &self,
            patterns: &NSSet<UIPasteboardDetectionPattern>,
            item_set: Option<&NSIndexSet>,
            completion_handler: &block2::Block<
                dyn Fn(
                    *mut NSArray<NSDictionary<UIPasteboardDetectionPattern, AnyObject>>,
                    *mut NSError,
                ),
            >,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UIPasteboard {
        #[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>;
    }
);

extern "C" {
    pub static UIPasteboardChangedNotification: &'static NSNotificationName;
}

extern "C" {
    pub static UIPasteboardChangedTypesAddedKey: &'static NSString;
}

extern "C" {
    pub static UIPasteboardChangedTypesRemovedKey: &'static NSString;
}

extern "C" {
    pub static UIPasteboardRemovedNotification: &'static NSNotificationName;
}

extern "C" {
    pub static UIPasteboardTypeListString: &'static NSArray<NSString>;
}

extern "C" {
    pub static UIPasteboardTypeListURL: &'static NSArray<NSString>;
}

extern "C" {
    pub static UIPasteboardTypeListImage: &'static NSArray<NSString>;
}

extern "C" {
    pub static UIPasteboardTypeListColor: &'static NSArray<NSString>;
}

extern "C" {
    pub static UIPasteboardTypeAutomatic: &'static NSString;
}