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::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/photos/phproject?language=objc)
    #[unsafe(super(PHAssetCollection, PHCollection, PHObject, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "PHCollection", feature = "PHObject"))]
    pub struct PHProject;
);

#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
unsafe impl Send for PHProject {}

#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
unsafe impl Sync for PHProject {}

#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
extern_conformance!(
    unsafe impl NSCopying for PHProject {}
);

#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
unsafe impl CopyingHelper for PHProject {
    type Result = Self;
}

#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for PHProject {}
);

#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
impl PHProject {
    extern_methods!(
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(projectExtensionData))]
        #[unsafe(method_family = none)]
        pub unsafe fn projectExtensionData(&self) -> Retained<NSData>;

        /// Property to determine if a project preview was previously set.
        /// Use -[PHProjectChangeRequest setProjectPreviewImage:] to set a project preview.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(hasProjectPreview))]
        #[unsafe(method_family = none)]
        pub unsafe fn hasProjectPreview(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "PHCollection", feature = "PHObject"))]
impl PHProject {
    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>;
    );
}