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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

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

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

extern_conformance!(
    unsafe impl NSCopying for NSShadow {}
);

unsafe impl CopyingHelper for NSShadow {
    type Result = Self;
}

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

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

impl NSShadow {
    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(feature = "objc2-core-foundation")]
        #[unsafe(method(shadowOffset))]
        #[unsafe(method_family = none)]
        pub fn shadowOffset(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`shadowOffset`][Self::shadowOffset].
        #[unsafe(method(setShadowOffset:))]
        #[unsafe(method_family = none)]
        pub fn setShadowOffset(&self, shadow_offset: CGSize);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(shadowBlurRadius))]
        #[unsafe(method_family = none)]
        pub fn shadowBlurRadius(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`shadowBlurRadius`][Self::shadowBlurRadius].
        #[unsafe(method(setShadowBlurRadius:))]
        #[unsafe(method_family = none)]
        pub fn setShadowBlurRadius(&self, shadow_blur_radius: CGFloat);

        #[unsafe(method(shadowColor))]
        #[unsafe(method_family = none)]
        pub fn shadowColor(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`shadowColor`][Self::shadowColor].
        ///
        /// # Safety
        ///
        /// `shadow_color` should be of the correct type.
        #[unsafe(method(setShadowColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShadowColor(&self, shadow_color: Option<&AnyObject>);
    );
}

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

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