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
//! 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::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// This class represents a file on an ICCameraDevice object.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccamerafile?language=objc)
#[unsafe(super(ICCameraItem, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "ICCameraItem")]
pub struct ICCameraFile;
);
#[cfg(feature = "ICCameraItem")]
extern_conformance!(
unsafe impl NSObjectProtocol for ICCameraFile {}
);
#[cfg(feature = "ICCameraItem")]
impl ICCameraFile {
extern_methods!(
/// Width of an image or movie frame.
#[unsafe(method(width))]
#[unsafe(method_family = none)]
pub unsafe fn width(&self) -> NSInteger;
/// Height of an image or movie frame.
#[unsafe(method(height))]
#[unsafe(method_family = none)]
pub unsafe fn height(&self) -> NSInteger;
/// Original filename on disk
#[unsafe(method(originalFilename))]
#[unsafe(method_family = none)]
pub unsafe fn originalFilename(&self) -> Option<Retained<NSString>>;
/// Created filename
#[unsafe(method(createdFilename))]
#[unsafe(method_family = none)]
pub unsafe fn createdFilename(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "libc")]
/// Size of file in bytes.
#[unsafe(method(fileSize))]
#[unsafe(method_family = none)]
pub unsafe fn fileSize(&self) -> libc::off_t;
#[cfg(feature = "ImageCaptureConstants")]
/// Desired orientation of image to use when it is downloaded.
///
/// This property is set to ICEXIFOrientation1 initially. If the format of this file supports EXIF orientation tag, then this property will be updated to match the value of that tag, when the thumbnail or metadata for this file is received.
#[unsafe(method(orientation))]
#[unsafe(method_family = none)]
pub unsafe fn orientation(&self) -> ICEXIFOrientationType;
#[cfg(feature = "ImageCaptureConstants")]
/// Setter for [`orientation`][Self::orientation].
#[unsafe(method(setOrientation:))]
#[unsafe(method_family = none)]
pub unsafe fn setOrientation(&self, orientation: ICEXIFOrientationType);
/// Duration of audio/video file in seconds.
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
pub unsafe fn duration(&self) -> c_double;
/// True if file is a slo-mo or high framerate video file, nil otherwise.
#[unsafe(method(highFramerate))]
#[unsafe(method_family = none)]
pub unsafe fn highFramerate(&self) -> bool;
/// True if file is a time-lapse video file, nil otherwise.
#[unsafe(method(timeLapse))]
#[unsafe(method_family = none)]
pub unsafe fn timeLapse(&self) -> bool;
/// True if file is a firstPicked nil otherwise.
#[unsafe(method(firstPicked))]
#[unsafe(method_family = none)]
pub unsafe fn firstPicked(&self) -> bool;
/// originatingAssetID of file if present, nil if not a HEIF or HVEC.
#[unsafe(method(originatingAssetID))]
#[unsafe(method_family = none)]
pub unsafe fn originatingAssetID(&self) -> Option<Retained<NSString>>;
/// groupUUID of file if present, nil if file has no groupUUID.
#[unsafe(method(groupUUID))]
#[unsafe(method_family = none)]
pub unsafe fn groupUUID(&self) -> Option<Retained<NSString>>;
/// GPS String in standard format.
#[unsafe(method(gpsString))]
#[unsafe(method_family = none)]
pub unsafe fn gpsString(&self) -> Option<Retained<NSString>>;
/// Internal related UUID for dbg/aae/etc.
#[unsafe(method(relatedUUID))]
#[unsafe(method_family = none)]
pub unsafe fn relatedUUID(&self) -> Option<Retained<NSString>>;
/// burstUUID of file if present, nil if not in a burst.
#[unsafe(method(burstUUID))]
#[unsafe(method_family = none)]
pub unsafe fn burstUUID(&self) -> Option<Retained<NSString>>;
/// True if burst favorite, ignored if not in a burst or not a burst favorite.
#[unsafe(method(burstFavorite))]
#[unsafe(method_family = none)]
pub unsafe fn burstFavorite(&self) -> bool;
/// True if burst user picked, ignored if not in a burst or not a burst user picked.
#[unsafe(method(burstPicked))]
#[unsafe(method_family = none)]
pub unsafe fn burstPicked(&self) -> bool;
/// This property is NULL if there are no sidecar files associated with this file. Otherwise it is an array of
/// ICCameraFile instances of sidecar files associated with this file. An example of a sidecar file is a file with the same base
/// name as this file and having an extension XMP.
#[unsafe(method(sidecarFiles))]
#[unsafe(method_family = none)]
pub unsafe fn sidecarFiles(&self) -> Option<Retained<NSArray<ICCameraItem>>>;
/// A single item subset of the sidecarFiles array, which contains the logical RAW compliment of a JPG or other
/// format image.
#[unsafe(method(pairedRawImage))]
#[unsafe(method_family = none)]
pub unsafe fn pairedRawImage(&self) -> Option<Retained<ICCameraFile>>;
/// Properties will either represent the actual file creation
/// date, or nil.
#[unsafe(method(fileCreationDate))]
#[unsafe(method_family = none)]
pub unsafe fn fileCreationDate(&self) -> Option<Retained<NSDate>>;
/// Properties will either represent the actual file modification
/// date, or nil.
#[unsafe(method(fileModificationDate))]
#[unsafe(method_family = none)]
pub unsafe fn fileModificationDate(&self) -> Option<Retained<NSDate>>;
/// Properties will either represent the exif creation
/// date, or nil.
#[unsafe(method(exifCreationDate))]
#[unsafe(method_family = none)]
pub unsafe fn exifCreationDate(&self) -> Option<Retained<NSDate>>;
/// Properties will either represent the exif modification
/// date, or nil.
#[unsafe(method(exifModificationDate))]
#[unsafe(method_family = none)]
pub unsafe fn exifModificationDate(&self) -> Option<Retained<NSDate>>;
/// A fingerprint generated from the camera file data
/// date, or nil.
#[unsafe(method(fingerprint))]
#[unsafe(method_family = none)]
pub unsafe fn fingerprint(&self) -> Option<Retained<NSString>>;
/// Generates a fingerprint given a URL
/// date, or nil.
#[unsafe(method(fingerprintForFileAtURL:))]
#[unsafe(method_family = none)]
pub unsafe fn fingerprintForFileAtURL(url: &NSURL) -> Option<Retained<NSString>>;
#[cfg(feature = "block2")]
/// Perform a thumbnail request and execute the block callback in place of the delegate.
///
/// Parameter `options`: Options dictionary
///
/// - 'kCGImageSourceThumbnailMaxPixelSize' - Request a width different from the embedded EXIF thumbnail
///
///
/// Parameter `completion`: Completion block called with an NSData* object representing the JPG, and an NSError* for status.
///
/// 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(requestThumbnailDataWithOptions:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestThumbnailDataWithOptions_completion(
&self,
options: Option<&NSDictionary<ICCameraItemThumbnailOption, AnyObject>>,
completion: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
);
#[cfg(feature = "block2")]
/// Perform a metadata request and execute the block callback in place of the delegate.
///
/// Parameter `options`: Options dictionary
///
/// Parameter `completion`: Completion block called with an NSDictionary* object containing the metadata, and an NSError* for status.
///
/// 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(requestMetadataDictionaryWithOptions:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestMetadataDictionaryWithOptions_completion(
&self,
options: Option<&NSDictionary<ICCameraItemMetadataOption, AnyObject>>,
completion: &block2::DynBlock<dyn Fn(*mut NSDictionary, *mut NSError)>,
);
#[cfg(feature = "block2")]
/// Perform a download request and execute the block callback in place of the delegate.
///
/// Parameter `options`: Dictionary Keys:
///
/// - `ICDownloadsDirectoryURL`
/// - `ICSaveAsFilename`
/// - `ICOverwriteExistingFile`
/// - `ICDeleteAfterDownload`
/// - `ICAdjustCreationDate`
///
///
/// Parameter `completion`: Completion block to executed after request has returned,
///
/// 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(requestDownloadWithOptions:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestDownloadWithOptions_completion(
&self,
options: Option<&NSDictionary<ICDownloadOption, AnyObject>>,
completion: &block2::DynBlock<dyn Fn(*mut NSString, *mut NSError)>,
) -> Option<Retained<NSProgress>>;
#[cfg(all(feature = "block2", feature = "libc"))]
/// This method asynchronously reads data of a specified length from a specified offset.
///
/// Parameter `offset`: The offset into the file to start reading from
///
/// Parameter `length`: The length of data to be read.
///
/// Parameter `completion`: Completion block called with an NSData* object representing the data, and an NSError* for status.
///
/// Note: The completion block will execute on an any available queue, often this will not be the main queue.
#[unsafe(method(requestReadDataAtOffset:length:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestReadDataAtOffset_length_completion(
&self,
offset: libc::off_t,
length: libc::off_t,
completion: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
);
#[cfg(feature = "block2")]
/// Requests a security scoped NSURL* for a media file on a mass storage volume. The returned NSURL* requires the use of
/// startAccessingSecurityScopedResource, and stopAccessingSecurityScopedResource for access.
///
/// Parameter `completion`: Completion block called with an NSURL*, and an NSError* for status.
///
/// Note: The completion block will execute on an any available queue, often this will not be the main queue.
#[unsafe(method(requestSecurityScopedURLWithCompletion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestSecurityScopedURLWithCompletion(
&self,
completion: &block2::DynBlock<dyn Fn(*mut NSURL, *mut NSError)>,
);
#[cfg(feature = "block2")]
/// Requests a fingerprint be generated for camera file.
///
/// Parameter `completion`: Completion block called with an NSString*, and an NSError* for status.
///
/// Note: The completion block will execute on an any available queue, often this will not be the main queue.
#[unsafe(method(requestFingerprintWithCompletion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestFingerprintWithCompletion(
&self,
completion: &block2::DynBlock<dyn Fn(*mut NSString, *mut NSError)>,
);
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "ICCameraItem")]
impl ICCameraFile {
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>;
);
}