objc2-photos 0.3.2

Bindings to the Photos/PhotoKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
use objc2_uniform_type_identifiers::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/photos/phassetresource?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PHAssetResource;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for PHAssetResource {}
);

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

        #[unsafe(method(assetLocalIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn assetLocalIdentifier(&self) -> Retained<NSString>;

        #[unsafe(method(originalFilename))]
        #[unsafe(method_family = none)]
        pub unsafe fn originalFilename(&self) -> Retained<NSString>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        /// The type of data associated with this asset resource (the data can be retrieved via PHAssetResourceManager)
        #[unsafe(method(contentType))]
        #[unsafe(method_family = none)]
        pub unsafe fn contentType(&self) -> Retained<UTType>;

        #[deprecated = "Use contentType instead"]
        #[unsafe(method(uniformTypeIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn uniformTypeIdentifier(&self) -> Retained<NSString>;

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

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

        #[cfg(all(feature = "PHAsset", feature = "PHObject"))]
        #[unsafe(method(assetResourcesForAsset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn assetResourcesForAsset(asset: &PHAsset)
            -> Retained<NSArray<PHAssetResource>>;

        #[cfg(feature = "PHLivePhoto")]
        #[unsafe(method(assetResourcesForLivePhoto:))]
        #[unsafe(method_family = none)]
        pub unsafe fn assetResourcesForLivePhoto(
            live_photo: &PHLivePhoto,
        ) -> Retained<NSArray<PHAssetResource>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl PHAssetResource {
    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>;
    );
}