objc2-photos 0.2.0

Bindings to the Photos/PhotoKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PHAssetResource;

    unsafe impl ClassType for PHAssetResource {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for PHAssetResource {}

extern_methods!(
    unsafe impl PHAssetResource {
        #[cfg(feature = "PhotosTypes")]
        #[method(type)]
        pub unsafe fn r#type(&self) -> PHAssetResourceType;

        #[method_id(@__retain_semantics Other assetLocalIdentifier)]
        pub unsafe fn assetLocalIdentifier(&self) -> Id<NSString>;

        #[method_id(@__retain_semantics Other uniformTypeIdentifier)]
        pub unsafe fn uniformTypeIdentifier(&self) -> Id<NSString>;

        #[method_id(@__retain_semantics Other originalFilename)]
        pub unsafe fn originalFilename(&self) -> Id<NSString>;

        #[method(pixelWidth)]
        pub unsafe fn pixelWidth(&self) -> NSInteger;

        #[method(pixelHeight)]
        pub unsafe fn pixelHeight(&self) -> NSInteger;

        #[cfg(all(feature = "PHAsset", feature = "PHObject"))]
        #[method_id(@__retain_semantics Other assetResourcesForAsset:)]
        pub unsafe fn assetResourcesForAsset(asset: &PHAsset) -> Id<NSArray<PHAssetResource>>;

        #[cfg(feature = "PHLivePhoto")]
        #[method_id(@__retain_semantics Other assetResourcesForLivePhoto:)]
        pub unsafe fn assetResourcesForLivePhoto(
            live_photo: &PHLivePhoto,
        ) -> Id<NSArray<PHAssetResource>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl PHAssetResource {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);