objc2_photos/generated/
PHAsset.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-location")]
6use objc2_core_location::*;
7use objc2_foundation::*;
8#[cfg(feature = "objc2-uniform-type-identifiers")]
9use objc2_uniform_type_identifiers::*;
10
11use crate::*;
12
13extern_class!(
14 #[unsafe(super(PHObject, NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "PHObject")]
18 pub struct PHAsset;
19);
20
21#[cfg(feature = "PHObject")]
22unsafe impl Send for PHAsset {}
23
24#[cfg(feature = "PHObject")]
25unsafe impl Sync for PHAsset {}
26
27#[cfg(feature = "PHObject")]
28extern_conformance!(
29 unsafe impl NSCopying for PHAsset {}
30);
31
32#[cfg(feature = "PHObject")]
33unsafe impl CopyingHelper for PHAsset {
34 type Result = Self;
35}
36
37#[cfg(feature = "PHObject")]
38extern_conformance!(
39 unsafe impl NSObjectProtocol for PHAsset {}
40);
41
42#[cfg(feature = "PHObject")]
43impl PHAsset {
44 extern_methods!(
45 #[cfg(feature = "PhotosTypes")]
46 #[unsafe(method(playbackStyle))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn playbackStyle(&self) -> PHAssetPlaybackStyle;
54
55 #[cfg(feature = "PhotosTypes")]
56 #[unsafe(method(mediaType))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn mediaType(&self) -> PHAssetMediaType;
64
65 #[cfg(feature = "PhotosTypes")]
66 #[unsafe(method(mediaSubtypes))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn mediaSubtypes(&self) -> PHAssetMediaSubtype;
74
75 #[cfg(feature = "objc2-uniform-type-identifiers")]
76 #[unsafe(method(contentType))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn contentType(&self) -> Retained<UTType>;
86
87 #[unsafe(method(pixelWidth))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn pixelWidth(&self) -> NSUInteger;
95
96 #[unsafe(method(pixelHeight))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn pixelHeight(&self) -> NSUInteger;
104
105 #[unsafe(method(creationDate))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn creationDate(&self) -> Option<Retained<NSDate>>;
115
116 #[unsafe(method(modificationDate))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn modificationDate(&self) -> Option<Retained<NSDate>>;
126
127 #[unsafe(method(addedDate))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn addedDate(&self) -> Retained<NSDate>;
137
138 #[cfg(feature = "objc2-core-location")]
139 #[unsafe(method(location))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn location(&self) -> Option<Retained<CLLocation>>;
147
148 #[unsafe(method(duration))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn duration(&self) -> NSTimeInterval;
156
157 #[unsafe(method(isHidden))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn isHidden(&self) -> bool;
165
166 #[unsafe(method(isFavorite))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn isFavorite(&self) -> bool;
174
175 #[deprecated = "No longer supported"]
181 #[unsafe(method(isSyncFailureHidden))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn isSyncFailureHidden(&self) -> bool;
184
185 #[unsafe(method(burstIdentifier))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn burstIdentifier(&self) -> Option<Retained<NSString>>;
193
194 #[cfg(feature = "PhotosTypes")]
195 #[unsafe(method(burstSelectionTypes))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn burstSelectionTypes(&self) -> PHAssetBurstSelectionType;
203
204 #[unsafe(method(representsBurst))]
210 #[unsafe(method_family = none)]
211 pub unsafe fn representsBurst(&self) -> bool;
212
213 #[cfg(feature = "PhotosTypes")]
214 #[unsafe(method(sourceType))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn sourceType(&self) -> PHAssetSourceType;
222
223 #[unsafe(method(hasAdjustments))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn hasAdjustments(&self) -> bool;
231
232 #[unsafe(method(adjustmentFormatIdentifier))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn adjustmentFormatIdentifier(&self) -> Option<Retained<NSString>>;
240
241 #[cfg(feature = "PhotosTypes")]
242 #[unsafe(method(canPerformEditOperation:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn canPerformEditOperation(&self, edit_operation: PHAssetEditOperation) -> bool;
245
246 #[cfg(all(
247 feature = "PHCollection",
248 feature = "PHFetchOptions",
249 feature = "PHFetchResult"
250 ))]
251 #[unsafe(method(fetchAssetsInAssetCollection:options:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn fetchAssetsInAssetCollection_options(
254 asset_collection: &PHAssetCollection,
255 options: Option<&PHFetchOptions>,
256 ) -> Retained<PHFetchResult<PHAsset>>;
257
258 #[cfg(all(feature = "PHFetchOptions", feature = "PHFetchResult"))]
259 #[unsafe(method(fetchAssetsWithLocalIdentifiers:options:))]
260 #[unsafe(method_family = none)]
261 pub unsafe fn fetchAssetsWithLocalIdentifiers_options(
262 identifiers: &NSArray<NSString>,
263 options: Option<&PHFetchOptions>,
264 ) -> Retained<PHFetchResult<PHAsset>>;
265
266 #[cfg(all(
267 feature = "PHCollection",
268 feature = "PHFetchOptions",
269 feature = "PHFetchResult"
270 ))]
271 #[unsafe(method(fetchKeyAssetsInAssetCollection:options:))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn fetchKeyAssetsInAssetCollection_options(
274 asset_collection: &PHAssetCollection,
275 options: Option<&PHFetchOptions>,
276 ) -> Option<Retained<PHFetchResult<PHAsset>>>;
277
278 #[cfg(all(feature = "PHFetchOptions", feature = "PHFetchResult"))]
279 #[unsafe(method(fetchAssetsWithBurstIdentifier:options:))]
280 #[unsafe(method_family = none)]
281 pub unsafe fn fetchAssetsWithBurstIdentifier_options(
282 burst_identifier: &NSString,
283 options: Option<&PHFetchOptions>,
284 ) -> Retained<PHFetchResult<PHAsset>>;
285
286 #[cfg(all(feature = "PHFetchOptions", feature = "PHFetchResult"))]
287 #[unsafe(method(fetchAssetsWithOptions:))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn fetchAssetsWithOptions(
290 options: Option<&PHFetchOptions>,
291 ) -> Retained<PHFetchResult<PHAsset>>;
292
293 #[cfg(all(
294 feature = "PHFetchOptions",
295 feature = "PHFetchResult",
296 feature = "PhotosTypes"
297 ))]
298 #[unsafe(method(fetchAssetsWithMediaType:options:))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn fetchAssetsWithMediaType_options(
301 media_type: PHAssetMediaType,
302 options: Option<&PHFetchOptions>,
303 ) -> Retained<PHFetchResult<PHAsset>>;
304
305 #[cfg(all(feature = "PHFetchOptions", feature = "PHFetchResult"))]
306 #[deprecated = "Will be removed in a future release"]
307 #[unsafe(method(fetchAssetsWithALAssetURLs:options:))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn fetchAssetsWithALAssetURLs_options(
310 asset_ur_ls: &NSArray<NSURL>,
311 options: Option<&PHFetchOptions>,
312 ) -> Retained<PHFetchResult<PHAsset>>;
313 );
314}
315
316#[cfg(feature = "PHObject")]
318impl PHAsset {
319 extern_methods!(
320 #[unsafe(method(init))]
321 #[unsafe(method_family = init)]
322 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
323
324 #[unsafe(method(new))]
325 #[unsafe(method_family = new)]
326 pub unsafe fn new() -> Retained<Self>;
327 );
328}