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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;
use crate::*;
/// Image Capture Device Types
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicetype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ICDeviceType(pub NSUInteger);
impl ICDeviceType {
#[doc(alias = "ICDeviceTypeCamera")]
pub const Camera: Self = Self(0x00000001);
#[doc(alias = "ICDeviceTypeScanner")]
pub const Scanner: Self = Self(0x00000002);
}
unsafe impl Encode for ICDeviceType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for ICDeviceType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// Image Capture Device Location Types
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ICDeviceLocationType(pub NSUInteger);
impl ICDeviceLocationType {
#[doc(alias = "ICDeviceLocationTypeLocal")]
pub const Local: Self = Self(0x00000100);
#[doc(alias = "ICDeviceLocationTypeShared")]
pub const Shared: Self = Self(0x00000200);
#[doc(alias = "ICDeviceLocationTypeBonjour")]
pub const Bonjour: Self = Self(0x00000400);
#[doc(alias = "ICDeviceLocationTypeBluetooth")]
pub const Bluetooth: Self = Self(0x00000800);
}
unsafe impl Encode for ICDeviceLocationType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for ICDeviceLocationType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// Image Capture Device Type Mask
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicetypemask?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ICDeviceTypeMask(pub NSUInteger);
impl ICDeviceTypeMask {
#[doc(alias = "ICDeviceTypeMaskCamera")]
pub const Camera: Self = Self(0x00000001);
#[doc(alias = "ICDeviceTypeMaskScanner")]
pub const Scanner: Self = Self(0x00000002);
}
unsafe impl Encode for ICDeviceTypeMask {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for ICDeviceTypeMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// Image Capture Device Location Type Mask
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationtypemask?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ICDeviceLocationTypeMask(pub NSUInteger);
impl ICDeviceLocationTypeMask {
#[doc(alias = "ICDeviceLocationTypeMaskLocal")]
pub const Local: Self = Self(0x00000100);
#[doc(alias = "ICDeviceLocationTypeMaskShared")]
pub const Shared: Self = Self(0x00000200);
#[doc(alias = "ICDeviceLocationTypeMaskBonjour")]
pub const Bonjour: Self = Self(0x00000400);
#[doc(alias = "ICDeviceLocationTypeMaskBluetooth")]
pub const Bluetooth: Self = Self(0x00000800);
#[doc(alias = "ICDeviceLocationTypeMaskRemote")]
pub const Remote: Self = Self(0x0000FE00);
}
unsafe impl Encode for ICDeviceLocationTypeMask {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for ICDeviceLocationTypeMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicetransport?language=objc)
// NS_TYPED_ENUM
pub type ICDeviceTransport = NSString;
extern "C" {
/// Indicates that the device uses USB transport.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypeusb?language=objc)
pub static ICTransportTypeUSB: &'static ICDeviceTransport;
}
extern "C" {
/// Indicates that the device uses FireWire transport.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypefirewire?language=objc)
pub static ICTransportTypeFireWire: &'static ICDeviceTransport;
}
extern "C" {
/// Indicates that the device uses Bluetooth transport.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypebluetooth?language=objc)
pub static ICTransportTypeBluetooth: &'static ICDeviceTransport;
}
extern "C" {
/// Indicates that the device use mounts as a mass-storage volume.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypemassstorage?language=objc)
pub static ICTransportTypeMassStorage: &'static ICDeviceTransport;
}
extern "C" {
/// Indicates that the device use mounts as a exFat storage volume.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypeexfat?language=objc)
pub static ICTransportTypeExFAT: &'static ICDeviceTransport;
}
extern "C" {
/// Indicates that the device uses TCP/IP transport. These devices are discovered using Bonjour.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypetcpip?language=objc)
pub static ICTransportTypeTCPIP: &'static ICDeviceTransport;
}
extern "C" {
/// Indicates that the device transport is based on proximity instead of a predefined phyiscal layer.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/ictransporttypeproximity?language=objc)
pub static ICTransportTypeProximity: &'static ICDeviceTransport;
}
/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicestatus?language=objc)
// NS_TYPED_ENUM
pub type ICDeviceStatus = NSString;
extern "C" {
/// Key for a non-localized notification string.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icstatusnotificationkey?language=objc)
pub static ICStatusNotificationKey: &'static ICDeviceStatus;
}
extern "C" {
/// One of values defined in ICReturnCode.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icstatuscodekey?language=objc)
pub static ICStatusCodeKey: &'static ICDeviceStatus;
}
extern "C" {
/// Key for a localized notification string.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iclocalizedstatusnotificationkey?language=objc)
pub static ICLocalizedStatusNotificationKey: &'static ICDeviceStatus;
}
/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicecapability?language=objc)
// NS_TYPED_ENUM
pub type ICDeviceCapability = NSString;
extern "C" {
/// Indicates either the device is mounted as a mass-storage volume and can be ejected or the it is a remote device with an active connection that can be disconnected.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicecanejectordisconnect?language=objc)
pub static ICDeviceCanEjectOrDisconnect: &'static ICDeviceCapability;
}
/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icsessionoptions?language=objc)
// NS_TYPED_ENUM
pub type ICSessionOptions = NSString;
extern "C" {
/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icenumerationchronologicalorder?language=objc)
pub static ICEnumerationChronologicalOrder: &'static ICSessionOptions;
}
/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationoptions?language=objc)
// NS_TYPED_ENUM
pub type ICDeviceLocationOptions = NSString;
extern "C" {
/// This description is returned for locationDescription property of a device connected to a USB port.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationdescriptionusb?language=objc)
pub static ICDeviceLocationDescriptionUSB: &'static ICDeviceLocationOptions;
}
extern "C" {
/// This description is returned for locationDescription property of a device connected to a FireWire port.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationdescriptionfirewire?language=objc)
pub static ICDeviceLocationDescriptionFireWire: &'static ICDeviceLocationOptions;
}
extern "C" {
/// This description is returned for locationDescription property of a device connected via Bluetooth.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationdescriptionbluetooth?language=objc)
pub static ICDeviceLocationDescriptionBluetooth: &'static ICDeviceLocationOptions;
}
extern "C" {
/// This description is returned for locationDescription property of a device that is mounted as a mass-storage volume.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicelocationdescriptionmassstorage?language=objc)
pub static ICDeviceLocationDescriptionMassStorage: &'static ICDeviceLocationOptions;
}
extern_class!(
/// ICDevice is an abstract class that represents a device supported by Image Capture facility. ImageCaptureCore defines two concrete subclasses of ICDevice, ICCameraDevice and ICScannerDevice. ICDeviceBrowser creates instances of these two subclasses to represent cameras and scanners it finds.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevice?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct ICDevice;
);
extern_conformance!(
unsafe impl NSObjectProtocol for ICDevice {}
);
impl ICDevice {
extern_methods!(
/// The delegate to receive messages once a session is opened on the device.
///
/// The delegate must conform ICDeviceDelegate protocol. In addition it should respond to selectors defined in ICCameraDeviceDelegate protocol in order to effectively interact with the device object. The messages this delegate can expect to receive are described by these protocols.
///
/// # Safety
///
/// This is not retained internally, you must ensure the object is still alive.
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn ICDeviceDelegate>>>;
/// Setter for [`delegate`][Self::delegate].
///
/// # Safety
///
/// This is unretained, you must ensure the object is kept alive while in use.
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn ICDeviceDelegate>>);
/// The type of the device as defined by ICDeviceType OR'd with its ICDeviceLocationType.
///
/// Note: The type of this device can be obtained by AND'ing the value retuned by this property with an appropriate ICDeviceTypeMask.
///
/// Note: The location type of this device can be obtained by AND'ing the value retuned by this property with an appropriate ICDeviceLocationTypeMask.
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> ICDeviceType;
/// The capabilities of the device as reported by the device module.
#[unsafe(method(capabilities))]
#[unsafe(method_family = none)]
pub unsafe fn capabilities(&self) -> Retained<NSArray<NSString>>;
/// Name of the device as reported by the device module or by the device transport when a device module is not in control of this device.
///
/// Note: This name may change if the device module overrides the default name of the device reported by the device's transport, or if the name of the filesystem volume mounted by the device is changed by the user.
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
/// Type of the device. Possible values are:
/// "
/// iPhone", @"iPod", @"iPad", @"Camera", @"Scanner"
#[unsafe(method(productKind))]
#[unsafe(method_family = none)]
pub unsafe fn productKind(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "objc2-core-graphics")]
/// Icon image for the device class. If there is no custom icon present from a device manufacturer, this will be a rendered version of the system symbol for the device class. Using a rendered system symbol instead of the systemSymbolName is discouraged.
#[unsafe(method(icon))]
#[unsafe(method_family = none)]
pub unsafe fn icon(&self) -> Option<Retained<CGImage>>;
/// Standard system symbol used to represent the device class. Using the symbol to render an appropriate device icon will ensure proper scaling for high resolution devices.
#[unsafe(method(systemSymbolName))]
#[unsafe(method_family = none)]
pub unsafe fn systemSymbolName(&self) -> Option<Retained<NSString>>;
/// The transport type used by the device. The possible values are: ICTransportTypeUSB or ICTransportTypeMassStorage.
#[unsafe(method(transportType))]
#[unsafe(method_family = none)]
pub unsafe fn transportType(&self) -> Option<Retained<NSString>>;
/// A string representation of the Universally Unique ID of the device.
#[unsafe(method(UUIDString))]
#[unsafe(method_family = none)]
pub unsafe fn UUIDString(&self) -> Option<Retained<NSString>>;
/// A non-localized location description string for the device.
///
/// The value returned in one of the location description strings defined above, or location obtained from the Bonjour TXT record of a network device.
#[unsafe(method(locationDescription))]
#[unsafe(method_family = none)]
pub unsafe fn locationDescription(&self) -> Option<Retained<NSString>>;
/// Indicates whether the device has an open session.
#[unsafe(method(hasOpenSession))]
#[unsafe(method_family = none)]
pub unsafe fn hasOpenSession(&self) -> bool;
/// Client convenience bookkeeping object retained by the framework.
///
/// # Safety
///
/// The returned generic should be of the correct type.
#[unsafe(method(userData))]
#[unsafe(method_family = none)]
pub unsafe fn userData(&self) -> Option<Retained<NSMutableDictionary>>;
/// Filesystem path of the device module that is associated with this device. Camera-specific capabilities are defined in ICCameraDevice.h and scanner-specific capabilities are defined in ICScannerDevice.h.
#[unsafe(method(modulePath))]
#[unsafe(method_family = none)]
pub unsafe fn modulePath(&self) -> Retained<NSString>;
/// The bundle version of the device module associated with this device.
///
/// Note: This may change if an existing device module associated with this device is updated or a new device module for this device is installed.
#[unsafe(method(moduleVersion))]
#[unsafe(method_family = none)]
pub unsafe fn moduleVersion(&self) -> Option<Retained<NSString>>;
/// The serial number of the device. This will be NULL if the device does not provide a serial number.
#[unsafe(method(serialNumberString))]
#[unsafe(method_family = none)]
pub unsafe fn serialNumberString(&self) -> Option<Retained<NSString>>;
/// The USB location of which the device is occupying.
#[unsafe(method(usbLocationID))]
#[unsafe(method_family = none)]
pub unsafe fn usbLocationID(&self) -> c_int;
/// The USB PID associated with the device attached.
#[unsafe(method(usbProductID))]
#[unsafe(method_family = none)]
pub unsafe fn usbProductID(&self) -> c_int;
/// The USB VID associated with the device attached.
#[unsafe(method(usbVendorID))]
#[unsafe(method_family = none)]
pub unsafe fn usbVendorID(&self) -> c_int;
/// This message requests to open a session on the device.
///
/// Make sure the receiver's delegate is set prior to sending this message; otherwise this message will be ignored. This request is completed when the delegate receives a "device:didOpenSessionWithError:" message.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[unsafe(method(requestOpenSession))]
#[unsafe(method_family = none)]
pub unsafe fn requestOpenSession(&self);
/// This message requests to close a previously opened session on this device.
///
/// This request is completed when the delegate receives a "device:didCloseSessionWithError:" message.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[unsafe(method(requestCloseSession))]
#[unsafe(method_family = none)]
pub unsafe fn requestCloseSession(&self);
/// Eject the media if permitted by the device, or disconnect from a remote device.
#[unsafe(method(requestEject))]
#[unsafe(method_family = none)]
pub unsafe fn requestEject(&self);
#[cfg(feature = "block2")]
/// This message requests to open a session on the device.
///
/// This request will execute the completion handler provided upon return.
///
/// Note: The completion block will execute on an any available queue, often this will not be the main queue.
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(requestOpenSessionWithOptions:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestOpenSessionWithOptions_completion(
&self,
options: Option<&NSDictionary<ICSessionOptions, AnyObject>>,
completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
);
#[cfg(feature = "block2")]
/// This message requests to close a previously opened session on this device.
///
/// This request will execute the completion handler provided upon return.
///
/// Note: The completion block will execute on an any available queue, often this will not be the main queue.
///
/// # Safety
///
/// `options` generic should be of the correct type.
#[unsafe(method(requestCloseSessionWithOptions:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestCloseSessionWithOptions_completion(
&self,
options: Option<&NSDictionary<ICSessionOptions, AnyObject>>,
completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
);
#[cfg(feature = "block2")]
/// Eject the media, or disconnect the device - if permitted by the device.
///
/// This request will execute the completion handler provided upon return.
///
/// Note: The completion block will execute on an any available queue, often this will not be the main queue.
#[unsafe(method(requestEjectWithCompletion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestEjectWithCompletion(
&self,
completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
);
/// Filesystem path of an application that is to be automatically launched when this device is added.
///
/// This property is unavailable for devices of ICTransportTypeProximity.
#[unsafe(method(autolaunchApplicationPath))]
#[unsafe(method_family = none)]
pub unsafe fn autolaunchApplicationPath(&self) -> Option<Retained<NSString>>;
/// Setter for [`autolaunchApplicationPath`][Self::autolaunchApplicationPath].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setAutolaunchApplicationPath:))]
#[unsafe(method_family = none)]
pub unsafe fn setAutolaunchApplicationPath(
&self,
autolaunch_application_path: Option<&NSString>,
);
/// Indicates whether the device is a remote device published by Image Capture device sharing facility.
///
///
/// Name of the device as reported by the device module or by the device transport when a device module is not in control of this device.
///
/// Note: This name may change if the device module overrides the default name of the device reported by the device's transport, or if the name of the filesystem volume mounted by the device is changed by the user.
#[unsafe(method(isRemote))]
#[unsafe(method_family = none)]
pub unsafe fn isRemote(&self) -> bool;
/// A string representation of the persistent ID of the device.
#[unsafe(method(persistentIDString))]
#[unsafe(method_family = none)]
pub unsafe fn persistentIDString(&self) -> Option<Retained<NSString>>;
/// This method asynchronously sends an arbitrary message with optional data to a device.
///
/// This method allows developers to send a private message from a client application to a device module.
///
/// The response to this command will be delivered using didSendMessageSelector of sendMessageDelegate.
/// The didSendMessageSelector should have the same signature as: - (void)didSendMessage:(UInt32)messageCode inData:(NSData*)data error:(NSError*)error contextInfo:(void*)contextInfo.
///
/// The content of error returned should be examined to determine if the request completed successfully.
///
/// Note: This method should not be used to send PTP pass-through commands to a PTP camera.
/// Please refer to 'requestSendPTPCommand:outData:sendCommandDelegate:sendCommandDelegate:contextInfo:' defined in ICCameraDevice.h for sending PTP pass-through commands.
///
/// Note: Execution of the delegate callback will occur on the main thread.
///
/// # Safety
///
/// - `send_message_delegate` should be of the correct type.
/// - `selector` must be a valid selector.
/// - `context_info` must be a valid pointer or null.
#[unsafe(method(requestSendMessage:outData:maxReturnedDataSize:sendMessageDelegate:didSendMessageSelector:contextInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn requestSendMessage_outData_maxReturnedDataSize_sendMessageDelegate_didSendMessageSelector_contextInfo(
&self,
message_code: c_uint,
data: &NSData,
max_returned_data_size: c_uint,
send_message_delegate: &AnyObject,
selector: Sel,
context_info: *mut c_void,
);
/// Eject the media if permitted by the device, or disconnect from a remote device.
#[deprecated]
#[unsafe(method(requestEjectOrDisconnect))]
#[unsafe(method_family = none)]
pub unsafe fn requestEjectOrDisconnect(&self);
/// This message requests the device module in control of this device to yield control.
///
/// This message should be used only if the client is planning on communicating with the device directly. The device module may not yield control of the device if it has an open session.
#[deprecated = "Requesting a device yield is no longer avaialble"]
#[unsafe(method(requestYield))]
#[unsafe(method_family = none)]
pub unsafe fn requestYield(&self);
/// Reports the device module servicing the requests executable architecture.
#[deprecated = "Module executable architecture is no longer available"]
#[unsafe(method(moduleExecutableArchitecture))]
#[unsafe(method_family = none)]
pub unsafe fn moduleExecutableArchitecture(&self) -> c_int;
);
}
/// Methods declared on superclass `NSObject`.
impl ICDevice {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_protocol!(
/// A delegate of ICDevice must conform to ICDeviceDelegate protocol.
///
/// Note: Unless otherwise noted, all delegate callbacks will occur on the main thread.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdevicedelegate?language=objc)
pub unsafe trait ICDeviceDelegate: NSObjectProtocol {
/// This message is sent when a session is closed on a device.
///
/// This message completes the process initiated by the message "requestCloseSession" sent to the device object. This message is also sent if the device module in control of the device ceases to control the device.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[unsafe(method(device:didCloseSessionWithError:))]
#[unsafe(method_family = none)]
unsafe fn device_didCloseSessionWithError(
&self,
device: &ICDevice,
error: Option<&NSError>,
);
/// This message is sent to the delegate to inform that a device has been removed.
#[unsafe(method(didRemoveDevice:))]
#[unsafe(method_family = none)]
unsafe fn didRemoveDevice(&self, device: &ICDevice);
/// This message is sent when a session is opened on a device.
///
/// This message completes the process initiated by the message "requestOpenSession" sent to the device object.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[unsafe(method(device:didOpenSessionWithError:))]
#[unsafe(method_family = none)]
unsafe fn device_didOpenSessionWithError(&self, device: &ICDevice, error: Option<&NSError>);
/// This message is sent when the device is ready to receive requests.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[optional]
#[unsafe(method(deviceDidBecomeReady:))]
#[unsafe(method_family = none)]
unsafe fn deviceDidBecomeReady(&self, device: &ICDevice);
/// This message is sent if the name of a device changes.
///
/// This happens if the device module overrides the default name of the device reported by the device's transport layer, or if the name of the filesystem volume mounted by the device is changed by the user.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[optional]
#[unsafe(method(deviceDidChangeName:))]
#[unsafe(method_family = none)]
unsafe fn deviceDidChangeName(&self, device: &ICDevice);
/// This message is sent to the device delegate when status information is received from a device.
///
/// The 'status' dictionary contains two keys, ICStatusNotificationKey and ICLocalizedStatusNotificationKey, which are defined above. Status information keys are located in their respective ICDevice type class header.
///
/// Note: Execution of the delegate callback will occur on the main thread.
///
/// # Safety
///
/// `status` generic should be of the correct type.
#[optional]
#[unsafe(method(device:didReceiveStatusInformation:))]
#[unsafe(method_family = none)]
unsafe fn device_didReceiveStatusInformation(
&self,
device: &ICDevice,
status: &NSDictionary<ICDeviceStatus, AnyObject>,
);
/// This message is sent to the device delegate a device encounters an error.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[optional]
#[unsafe(method(device:didEncounterError:))]
#[unsafe(method_family = none)]
unsafe fn device_didEncounterError(&self, device: &ICDevice, error: Option<&NSError>);
/// This message is sent to the device delegate when the eject has completed.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[optional]
#[unsafe(method(device:didEjectWithError:))]
#[unsafe(method_family = none)]
unsafe fn device_didEjectWithError(&self, device: &ICDevice, error: Option<&NSError>);
/// This message is sent when the sharing state of a device has changes.
///
/// Any Image Capture client application can choose to share the device over the network using the sharing or webSharing facility in Image Capture.
///
/// Note: Execution of the delegate callback will occur on the main thread.
#[deprecated = "Device sharing is no longer available"]
#[optional]
#[unsafe(method(deviceDidChangeSharingState:))]
#[unsafe(method_family = none)]
unsafe fn deviceDidChangeSharingState(&self, device: &ICDevice);
}
);