objc2_image_capture_core/generated/ICCameraDevice.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-graphics")]
7use objc2_core_graphics::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern "C" {
13 /// Indicates that the camera can capture a picture while it is connected, if the client sends a 'requestTakePicture' message to it.
14 ///
15 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecantakepicture?language=objc)
16 #[cfg(feature = "ICDevice")]
17 pub static ICCameraDeviceCanTakePicture: &'static ICDeviceCapability;
18}
19
20extern "C" {
21 /// Indicates that the camera can capture a picture while it is connected, if the user presses the shutter release on the camera.
22 ///
23 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecantakepictureusingshutterreleaseoncamera?language=objc)
24 #[cfg(feature = "ICDevice")]
25 pub static ICCameraDeviceCanTakePictureUsingShutterReleaseOnCamera: &'static ICDeviceCapability;
26}
27
28extern "C" {
29 /// Indicates that the camera can delete a file at a time while it is connected.
30 ///
31 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecandeleteonefile?language=objc)
32 #[cfg(feature = "ICDevice")]
33 pub static ICCameraDeviceCanDeleteOneFile: &'static ICDeviceCapability;
34}
35
36extern "C" {
37 /// Indicates that the camera can delete all files in a single operation while it is connected.
38 ///
39 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecandeleteallfiles?language=objc)
40 #[cfg(feature = "ICDevice")]
41 pub static ICCameraDeviceCanDeleteAllFiles: &'static ICDeviceCapability;
42}
43
44extern "C" {
45 /// Indicates that the camera can synchronize its date and time with that of the host computer.
46 ///
47 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecansyncclock?language=objc)
48 #[cfg(feature = "ICDevice")]
49 pub static ICCameraDeviceCanSyncClock: &'static ICDeviceCapability;
50}
51
52extern "C" {
53 /// Indicates that the host can upload files to the camera.
54 ///
55 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecanreceivefile?language=objc)
56 #[cfg(feature = "ICDevice")]
57 pub static ICCameraDeviceCanReceiveFile: &'static ICDeviceCapability;
58}
59
60extern "C" {
61 /// Indicates that the camera can accept PTP commands.
62 ///
63 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicecanacceptptpcommands?language=objc)
64 #[cfg(feature = "ICDevice")]
65 pub static ICCameraDeviceCanAcceptPTPCommands: &'static ICDeviceCapability;
66}
67
68extern "C" {
69 /// Indicates that the camera supports HEIF transcoding, and can change the presentation of converted assets and original assets on the fly.
70 ///
71 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicesupportsheif?language=objc)
72 #[cfg(feature = "ICDevice")]
73 pub static ICCameraDeviceSupportsHEIF: &'static ICDeviceCapability;
74}
75
76/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icuploadoption?language=objc)
77// NS_TYPED_ENUM
78pub type ICUploadOption = NSString;
79
80/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeleteresult?language=objc)
81// NS_TYPED_ENUM
82pub type ICDeleteResult = NSString;
83
84extern "C" {
85 /// The value for this key should be an NSArray
86 /// <ICCameraItem
87 /// *>*
88 ///
89 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeletesuccessful?language=objc)
90 pub static ICDeleteSuccessful: &'static ICDeleteResult;
91}
92
93extern "C" {
94 /// The value for this key should be an NSArray
95 /// <ICCameraItem
96 /// *>*
97 ///
98 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeletecanceled?language=objc)
99 pub static ICDeleteCanceled: &'static ICDeleteResult;
100}
101
102extern "C" {
103 /// The value for this key should be an NSArray
104 /// <ICCameraItem
105 /// *>*
106 ///
107 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeletefailed?language=objc)
108 pub static ICDeleteFailed: &'static ICDeleteResult;
109}
110
111/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeleteerror?language=objc)
112// NS_TYPED_ENUM
113pub type ICDeleteError = NSString;
114
115extern "C" {
116 /// The value for this key should be an ICCameraItem*
117 ///
118 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeleteerrorreadonly?language=objc)
119 pub static ICDeleteErrorReadOnly: &'static ICDeleteError;
120}
121
122extern "C" {
123 /// The value for this key should be an ICCameraItem*
124 ///
125 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeleteerrorfilemissing?language=objc)
126 pub static ICDeleteErrorFileMissing: &'static ICDeleteError;
127}
128
129extern "C" {
130 /// The value for this key should be an ICCameraItem*
131 ///
132 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeleteerrordevicemissing?language=objc)
133 pub static ICDeleteErrorDeviceMissing: &'static ICDeleteError;
134}
135
136extern "C" {
137 /// The value for this key should be an ICCameraItem*
138 ///
139 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icdeleteerrorcanceled?language=objc)
140 pub static ICDeleteErrorCanceled: &'static ICDeleteError;
141}
142
143/// [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/icmediapresentation?language=objc)
144// NS_ENUM
145#[repr(transparent)]
146#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
147pub struct ICMediaPresentation(pub NSUInteger);
148impl ICMediaPresentation {
149 #[doc(alias = "ICMediaPresentationConvertedAssets")]
150 pub const ConvertedAssets: Self = Self(1);
151 #[doc(alias = "ICMediaPresentationOriginalAssets")]
152 pub const OriginalAssets: Self = Self(2);
153}
154
155unsafe impl Encode for ICMediaPresentation {
156 const ENCODING: Encoding = NSUInteger::ENCODING;
157}
158
159unsafe impl RefEncode for ICMediaPresentation {
160 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
161}
162
163extern_class!(
164 /// ICCameraDevice is a concrete subclass of ICDevice class. ICDeviceBrowser creates instances of this class.
165 ///
166 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevice?language=objc)
167 #[unsafe(super(ICDevice, NSObject))]
168 #[derive(Debug, PartialEq, Eq, Hash)]
169 #[cfg(feature = "ICDevice")]
170 pub struct ICCameraDevice;
171);
172
173#[cfg(feature = "ICDevice")]
174extern_conformance!(
175 unsafe impl NSObjectProtocol for ICCameraDevice {}
176);
177
178#[cfg(feature = "ICDevice")]
179impl ICCameraDevice {
180 extern_methods!(
181 /// Indicates the percentage of content cataloging completed on the device. Its value ranges from 0 to 100.
182 #[unsafe(method(contentCatalogPercentCompleted))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn contentCatalogPercentCompleted(&self) -> NSUInteger;
185
186 #[cfg(feature = "ICCameraItem")]
187 /// Contents of the camera. The structure of the elements in this array will reflect the folder structure of the storage reported by the camera. Each item in this array will correspond to a storage on the camera.
188 #[unsafe(method(contents))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn contents(&self) -> Option<Retained<NSArray<ICCameraItem>>>;
191
192 #[cfg(feature = "ICCameraItem")]
193 /// The property mediaFiles represents all image, movie and audio files on the camera. These files are returned as a single array without regard to the folder hierarchy used to store these files on the camera.
194 #[unsafe(method(mediaFiles))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn mediaFiles(&self) -> Option<Retained<NSArray<ICCameraItem>>>;
197
198 /// Indicates whether the device can be 'soft' removed or disconnected.
199 #[unsafe(method(isEjectable))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn isEjectable(&self) -> bool;
202
203 /// Indicates whether the device is locked. A locked device does not allow for deletion of any asset.
204 #[unsafe(method(isLocked))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn isLocked(&self) -> bool;
207
208 /// Set to YES if the device is made by Apple and is pass-coded locked and connected to an untrusted host.
209 #[unsafe(method(isAccessRestrictedAppleDevice))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn isAccessRestrictedAppleDevice(&self) -> bool;
212
213 /// Set to YES if the device is made by Apple and is pass-coded locked and connected to an untrusted host.
214 #[unsafe(method(iCloudPhotosEnabled))]
215 #[unsafe(method_family = none)]
216 pub unsafe fn iCloudPhotosEnabled(&self) -> bool;
217
218 /// Filesystem mount point for a device with transportType of ICTransportTypeMassStorage. This will be NULL for all other devices.
219 #[unsafe(method(mountPoint))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn mountPoint(&self) -> Option<Retained<NSString>>;
222
223 /// The media presentation describes the visible assets from a device that may contain multiple formats of each media asset. The asigngments are of the type ICMediaPresentation enumeration. This property is available only if the capability ICCameraDeviceSupportsHEIF is present.
224 ///
225 ///
226 /// A device supporting this capability can specify the
227 /// following presentations:
228 ///
229 /// ICMediaPresentationConverted - The default behavior for applications retrieving images from a device supporting HEIF is to show only converted JPG from HEIF originals, and only H264 encoded video assets from HEVC.
230 /// ICMediaPresentationOriginal - This presentation will show only original images from a device supporting HEIF and HEVC. Burned in renders are always exported in JPG, as are burned in effects for MOV clips.
231 #[unsafe(method(mediaPresentation))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn mediaPresentation(&self) -> ICMediaPresentation;
234
235 /// Setter for [`mediaPresentation`][Self::mediaPresentation].
236 #[unsafe(method(setMediaPresentation:))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn setMediaPresentation(&self, media_presentation: ICMediaPresentation);
239
240 /// This method returns an array of files on the camera of type fileType.
241 ///
242 /// The fileType string is one of the following Uniform Type Identifier strings: kUTTypeImage, kUTTypeMovie, kUTTypeAudio, or kUTTypeData.
243 #[unsafe(method(filesOfType:))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn filesOfType(
246 &self,
247 file_ut_type: &NSString,
248 ) -> Option<Retained<NSArray<NSString>>>;
249
250 #[cfg(all(feature = "ICCameraFile", feature = "ICCameraItem", feature = "libc"))]
251 /// This method asynchronously reads data of a specified length from a specified offset.
252 ///
253 /// The readDelegate passed must not be nil. When this request is completed, the didReadDataSelector of the readDelegate object is called. The didReadDataSelector should have the same signature as: - (void)didReadData:(NSData*)data fromFile:(ICCameraFile*)file error:(NSError*)error contextInfo:(void*)contextInfo. The content of error returned should be examined to determine if the request completed successfully.
254 #[unsafe(method(requestReadDataFromFile:atOffset:length:readDelegate:didReadDataSelector:contextInfo:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn requestReadDataFromFile_atOffset_length_readDelegate_didReadDataSelector_contextInfo(
257 &self,
258 file: &ICCameraFile,
259 offset: libc::off_t,
260 length: libc::off_t,
261 read_delegate: &AnyObject,
262 selector: Sel,
263 context_info: *mut c_void,
264 );
265
266 #[cfg(all(feature = "ICCameraFile", feature = "ICCameraItem"))]
267 /// Download a file from the camera. Please refer to the top of this header for information about the options.
268 ///
269 /// The downloadDelegate passed must not be nil. When this request is completed, the didDownloadSelector of the downloadDelegate object is called.The didDownloadSelector should have the same signature as: - (void)didDownloadFile:(ICCameraFile*)file error:(NSError*)error options:(NSDictionary*)options contextInfo:(void*)contextInfo. The content of error returned should be examined to determine if the request completed successfully.
270 #[unsafe(method(requestDownloadFile:options:downloadDelegate:didDownloadSelector:contextInfo:))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn requestDownloadFile_options_downloadDelegate_didDownloadSelector_contextInfo(
273 &self,
274 file: &ICCameraFile,
275 options: &NSDictionary<ICDownloadOption, AnyObject>,
276 download_delegate: &ProtocolObject<dyn ICCameraDeviceDownloadDelegate>,
277 selector: Sel,
278 context_info: *mut c_void,
279 );
280
281 /// Cancels the current download operation if supported
282 #[unsafe(method(cancelDownload))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn cancelDownload(&self);
285
286 #[cfg(feature = "ICCameraItem")]
287 /// Deletes files.
288 #[unsafe(method(requestDeleteFiles:))]
289 #[unsafe(method_family = none)]
290 pub unsafe fn requestDeleteFiles(&self, files: &NSArray<ICCameraItem>);
291
292 #[cfg(all(feature = "ICCameraItem", feature = "block2"))]
293 /// Allows for deletion of an array of ICCameraItem objects, with the added ability to catch delete failures using the
294 /// 'deleteFailed' block, and a completion block that will return the overall state of the request.
295 ///
296 /// The deleteFailed block will return:
297 /// - NSDictionary
298 /// <ICDeleteError
299 /// , ICCameraItem*>*
300 ///
301 /// The completion block will return:
302 /// — error:
303 /// - nil if successful
304 /// - NSError* with an code set to ICReturnDeleteFilesFailed if any file failed.
305 ///
306 /// - result: NSDictionary
307 /// <ICDeleteResult
308 /// , NSArray
309 /// <ICCameraItem
310 /// *>*>* result
311 /// - ICDeleteSuccessful: NSArray
312 /// <ICCameraItem
313 /// *>* success
314 /// - ICDeleteFailed: NSArray
315 /// <ICCameraItem
316 /// *>* failed
317 #[unsafe(method(requestDeleteFiles:deleteFailed:completion:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn requestDeleteFiles_deleteFailed_completion(
320 &self,
321 files: &NSArray<ICCameraItem>,
322 delete_failed: &block2::DynBlock<
323 dyn Fn(NonNull<NSDictionary<ICDeleteError, ICCameraItem>>),
324 >,
325 completion: &block2::DynBlock<
326 dyn Fn(NonNull<NSDictionary<ICDeleteResult, NSArray<ICCameraItem>>>, *mut NSError),
327 >,
328 ) -> Option<Retained<NSProgress>>;
329
330 /// Cancels the current delete operation started by sending a 'requestDeleteFiles:'. This will only cancel operations in flight when a batch of files have been requested for deletion.
331 #[unsafe(method(cancelDelete))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn cancelDelete(&self);
334
335 /// Synchronize camera's clock with the computer's clock. You should send this request only if the camera has the 'ICCameraDeviceCanSyncClock' capability.
336 #[unsafe(method(requestSyncClock))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn requestSyncClock(&self);
339
340 /// Indicates the time offset, in seconds, between the camera's clock and the computer's clock. This value is positive if the camera's clock is ahead of the computer's clock. This property should be ignored if the camera's capabilities property does not contain ICCameraDeviceCanSyncClock.
341 #[unsafe(method(timeOffset))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn timeOffset(&self) -> NSTimeInterval;
344
345 /// Indicates if the device has reported battery charge level.
346 #[unsafe(method(batteryLevelAvailable))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn batteryLevelAvailable(&self) -> bool;
349
350 /// Indicates the battery charge level. Its value ranges from 0 to 100.
351 #[unsafe(method(batteryLevel))]
352 #[unsafe(method_family = none)]
353 pub unsafe fn batteryLevel(&self) -> NSUInteger;
354
355 /// Upload a file at fileURL to the camera. The options dictionary is not used in this version.
356 ///
357 /// The uploadDelegate passed must not be nil. When this request is completed, the didUploadSelector of the uploadDelegate object is called. The didUploadSelector should have the same signature as: - (void)didUploadFile:(NSURL*)fileURL error:(NSError*)error contextInfo:(void*)contextInfo. The content of error returned should be examined to determine if the request completed successfully.
358 #[deprecated = "Sandbox restrictions prohibit writing directly to device hardware"]
359 #[unsafe(method(requestUploadFile:options:uploadDelegate:didUploadSelector:contextInfo:))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn requestUploadFile_options_uploadDelegate_didUploadSelector_contextInfo(
362 &self,
363 file_url: &NSURL,
364 options: &NSDictionary<ICUploadOption, AnyObject>,
365 upload_delegate: &AnyObject,
366 selector: Sel,
367 context_info: *mut c_void,
368 );
369
370 /// This property is always set to YES when the device has the capability 'ICCameraDeviceCanTakePicture'
371 ///
372 /// requestEnableTethering/requestDisableTethering is no longer required to setup and destroy the standard
373 /// take picture functionality of supported cameras.
374 #[unsafe(method(tetheredCaptureEnabled))]
375 #[unsafe(method_family = none)]
376 pub unsafe fn tetheredCaptureEnabled(&self) -> bool;
377
378 /// Capture a new image using the camera, the camera capabilities include 'ICCameraDeviceCanTakePicture'.
379 #[unsafe(method(requestTakePicture))]
380 #[unsafe(method_family = none)]
381 pub unsafe fn requestTakePicture(&self);
382
383 /// Send this message to enable tethered capture on the camera device if the camera has the 'ICCameraDeviceCanTakePicture' capability.
384 #[deprecated = "Third party cameras that support the standard take picture command will have the capability enabled by default. This call will have no effect"]
385 #[unsafe(method(requestEnableTethering))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn requestEnableTethering(&self);
388
389 /// Send this message to disable tethered capture on the camera device if the camera has the 'ICCameraDeviceCanTakePicture' capability and if your process has already sent a 'requestEnableTethering' to it.
390 #[deprecated = "Third party cameras that support the standard take picture command will have the capability enabled by default. This call will have no effect"]
391 #[unsafe(method(requestDisableTethering))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn requestDisableTethering(&self);
394
395 #[cfg(feature = "block2")]
396 /// As an alternative to setting up an object to handle PTP event packets, a handler can be set. The handler will always be called in place of the delegate if non-nil. If the handler is not present, the delegate will be called if present. It is guaranteed only one of the methods will be called if both are implemented.
397 #[unsafe(method(ptpEventHandler))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn ptpEventHandler(&self) -> NonNull<block2::DynBlock<dyn Fn(NonNull<NSData>)>>;
400
401 #[cfg(feature = "block2")]
402 /// Setter for [`ptpEventHandler`][Self::ptpEventHandler].
403 #[unsafe(method(setPtpEventHandler:))]
404 #[unsafe(method_family = none)]
405 pub unsafe fn setPtpEventHandler(
406 &self,
407 ptp_event_handler: &block2::DynBlock<dyn Fn(NonNull<NSData>)>,
408 );
409
410 /// This method asynchronously sends a PTP command to a camera.
411 ///
412 /// This should be sent only if the 'capabilities' property contains 'ICCameraDeviceCanAcceptPTPCommands'. All PTP cameras have this capability. The response to this command will be delivered using didSendCommandSelector of sendCommandDelegate. The didSendCommandSelector should have the same signature as: - (void)didSendPTPCommand:(NSData*)command inData:(NSData*)data response:(NSData*)response error:(NSError*)error contextInfo:(void*)contextInfo. The content of error returned should be examined to determine if the request completed successfully.
413 #[unsafe(method(requestSendPTPCommand:outData:sendCommandDelegate:didSendCommandSelector:contextInfo:))]
414 #[unsafe(method_family = none)]
415 pub unsafe fn requestSendPTPCommand_outData_sendCommandDelegate_didSendCommandSelector_contextInfo(
416 &self,
417 command: &NSData,
418 data: Option<&NSData>,
419 send_command_delegate: &AnyObject,
420 selector: Sel,
421 context_info: *mut c_void,
422 );
423
424 #[cfg(feature = "block2")]
425 /// This method asynchronously sends a PTP command to a camera.
426 ///
427 /// The response, data, and any error message will be returned the block.
428 #[unsafe(method(requestSendPTPCommand:outData:completion:))]
429 #[unsafe(method_family = none)]
430 pub unsafe fn requestSendPTPCommand_outData_completion(
431 &self,
432 ptp_command: &NSData,
433 ptp_data: Option<&NSData>,
434 completion: &block2::DynBlock<dyn Fn(NonNull<NSData>, NonNull<NSData>, *mut NSError)>,
435 );
436 );
437}
438
439/// Methods declared on superclass `NSObject`.
440#[cfg(feature = "ICDevice")]
441impl ICCameraDevice {
442 extern_methods!(
443 #[unsafe(method(init))]
444 #[unsafe(method_family = init)]
445 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
446
447 #[unsafe(method(new))]
448 #[unsafe(method_family = new)]
449 pub unsafe fn new() -> Retained<Self>;
450 );
451}
452
453extern_protocol!(
454 /// A delegate of ICCameraDevice must conform to ICCameraDeviceDelegate protocol.
455 ///
456 /// The ICCameraDeviceDelegate protocol inherits from the ICDeviceDelegate protocol.
457 ///
458 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicedelegate?language=objc)
459 #[cfg(feature = "ICDevice")]
460 pub unsafe trait ICCameraDeviceDelegate: ICDeviceDelegate {
461 #[cfg(feature = "ICCameraItem")]
462 /// This message is sent when objects are added to the device.
463 ///
464 /// The objects in items are instances ICCameraFile class.
465 #[unsafe(method(cameraDevice:didAddItems:))]
466 #[unsafe(method_family = none)]
467 unsafe fn cameraDevice_didAddItems(
468 &self,
469 camera: &ICCameraDevice,
470 items: &NSArray<ICCameraItem>,
471 );
472
473 #[cfg(feature = "ICCameraItem")]
474 /// This message is sent when objects are removed from the device.
475 ///
476 /// The objects in items are instances ICCameraFile class.
477 #[unsafe(method(cameraDevice:didRemoveItems:))]
478 #[unsafe(method_family = none)]
479 unsafe fn cameraDevice_didRemoveItems(
480 &self,
481 camera: &ICCameraDevice,
482 items: &NSArray<ICCameraItem>,
483 );
484
485 #[cfg(all(feature = "ICCameraItem", feature = "objc2-core-graphics"))]
486 /// This message is sent when the thumbnail requested for an item on a device is available.
487 #[unsafe(method(cameraDevice:didReceiveThumbnail:forItem:error:))]
488 #[unsafe(method_family = none)]
489 unsafe fn cameraDevice_didReceiveThumbnail_forItem_error(
490 &self,
491 camera: &ICCameraDevice,
492 thumbnail: Option<&CGImage>,
493 item: &ICCameraItem,
494 error: Option<&NSError>,
495 );
496
497 #[cfg(feature = "ICCameraItem")]
498 /// This message is sent when the metadata requested for an item on a device is available.
499 #[unsafe(method(cameraDevice:didReceiveMetadata:forItem:error:))]
500 #[unsafe(method_family = none)]
501 unsafe fn cameraDevice_didReceiveMetadata_forItem_error(
502 &self,
503 camera: &ICCameraDevice,
504 metadata: Option<&NSDictionary>,
505 item: &ICCameraItem,
506 error: Option<&NSError>,
507 );
508
509 #[cfg(feature = "ICCameraItem")]
510 /// This message is sent when an object or objects are renamed on the device.
511 ///
512 /// The objects may be instances of ICCameraFolder or ICCameraFile class.
513 #[unsafe(method(cameraDevice:didRenameItems:))]
514 #[unsafe(method_family = none)]
515 unsafe fn cameraDevice_didRenameItems(
516 &self,
517 camera: &ICCameraDevice,
518 items: &NSArray<ICCameraItem>,
519 );
520
521 /// This message is sent when a capability of a device changes.
522 ///
523 /// Detailed capabilitiy descriptions are provided at the top of this header file.
524 #[unsafe(method(cameraDeviceDidChangeCapability:))]
525 #[unsafe(method_family = none)]
526 unsafe fn cameraDeviceDidChangeCapability(&self, camera: &ICCameraDevice);
527
528 /// This message is sent to the delegate to convey a PTP event.
529 #[unsafe(method(cameraDevice:didReceivePTPEvent:))]
530 #[unsafe(method_family = none)]
531 unsafe fn cameraDevice_didReceivePTPEvent(
532 &self,
533 camera: &ICCameraDevice,
534 event_data: &NSData,
535 );
536
537 /// This message is sent when the camera device is done enumerating its content and is ready to receive requests.
538 ///
539 /// A session must be opened on the device in order to enumerate its content and make it ready to receive requests.
540 #[unsafe(method(deviceDidBecomeReadyWithCompleteContentCatalog:))]
541 #[unsafe(method_family = none)]
542 unsafe fn deviceDidBecomeReadyWithCompleteContentCatalog(&self, device: &ICCameraDevice);
543
544 /// This message is sent when an Apple device has been unlocked, paired to the host, and media is available.
545 #[unsafe(method(cameraDeviceDidRemoveAccessRestriction:))]
546 #[unsafe(method_family = none)]
547 unsafe fn cameraDeviceDidRemoveAccessRestriction(&self, device: &ICDevice);
548
549 /// This message is sent when an Apple device has been locked, and media is unavailable until the restriction
550 /// has been removed.
551 #[unsafe(method(cameraDeviceDidEnableAccessRestriction:))]
552 #[unsafe(method_family = none)]
553 unsafe fn cameraDeviceDidEnableAccessRestriction(&self, device: &ICDevice);
554
555 #[cfg(feature = "ICCameraItem")]
556 /// This message is sent when the camera device is about to execute queued requests for the thumbnail of a specific item.
557 /// If the request is no longer wanted, eg: the item is no longer displayed on the screen, the client can return NO and abort sending
558 /// a request down to the camera device, speeding up the exection queue.
559 #[optional]
560 #[unsafe(method(cameraDevice:shouldGetThumbnailOfItem:))]
561 #[unsafe(method_family = none)]
562 unsafe fn cameraDevice_shouldGetThumbnailOfItem(
563 &self,
564 camera_device: &ICCameraDevice,
565 item: &ICCameraItem,
566 ) -> bool;
567
568 #[cfg(feature = "ICCameraItem")]
569 /// This message is sent when the camera device is about to execute queued requests for the metadata of a specific item.
570 /// If the request is no longer wanted, eg: the item is no longer displayed on the screen, the client can return NO and abort sending
571 /// a request down to the camera device, speeding up the execution queue.
572 #[optional]
573 #[unsafe(method(cameraDevice:shouldGetMetadataOfItem:))]
574 #[unsafe(method_family = none)]
575 unsafe fn cameraDevice_shouldGetMetadataOfItem(
576 &self,
577 camera_device: &ICCameraDevice,
578 item: &ICCameraItem,
579 ) -> bool;
580
581 /// This message is sent after the camera device completes a delete operation initiated by sending a 'requestDeleteFiles:' message to that device.
582 ///
583 /// This message is sent after the camera device completes a delete operation initiated by sending a 'requestDeleteFiles:' message to that device.
584 #[optional]
585 #[unsafe(method(cameraDevice:didCompleteDeleteFilesWithError:))]
586 #[unsafe(method_family = none)]
587 unsafe fn cameraDevice_didCompleteDeleteFilesWithError(
588 &self,
589 camera: &ICCameraDevice,
590 error: Option<&NSError>,
591 );
592
593 #[cfg(feature = "ICCameraItem")]
594 #[deprecated]
595 #[optional]
596 #[unsafe(method(cameraDevice:didAddItem:))]
597 #[unsafe(method_family = none)]
598 unsafe fn cameraDevice_didAddItem(&self, camera: &ICCameraDevice, item: &ICCameraItem);
599
600 #[cfg(feature = "ICCameraItem")]
601 #[deprecated]
602 #[optional]
603 #[unsafe(method(cameraDevice:didRemoveItem:))]
604 #[unsafe(method_family = none)]
605 unsafe fn cameraDevice_didRemoveItem(&self, camera: &ICCameraDevice, item: &ICCameraItem);
606
607 #[cfg(feature = "ICCameraItem")]
608 #[deprecated]
609 #[optional]
610 #[unsafe(method(cameraDevice:didReceiveThumbnailForItem:))]
611 #[unsafe(method_family = none)]
612 unsafe fn cameraDevice_didReceiveThumbnailForItem(
613 &self,
614 camera: &ICCameraDevice,
615 item: &ICCameraItem,
616 );
617
618 #[cfg(feature = "ICCameraItem")]
619 #[deprecated]
620 #[optional]
621 #[unsafe(method(cameraDevice:didReceiveMetadataForItem:))]
622 #[unsafe(method_family = none)]
623 unsafe fn cameraDevice_didReceiveMetadataForItem(
624 &self,
625 camera: &ICCameraDevice,
626 item: &ICCameraItem,
627 );
628 }
629);
630
631extern_protocol!(
632 /// The object passed in as 'downloadDelegate' in the 'requestDownloadFile:options:downloadDelegate:didDownloadSelector:contextInfo:' message must conform to ICCameraDeviceDownloadDelegate protocol.
633 ///
634 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccameradevicedownloaddelegate?language=objc)
635 pub unsafe trait ICCameraDeviceDownloadDelegate: NSObjectProtocol {
636 #[cfg(all(feature = "ICCameraFile", feature = "ICCameraItem"))]
637 /// This message is sent to the delegate when the requested download operation is complete.
638 #[optional]
639 #[unsafe(method(didDownloadFile:error:options:contextInfo:))]
640 #[unsafe(method_family = none)]
641 unsafe fn didDownloadFile_error_options_contextInfo(
642 &self,
643 file: &ICCameraFile,
644 error: Option<&NSError>,
645 options: &NSDictionary<NSString, AnyObject>,
646 context_info: *mut c_void,
647 );
648
649 #[cfg(all(feature = "ICCameraFile", feature = "ICCameraItem", feature = "libc"))]
650 /// This message is sent to the delegate to provide status of the download operation.
651 #[optional]
652 #[unsafe(method(didReceiveDownloadProgressForFile:downloadedBytes:maxBytes:))]
653 #[unsafe(method_family = none)]
654 unsafe fn didReceiveDownloadProgressForFile_downloadedBytes_maxBytes(
655 &self,
656 file: &ICCameraFile,
657 downloaded_bytes: libc::off_t,
658 max_bytes: libc::off_t,
659 );
660 }
661);