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
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

pub type PHLivePhotoRequestID = i32;

pub static PHLivePhotoRequestIDInvalid: PHLivePhotoRequestID = 0;

extern "C" {
    pub static PHLivePhotoInfoErrorKey: &'static NSString;
}

extern "C" {
    pub static PHLivePhotoInfoIsDegradedKey: &'static NSString;
}

extern "C" {
    pub static PHLivePhotoInfoCancelledKey: &'static NSString;
}

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

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

unsafe impl NSCoding for PHLivePhoto {}

unsafe impl NSCopying for PHLivePhoto {}

unsafe impl NSObjectProtocol for PHLivePhoto {}

unsafe impl NSSecureCoding for PHLivePhoto {}

extern_methods!(
    unsafe impl PHLivePhoto {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method(size)]
        pub unsafe fn size(&self) -> CGSize;

        #[cfg(all(feature = "PhotosTypes", feature = "block2", feature = "objc2-app-kit"))]
        #[method(requestLivePhotoWithResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)]
        pub unsafe fn requestLivePhotoWithResourceFileURLs_placeholderImage_targetSize_contentMode_resultHandler(
            file_ur_ls: &NSArray<NSURL>,
            image: Option<&NSImage>,
            target_size: CGSize,
            content_mode: PHImageContentMode,
            result_handler: &Block<dyn Fn(*mut PHLivePhoto, NonNull<NSDictionary>)>,
        ) -> PHLivePhotoRequestID;

        #[method(cancelLivePhotoRequestWithRequestID:)]
        pub unsafe fn cancelLivePhotoRequestWithRequestID(request_id: PHLivePhotoRequestID);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl PHLivePhoto {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    /// NSItemProvider
    unsafe impl PHLivePhoto {}
);

unsafe impl NSItemProviderReading for PHLivePhoto {}