objc2-ui-kit 0.3.2

Bindings to the UIKit 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::*;

use crate::*;

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

unsafe impl Send for UIImageAsset {}

unsafe impl Sync for UIImageAsset {}

extern_conformance!(
    unsafe impl NSCoding for UIImageAsset {}
);

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

extern_conformance!(
    unsafe impl NSSecureCoding for UIImageAsset {}
);

impl UIImageAsset {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(all(feature = "UIImage", feature = "UIImageConfiguration"))]
        #[unsafe(method(imageWithConfiguration:))]
        #[unsafe(method_family = none)]
        pub fn imageWithConfiguration(
            &self,
            configuration: &UIImageConfiguration,
        ) -> Retained<UIImage>;

        #[cfg(all(feature = "UIImage", feature = "UIImageConfiguration"))]
        #[unsafe(method(registerImage:withConfiguration:))]
        #[unsafe(method_family = none)]
        pub fn registerImage_withConfiguration(
            &self,
            image: &UIImage,
            configuration: &UIImageConfiguration,
        );

        #[cfg(feature = "UIImageConfiguration")]
        #[unsafe(method(unregisterImageWithConfiguration:))]
        #[unsafe(method_family = none)]
        pub fn unregisterImageWithConfiguration(&self, configuration: &UIImageConfiguration);

        #[cfg(all(feature = "UIImage", feature = "UITraitCollection"))]
        #[unsafe(method(imageWithTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn imageWithTraitCollection(
            &self,
            trait_collection: &UITraitCollection,
        ) -> Retained<UIImage>;

        #[cfg(all(feature = "UIImage", feature = "UITraitCollection"))]
        #[unsafe(method(registerImage:withTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn registerImage_withTraitCollection(
            &self,
            image: &UIImage,
            trait_collection: &UITraitCollection,
        );

        #[cfg(feature = "UITraitCollection")]
        #[unsafe(method(unregisterImageWithTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn unregisterImageWithTraitCollection(&self, trait_collection: &UITraitCollection);
    );
}

/// Methods declared on superclass `NSObject`.
impl UIImageAsset {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for UIImageAsset {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}