objc2-ui-kit 0.2.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-image")]
#[cfg(not(target_os = "watchos"))]
use objc2_core_image::*;
use objc2_foundation::*;

use crate::*;

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

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

unsafe impl Send for UIColor {}

unsafe impl Sync for UIColor {}

unsafe impl NSCoding for UIColor {}

unsafe impl NSCopying for UIColor {}

unsafe impl NSObjectProtocol for UIColor {}

unsafe impl NSSecureCoding for UIColor {}

extern_methods!(
    unsafe impl UIColor {
        #[method_id(@__retain_semantics Other colorWithWhite:alpha:)]
        pub unsafe fn colorWithWhite_alpha(white: CGFloat, alpha: CGFloat) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other colorWithHue:saturation:brightness:alpha:)]
        pub unsafe fn colorWithHue_saturation_brightness_alpha(
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other colorWithRed:green:blue:alpha:)]
        pub unsafe fn colorWithRed_green_blue_alpha(
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other colorWithDisplayP3Red:green:blue:alpha:)]
        pub unsafe fn colorWithDisplayP3Red_green_blue_alpha(
            display_p3_red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Other colorWithPatternImage:)]
        pub unsafe fn colorWithPatternImage(image: &UIImage) -> Retained<UIColor>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        #[method_id(@__retain_semantics Other colorWithCIColor:)]
        pub unsafe fn colorWithCIColor(ci_color: &CIColor) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithWhite:alpha:)]
        pub unsafe fn initWithWhite_alpha(
            this: Allocated<Self>,
            white: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithHue:saturation:brightness:alpha:)]
        pub unsafe fn initWithHue_saturation_brightness_alpha(
            this: Allocated<Self>,
            hue: CGFloat,
            saturation: CGFloat,
            brightness: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithRed:green:blue:alpha:)]
        pub unsafe fn initWithRed_green_blue_alpha(
            this: Allocated<Self>,
            red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Init initWithDisplayP3Red:green:blue:alpha:)]
        pub unsafe fn initWithDisplayP3Red_green_blue_alpha(
            this: Allocated<Self>,
            display_p3_red: CGFloat,
            green: CGFloat,
            blue: CGFloat,
            alpha: CGFloat,
        ) -> Retained<UIColor>;

        #[cfg(feature = "UIImage")]
        #[method_id(@__retain_semantics Init initWithPatternImage:)]
        pub unsafe fn initWithPatternImage(
            this: Allocated<Self>,
            image: &UIImage,
        ) -> Retained<UIColor>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        #[method_id(@__retain_semantics Init initWithCIColor:)]
        pub unsafe fn initWithCIColor(
            this: Allocated<Self>,
            ci_color: &CIColor,
        ) -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other blackColor)]
        pub unsafe fn blackColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other darkGrayColor)]
        pub unsafe fn darkGrayColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other lightGrayColor)]
        pub unsafe fn lightGrayColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other whiteColor)]
        pub unsafe fn whiteColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other grayColor)]
        pub unsafe fn grayColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other redColor)]
        pub unsafe fn redColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other greenColor)]
        pub unsafe fn greenColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other blueColor)]
        pub unsafe fn blueColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other cyanColor)]
        pub unsafe fn cyanColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other yellowColor)]
        pub unsafe fn yellowColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other magentaColor)]
        pub unsafe fn magentaColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other orangeColor)]
        pub unsafe fn orangeColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other purpleColor)]
        pub unsafe fn purpleColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other brownColor)]
        pub unsafe fn brownColor() -> Retained<UIColor>;

        #[method_id(@__retain_semantics Other clearColor)]
        pub unsafe fn clearColor() -> Retained<UIColor>;

        #[method(set)]
        pub unsafe fn set(&self);

        #[method(setFill)]
        pub unsafe fn setFill(&self);

        #[method(setStroke)]
        pub unsafe fn setStroke(&self);

        #[method(getWhite:alpha:)]
        pub unsafe fn getWhite_alpha(&self, white: *mut CGFloat, alpha: *mut CGFloat) -> bool;

        #[method(getHue:saturation:brightness:alpha:)]
        pub unsafe fn getHue_saturation_brightness_alpha(
            &self,
            hue: *mut CGFloat,
            saturation: *mut CGFloat,
            brightness: *mut CGFloat,
            alpha: *mut CGFloat,
        ) -> bool;

        #[method(getRed:green:blue:alpha:)]
        pub unsafe fn getRed_green_blue_alpha(
            &self,
            red: *mut CGFloat,
            green: *mut CGFloat,
            blue: *mut CGFloat,
            alpha: *mut CGFloat,
        ) -> bool;

        #[method_id(@__retain_semantics Other colorWithAlphaComponent:)]
        pub unsafe fn colorWithAlphaComponent(&self, alpha: CGFloat) -> Retained<UIColor>;

        #[cfg(feature = "objc2-core-image")]
        #[cfg(not(target_os = "watchos"))]
        #[method_id(@__retain_semantics Other CIColor)]
        pub unsafe fn CIColor(&self) -> Retained<CIColor>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl UIColor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_methods!(
    /// UINSItemProvider
    unsafe impl UIColor {}
);

unsafe impl NSItemProviderReading for UIColor {}

unsafe impl NSItemProviderWriting for UIColor {}

extern_category!(
    /// Category "UIKitAdditions" on [`CIColor`].
    #[doc(alias = "UIKitAdditions")]
    pub unsafe trait CIColorUIKitAdditions {
        #[method_id(@__retain_semantics Init initWithColor:)]
        unsafe fn initWithColor(this: Allocated<Self>, color: &UIColor) -> Retained<Self>;
    }

    #[cfg(feature = "objc2-core-image")]
    #[cfg(not(target_os = "watchos"))]
    unsafe impl CIColorUIKitAdditions for CIColor {}
);

extern_methods!(
    /// UIColorNamedColors
    unsafe impl UIColor {
        #[method_id(@__retain_semantics Other colorNamed:)]
        pub unsafe fn colorNamed(name: &NSString) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UITraitCollection")]
        #[method_id(@__retain_semantics Other colorNamed:inBundle:compatibleWithTraitCollection:)]
        pub unsafe fn colorNamed_inBundle_compatibleWithTraitCollection(
            name: &NSString,
            bundle: Option<&NSBundle>,
            trait_collection: Option<&UITraitCollection>,
        ) -> Option<Retained<UIColor>>;
    }
);

extern_methods!(
    /// DynamicColors
    unsafe impl UIColor {
        #[cfg(all(feature = "UITraitCollection", feature = "block2"))]
        #[method_id(@__retain_semantics Other colorWithDynamicProvider:)]
        pub unsafe fn colorWithDynamicProvider(
            dynamic_provider: &block2::Block<
                dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>,
            >,
        ) -> Retained<UIColor>;

        #[cfg(all(feature = "UITraitCollection", feature = "block2"))]
        #[method_id(@__retain_semantics Init initWithDynamicProvider:)]
        pub unsafe fn initWithDynamicProvider(
            this: Allocated<Self>,
            dynamic_provider: &block2::Block<
                dyn Fn(NonNull<UITraitCollection>) -> NonNull<UIColor>,
            >,
        ) -> Retained<UIColor>;

        #[cfg(feature = "UITraitCollection")]
        #[method_id(@__retain_semantics Other resolvedColorWithTraitCollection:)]
        pub unsafe fn resolvedColorWithTraitCollection(
            &self,
            trait_collection: &UITraitCollection,
        ) -> Retained<UIColor>;
    }
);