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::ffi::*;
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/phcontenteditingoutput?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PHContentEditingOutput;
);

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

impl PHContentEditingOutput {
    extern_methods!(
        #[cfg(feature = "PHContentEditingInput")]
        #[unsafe(method(initWithContentEditingInput:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContentEditingInput(
            this: Allocated<Self>,
            content_editing_input: &PHContentEditingInput,
        ) -> Retained<Self>;

        #[cfg(feature = "PHAdjustmentData")]
        #[unsafe(method(adjustmentData))]
        #[unsafe(method_family = none)]
        pub unsafe fn adjustmentData(&self) -> Option<Retained<PHAdjustmentData>>;

        #[cfg(feature = "PHAdjustmentData")]
        /// Setter for [`adjustmentData`][Self::adjustmentData].
        #[unsafe(method(setAdjustmentData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAdjustmentData(&self, adjustment_data: Option<&PHAdjustmentData>);

        /// File URL where the rendered output in the default format, with adjustments baked-in, needs to be written to.
        #[unsafe(method(renderedContentURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn renderedContentURL(&self) -> Retained<NSURL>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        /// Returns the default type for the rendered content output
        #[unsafe(method(defaultRenderedContentType))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultRenderedContentType(&self) -> Option<Retained<UTType>>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        /// Returns the supported types for the rendered content output
        #[unsafe(method(supportedRenderedContentTypes))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedRenderedContentTypes(&self) -> Retained<NSArray<UTType>>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        /// Returns a file URL where the rendered output in the specified format, with adjustments baked-in, needs to be written to. Returns nil and provides an error identifying the reason if the format is unsupported or the requested content URL cannot be provided
        #[unsafe(method(renderedContentURLForType:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn renderedContentURLForType_error(
            &self,
            r#type: &UTType,
        ) -> Result<Retained<NSURL>, Retained<NSError>>;
    );
}

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