//! 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/appkit/nsuserinterfacecompressionoptions?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSUserInterfaceCompressionOptions;
);

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

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

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

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

impl NSUserInterfaceCompressionOptions {
    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) -> Retained<Self>;

        #[unsafe(method(initWithIdentifier:))]
        #[unsafe(method_family = init)]
        pub fn initWithIdentifier(this: Allocated<Self>, identifier: &NSString) -> Retained<Self>;

        #[unsafe(method(initWithCompressionOptions:))]
        #[unsafe(method_family = init)]
        pub fn initWithCompressionOptions(
            this: Allocated<Self>,
            options: &NSSet<NSUserInterfaceCompressionOptions>,
        ) -> Retained<Self>;

        #[unsafe(method(containsOptions:))]
        #[unsafe(method_family = none)]
        pub fn containsOptions(&self, options: &NSUserInterfaceCompressionOptions) -> bool;

        #[unsafe(method(intersectsOptions:))]
        #[unsafe(method_family = none)]
        pub fn intersectsOptions(&self, options: &NSUserInterfaceCompressionOptions) -> bool;

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

        #[unsafe(method(optionsByAddingOptions:))]
        #[unsafe(method_family = none)]
        pub fn optionsByAddingOptions(
            &self,
            options: &NSUserInterfaceCompressionOptions,
        ) -> Retained<NSUserInterfaceCompressionOptions>;

        #[unsafe(method(optionsByRemovingOptions:))]
        #[unsafe(method_family = none)]
        pub fn optionsByRemovingOptions(
            &self,
            options: &NSUserInterfaceCompressionOptions,
        ) -> Retained<NSUserInterfaceCompressionOptions>;

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

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

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

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

        #[unsafe(method(standardOptions))]
        #[unsafe(method_family = none)]
        pub fn standardOptions() -> Retained<NSUserInterfaceCompressionOptions>;
    );
}

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

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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsuserinterfacecompression?language=objc)
    pub unsafe trait NSUserInterfaceCompression {
        #[unsafe(method(compressWithPrioritizedCompressionOptions:))]
        #[unsafe(method_family = none)]
        fn compressWithPrioritizedCompressionOptions(
            &self,
            prioritized_options: &NSArray<NSUserInterfaceCompressionOptions>,
        );

        #[unsafe(method(minimumSizeWithPrioritizedCompressionOptions:))]
        #[unsafe(method_family = none)]
        fn minimumSizeWithPrioritizedCompressionOptions(
            &self,
            prioritized_options: &NSArray<NSUserInterfaceCompressionOptions>,
        ) -> NSSize;

        #[unsafe(method(activeCompressionOptions))]
        #[unsafe(method_family = none)]
        fn activeCompressionOptions(&self) -> Retained<NSUserInterfaceCompressionOptions>;
    }
);
