objc2_image_capture_core/generated/ICCameraFile.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 /// This class represents a file on an ICCameraDevice object.
12 ///
13 /// See also [Apple's documentation](https://developer.apple.com/documentation/imagecapturecore/iccamerafile?language=objc)
14 #[unsafe(super(ICCameraItem, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(feature = "ICCameraItem")]
17 pub struct ICCameraFile;
18);
19
20#[cfg(feature = "ICCameraItem")]
21extern_conformance!(
22 unsafe impl NSObjectProtocol for ICCameraFile {}
23);
24
25#[cfg(feature = "ICCameraItem")]
26impl ICCameraFile {
27 extern_methods!(
28 /// Width of an image or movie frame.
29 #[unsafe(method(width))]
30 #[unsafe(method_family = none)]
31 pub unsafe fn width(&self) -> NSInteger;
32
33 /// Height of an image or movie frame.
34 #[unsafe(method(height))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn height(&self) -> NSInteger;
37
38 /// Original filename on disk
39 #[unsafe(method(originalFilename))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn originalFilename(&self) -> Option<Retained<NSString>>;
42
43 /// Created filename
44 #[unsafe(method(createdFilename))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn createdFilename(&self) -> Option<Retained<NSString>>;
47
48 #[cfg(feature = "libc")]
49 /// Size of file in bytes.
50 #[unsafe(method(fileSize))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn fileSize(&self) -> libc::off_t;
53
54 #[cfg(feature = "ImageCaptureConstants")]
55 /// Desired orientation of image to use when it is downloaded.
56 ///
57 /// 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.
58 #[unsafe(method(orientation))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn orientation(&self) -> ICEXIFOrientationType;
61
62 #[cfg(feature = "ImageCaptureConstants")]
63 /// Setter for [`orientation`][Self::orientation].
64 #[unsafe(method(setOrientation:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setOrientation(&self, orientation: ICEXIFOrientationType);
67
68 /// Duration of audio/video file in seconds.
69 #[unsafe(method(duration))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn duration(&self) -> c_double;
72
73 /// True if file is a slo-mo or high framerate video file, nil otherwise.
74 #[unsafe(method(highFramerate))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn highFramerate(&self) -> bool;
77
78 /// True if file is a time-lapse video file, nil otherwise.
79 #[unsafe(method(timeLapse))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn timeLapse(&self) -> bool;
82
83 /// True if file is a firstPicked nil otherwise.
84 #[unsafe(method(firstPicked))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn firstPicked(&self) -> bool;
87
88 /// originatingAssetID of file if present, nil if not a HEIF or HVEC.
89 #[unsafe(method(originatingAssetID))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn originatingAssetID(&self) -> Option<Retained<NSString>>;
92
93 /// groupUUID of file if present, nil if file has no groupUUID.
94 #[unsafe(method(groupUUID))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn groupUUID(&self) -> Option<Retained<NSString>>;
97
98 /// GPS String in standard format.
99 #[unsafe(method(gpsString))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn gpsString(&self) -> Option<Retained<NSString>>;
102
103 /// Internal related UUID for dbg/aae/etc.
104 #[unsafe(method(relatedUUID))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn relatedUUID(&self) -> Option<Retained<NSString>>;
107
108 /// burstUUID of file if present, nil if not in a burst.
109 #[unsafe(method(burstUUID))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn burstUUID(&self) -> Option<Retained<NSString>>;
112
113 /// True if burst favorite, ignored if not in a burst or not a burst favorite.
114 #[unsafe(method(burstFavorite))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn burstFavorite(&self) -> bool;
117
118 /// True if burst user picked, ignored if not in a burst or not a burst user picked.
119 #[unsafe(method(burstPicked))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn burstPicked(&self) -> bool;
122
123 /// This property is NULL if there are no sidecar files associated with this file. Otherwise it is an array of
124 /// ICCameraFile instances of sidecar files associated with this file. An example of a sidecar file is a file with the same base
125 /// name as this file and having an extension XMP.
126 #[unsafe(method(sidecarFiles))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn sidecarFiles(&self) -> Option<Retained<NSArray<ICCameraItem>>>;
129
130 /// A single item subset of the sidecarFiles array, which contains the logical RAW compliment of a JPG or other
131 /// format image.
132 #[unsafe(method(pairedRawImage))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn pairedRawImage(&self) -> Option<Retained<ICCameraFile>>;
135
136 /// Properties will either represent the actual file creation
137 /// date, or nil.
138 #[unsafe(method(fileCreationDate))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn fileCreationDate(&self) -> Option<Retained<NSDate>>;
141
142 /// Properties will either represent the actual file modification
143 /// date, or nil.
144 #[unsafe(method(fileModificationDate))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn fileModificationDate(&self) -> Option<Retained<NSDate>>;
147
148 /// Properties will either represent the exif creation
149 /// date, or nil.
150 #[unsafe(method(exifCreationDate))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn exifCreationDate(&self) -> Option<Retained<NSDate>>;
153
154 /// Properties will either represent the exif modification
155 /// date, or nil.
156 #[unsafe(method(exifModificationDate))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn exifModificationDate(&self) -> Option<Retained<NSDate>>;
159
160 /// A fingerprint generated from the camera file data
161 /// date, or nil.
162 #[unsafe(method(fingerprint))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn fingerprint(&self) -> Option<Retained<NSString>>;
165
166 /// Generates a fingerprint given a URL
167 /// date, or nil.
168 #[unsafe(method(fingerprintForFileAtURL:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn fingerprintForFileAtURL(url: &NSURL) -> Option<Retained<NSString>>;
171
172 #[cfg(feature = "block2")]
173 /// Perform a thumbnail request and execute the block callback in place of the delegate.
174 ///
175 /// Parameter `options`: Options dictionary
176 ///
177 /// - 'kCGImageSourceThumbnailMaxPixelSize' - Request a width different from the embedded EXIF thumbnail
178 ///
179 ///
180 /// Parameter `completion`: Completion block called with an NSData* object representing the JPG, and an NSError* for status.
181 ///
182 /// Note: The completion block will execute on an any available queue, often this will not be the main queue.
183 ///
184 /// # Safety
185 ///
186 /// `options` generic should be of the correct type.
187 #[unsafe(method(requestThumbnailDataWithOptions:completion:))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn requestThumbnailDataWithOptions_completion(
190 &self,
191 options: Option<&NSDictionary<ICCameraItemThumbnailOption, AnyObject>>,
192 completion: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
193 );
194
195 #[cfg(feature = "block2")]
196 /// Perform a metadata request and execute the block callback in place of the delegate.
197 ///
198 /// Parameter `options`: Options dictionary
199 ///
200 /// Parameter `completion`: Completion block called with an NSDictionary* object containing the metadata, and an NSError* for status.
201 ///
202 /// Note: The completion block will execute on an any available queue, often this will not be the main queue.
203 ///
204 /// # Safety
205 ///
206 /// `options` generic should be of the correct type.
207 #[unsafe(method(requestMetadataDictionaryWithOptions:completion:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn requestMetadataDictionaryWithOptions_completion(
210 &self,
211 options: Option<&NSDictionary<ICCameraItemMetadataOption, AnyObject>>,
212 completion: &block2::DynBlock<dyn Fn(*mut NSDictionary, *mut NSError)>,
213 );
214
215 #[cfg(feature = "block2")]
216 /// Perform a download request and execute the block callback in place of the delegate.
217 ///
218 /// Parameter `options`: Dictionary Keys:
219 ///
220 /// - `ICDownloadsDirectoryURL`
221 /// - `ICSaveAsFilename`
222 /// - `ICOverwriteExistingFile`
223 /// - `ICDeleteAfterDownload`
224 /// - `ICAdjustCreationDate`
225 ///
226 ///
227 /// Parameter `completion`: Completion block to executed after request has returned,
228 ///
229 /// Note: The completion block will execute on an any available queue, often this will not be the main queue.
230 ///
231 /// # Safety
232 ///
233 /// `options` generic should be of the correct type.
234 #[unsafe(method(requestDownloadWithOptions:completion:))]
235 #[unsafe(method_family = none)]
236 pub unsafe fn requestDownloadWithOptions_completion(
237 &self,
238 options: Option<&NSDictionary<ICDownloadOption, AnyObject>>,
239 completion: &block2::DynBlock<dyn Fn(*mut NSString, *mut NSError)>,
240 ) -> Option<Retained<NSProgress>>;
241
242 #[cfg(all(feature = "block2", feature = "libc"))]
243 /// This method asynchronously reads data of a specified length from a specified offset.
244 ///
245 /// Parameter `offset`: The offset into the file to start reading from
246 ///
247 /// Parameter `length`: The length of data to be read.
248 ///
249 /// Parameter `completion`: Completion block called with an NSData* object representing the data, and an NSError* for status.
250 ///
251 /// Note: The completion block will execute on an any available queue, often this will not be the main queue.
252 #[unsafe(method(requestReadDataAtOffset:length:completion:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn requestReadDataAtOffset_length_completion(
255 &self,
256 offset: libc::off_t,
257 length: libc::off_t,
258 completion: &block2::DynBlock<dyn Fn(*mut NSData, *mut NSError)>,
259 );
260
261 #[cfg(feature = "block2")]
262 /// Requests a security scoped NSURL* for a media file on a mass storage volume. The returned NSURL* requires the use of
263 /// startAccessingSecurityScopedResource, and stopAccessingSecurityScopedResource for access.
264 ///
265 /// Parameter `completion`: Completion block called with an NSURL*, and an NSError* for status.
266 ///
267 /// Note: The completion block will execute on an any available queue, often this will not be the main queue.
268 #[unsafe(method(requestSecurityScopedURLWithCompletion:))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn requestSecurityScopedURLWithCompletion(
271 &self,
272 completion: &block2::DynBlock<dyn Fn(*mut NSURL, *mut NSError)>,
273 );
274
275 #[cfg(feature = "block2")]
276 /// Requests a fingerprint be generated for camera file.
277 ///
278 /// Parameter `completion`: Completion block called with an NSString*, and an NSError* for status.
279 ///
280 /// Note: The completion block will execute on an any available queue, often this will not be the main queue.
281 #[unsafe(method(requestFingerprintWithCompletion:))]
282 #[unsafe(method_family = none)]
283 pub unsafe fn requestFingerprintWithCompletion(
284 &self,
285 completion: &block2::DynBlock<dyn Fn(*mut NSString, *mut NSError)>,
286 );
287 );
288}
289
290/// Methods declared on superclass `NSObject`.
291#[cfg(feature = "ICCameraItem")]
292impl ICCameraFile {
293 extern_methods!(
294 #[unsafe(method(init))]
295 #[unsafe(method_family = init)]
296 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
297
298 #[unsafe(method(new))]
299 #[unsafe(method_family = new)]
300 pub unsafe fn new() -> Retained<Self>;
301 );
302}