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

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

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

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

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

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

#[cfg(feature = "UIConfigurationState")]
extern_conformance!(
    unsafe impl UIConfigurationState for UIViewConfigurationState {}
);

impl UIViewConfigurationState {
    extern_methods!(
        #[cfg(feature = "UITraitCollection")]
        /// Returns a new instance with the specified trait collection.
        #[unsafe(method(initWithTraitCollection:))]
        #[unsafe(method_family = init)]
        pub fn initWithTraitCollection(
            this: Allocated<Self>,
            trait_collection: &UITraitCollection,
        ) -> 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>>;

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

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

        #[cfg(feature = "UITraitCollection")]
        #[unsafe(method(traitCollection))]
        #[unsafe(method_family = none)]
        pub fn traitCollection(&self) -> Retained<UITraitCollection>;

        #[cfg(feature = "UITraitCollection")]
        /// Setter for [`traitCollection`][Self::traitCollection].
        #[unsafe(method(setTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn setTraitCollection(&self, trait_collection: &UITraitCollection);

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

        /// Setter for [`isDisabled`][Self::isDisabled].
        #[unsafe(method(setDisabled:))]
        #[unsafe(method_family = none)]
        pub fn setDisabled(&self, disabled: bool);

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

        /// Setter for [`isHighlighted`][Self::isHighlighted].
        #[unsafe(method(setHighlighted:))]
        #[unsafe(method_family = none)]
        pub fn setHighlighted(&self, highlighted: bool);

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

        /// Setter for [`isSelected`][Self::isSelected].
        #[unsafe(method(setSelected:))]
        #[unsafe(method_family = none)]
        pub fn setSelected(&self, selected: bool);

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

        /// Setter for [`isFocused`][Self::isFocused].
        #[unsafe(method(setFocused:))]
        #[unsafe(method_family = none)]
        pub fn setFocused(&self, focused: bool);

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

        /// Setter for [`isPinned`][Self::isPinned].
        #[unsafe(method(setPinned:))]
        #[unsafe(method_family = none)]
        pub fn setPinned(&self, pinned: bool);
    );
}
