//! 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-graphics")]
#[cfg(target_vendor = "apple")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorspacemodel?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSColorSpaceModel(pub NSInteger);
impl NSColorSpaceModel {
    #[doc(alias = "NSColorSpaceModelUnknown")]
    pub const Unknown: Self = Self(-1);
    #[doc(alias = "NSColorSpaceModelGray")]
    pub const Gray: Self = Self(0);
    #[doc(alias = "NSColorSpaceModelRGB")]
    pub const RGB: Self = Self(1);
    #[doc(alias = "NSColorSpaceModelCMYK")]
    pub const CMYK: Self = Self(2);
    #[doc(alias = "NSColorSpaceModelLAB")]
    pub const LAB: Self = Self(3);
    #[doc(alias = "NSColorSpaceModelDeviceN")]
    pub const DeviceN: Self = Self(4);
    #[doc(alias = "NSColorSpaceModelIndexed")]
    pub const Indexed: Self = Self(5);
    #[doc(alias = "NSColorSpaceModelPatterned")]
    pub const Patterned: Self = Self(6);
}

unsafe impl Encode for NSColorSpaceModel {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSColorSpaceModel {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

unsafe impl Send for NSColorSpace {}

unsafe impl Sync for NSColorSpace {}

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

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

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

impl NSColorSpace {
    extern_methods!(
        #[unsafe(method(initWithICCProfileData:))]
        #[unsafe(method_family = init)]
        pub fn initWithICCProfileData(
            this: Allocated<Self>,
            icc_data: &NSData,
        ) -> Option<Retained<Self>>;

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

        /// # Safety
        ///
        /// `prof` must be a valid pointer.
        #[unsafe(method(initWithColorSyncProfile:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithColorSyncProfile(
            this: Allocated<Self>,
            prof: NonNull<c_void>,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(colorSyncProfile))]
        #[unsafe(method_family = none)]
        pub fn colorSyncProfile(&self) -> *mut c_void;

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(initWithCGColorSpace:))]
        #[unsafe(method_family = init)]
        pub fn initWithCGColorSpace(
            this: Allocated<Self>,
            cg_color_space: &CGColorSpace,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "objc2-core-graphics")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(CGColorSpace))]
        #[unsafe(method_family = none)]
        pub fn CGColorSpace(&self) -> Option<Retained<CGColorSpace>>;

        #[unsafe(method(numberOfColorComponents))]
        #[unsafe(method_family = none)]
        pub fn numberOfColorComponents(&self) -> NSInteger;

        #[unsafe(method(colorSpaceModel))]
        #[unsafe(method_family = none)]
        pub fn colorSpaceModel(&self) -> NSColorSpaceModel;

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

        #[unsafe(method(sRGBColorSpace))]
        #[unsafe(method_family = none)]
        pub fn sRGBColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(genericGamma22GrayColorSpace))]
        #[unsafe(method_family = none)]
        pub fn genericGamma22GrayColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(extendedSRGBColorSpace))]
        #[unsafe(method_family = none)]
        pub fn extendedSRGBColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(extendedGenericGamma22GrayColorSpace))]
        #[unsafe(method_family = none)]
        pub fn extendedGenericGamma22GrayColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(displayP3ColorSpace))]
        #[unsafe(method_family = none)]
        pub fn displayP3ColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(adobeRGB1998ColorSpace))]
        #[unsafe(method_family = none)]
        pub fn adobeRGB1998ColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(genericRGBColorSpace))]
        #[unsafe(method_family = none)]
        pub fn genericRGBColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(genericGrayColorSpace))]
        #[unsafe(method_family = none)]
        pub fn genericGrayColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(genericCMYKColorSpace))]
        #[unsafe(method_family = none)]
        pub fn genericCMYKColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(deviceRGBColorSpace))]
        #[unsafe(method_family = none)]
        pub fn deviceRGBColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(deviceGrayColorSpace))]
        #[unsafe(method_family = none)]
        pub fn deviceGrayColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(deviceCMYKColorSpace))]
        #[unsafe(method_family = none)]
        pub fn deviceCMYKColorSpace() -> Retained<NSColorSpace>;

        #[unsafe(method(availableColorSpacesWithModel:))]
        #[unsafe(method_family = none)]
        pub fn availableColorSpacesWithModel(
            model: NSColorSpaceModel,
        ) -> Retained<NSArray<NSColorSpace>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSColorSpace {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunknowncolorspacemodel?language=objc)
#[deprecated]
pub static NSUnknownColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::Unknown.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsgraycolorspacemodel?language=objc)
#[deprecated]
pub static NSGrayColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::Gray.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrgbcolorspacemodel?language=objc)
#[deprecated]
pub static NSRGBColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::RGB.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscmykcolorspacemodel?language=objc)
#[deprecated]
pub static NSCMYKColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::CMYK.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslabcolorspacemodel?language=objc)
#[deprecated]
pub static NSLABColorSpaceModel: NSColorSpaceModel = NSColorSpaceModel(NSColorSpaceModel::LAB.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdevicencolorspacemodel?language=objc)
#[deprecated]
pub static NSDeviceNColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::DeviceN.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsindexedcolorspacemodel?language=objc)
#[deprecated]
pub static NSIndexedColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::Indexed.0);

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspatterncolorspacemodel?language=objc)
#[deprecated]
pub static NSPatternColorSpaceModel: NSColorSpaceModel =
    NSColorSpaceModel(NSColorSpaceModel::Patterned.0);
