//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutpriority?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSLayoutPriority = c_float;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutpriorityrequired?language=objc)
pub static NSLayoutPriorityRequired: NSLayoutPriority = 1000 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutprioritydefaulthigh?language=objc)
pub static NSLayoutPriorityDefaultHigh: NSLayoutPriority = 750 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutprioritydragthatcanresizewindow?language=objc)
pub static NSLayoutPriorityDragThatCanResizeWindow: NSLayoutPriority = 510 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutprioritywindowsizestayput?language=objc)
pub static NSLayoutPriorityWindowSizeStayPut: NSLayoutPriority = 500 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutprioritydragthatcannotresizewindow?language=objc)
pub static NSLayoutPriorityDragThatCannotResizeWindow: NSLayoutPriority = 490 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutprioritydefaultlow?language=objc)
pub static NSLayoutPriorityDefaultLow: NSLayoutPriority = 250 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutpriorityfittingsizecompression?language=objc)
pub static NSLayoutPriorityFittingSizeCompression: NSLayoutPriority = 50 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutconstraintorientation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutConstraintOrientation(pub NSInteger);
impl NSLayoutConstraintOrientation {
    #[doc(alias = "NSLayoutConstraintOrientationHorizontal")]
    pub const Horizontal: Self = Self(0);
    #[doc(alias = "NSLayoutConstraintOrientationVertical")]
    pub const Vertical: Self = Self(1);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutrelation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutRelation(pub NSInteger);
impl NSLayoutRelation {
    #[doc(alias = "NSLayoutRelationLessThanOrEqual")]
    pub const LessThanOrEqual: Self = Self(-1);
    #[doc(alias = "NSLayoutRelationEqual")]
    pub const Equal: Self = Self(0);
    #[doc(alias = "NSLayoutRelationGreaterThanOrEqual")]
    pub const GreaterThanOrEqual: Self = Self(1);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutattribute?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutAttribute(pub NSInteger);
impl NSLayoutAttribute {
    #[doc(alias = "NSLayoutAttributeLeft")]
    pub const Left: Self = Self(1);
    #[doc(alias = "NSLayoutAttributeRight")]
    pub const Right: Self = Self(2);
    #[doc(alias = "NSLayoutAttributeTop")]
    pub const Top: Self = Self(3);
    #[doc(alias = "NSLayoutAttributeBottom")]
    pub const Bottom: Self = Self(4);
    #[doc(alias = "NSLayoutAttributeLeading")]
    pub const Leading: Self = Self(5);
    #[doc(alias = "NSLayoutAttributeTrailing")]
    pub const Trailing: Self = Self(6);
    #[doc(alias = "NSLayoutAttributeWidth")]
    pub const Width: Self = Self(7);
    #[doc(alias = "NSLayoutAttributeHeight")]
    pub const Height: Self = Self(8);
    #[doc(alias = "NSLayoutAttributeCenterX")]
    pub const CenterX: Self = Self(9);
    #[doc(alias = "NSLayoutAttributeCenterY")]
    pub const CenterY: Self = Self(10);
    #[doc(alias = "NSLayoutAttributeLastBaseline")]
    pub const LastBaseline: Self = Self(11);
    #[doc(alias = "NSLayoutAttributeBaseline")]
    pub const Baseline: Self = Self(NSLayoutAttribute::LastBaseline.0);
    #[doc(alias = "NSLayoutAttributeFirstBaseline")]
    pub const FirstBaseline: Self = Self(12);
    #[doc(alias = "NSLayoutAttributeNotAnAttribute")]
    pub const NotAnAttribute: Self = Self(0);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslayoutformatoptions?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSLayoutFormatOptions(pub NSUInteger);
bitflags::bitflags! {
    impl NSLayoutFormatOptions: NSUInteger {
        #[doc(alias = "NSLayoutFormatAlignAllLeft")]
        const AlignAllLeft = 1<<NSLayoutAttribute::Left.0;
        #[doc(alias = "NSLayoutFormatAlignAllRight")]
        const AlignAllRight = 1<<NSLayoutAttribute::Right.0;
        #[doc(alias = "NSLayoutFormatAlignAllTop")]
        const AlignAllTop = 1<<NSLayoutAttribute::Top.0;
        #[doc(alias = "NSLayoutFormatAlignAllBottom")]
        const AlignAllBottom = 1<<NSLayoutAttribute::Bottom.0;
        #[doc(alias = "NSLayoutFormatAlignAllLeading")]
        const AlignAllLeading = 1<<NSLayoutAttribute::Leading.0;
        #[doc(alias = "NSLayoutFormatAlignAllTrailing")]
        const AlignAllTrailing = 1<<NSLayoutAttribute::Trailing.0;
        #[doc(alias = "NSLayoutFormatAlignAllCenterX")]
        const AlignAllCenterX = 1<<NSLayoutAttribute::CenterX.0;
        #[doc(alias = "NSLayoutFormatAlignAllCenterY")]
        const AlignAllCenterY = 1<<NSLayoutAttribute::CenterY.0;
        #[doc(alias = "NSLayoutFormatAlignAllLastBaseline")]
        const AlignAllLastBaseline = 1<<NSLayoutAttribute::LastBaseline.0;
        #[doc(alias = "NSLayoutFormatAlignAllFirstBaseline")]
        const AlignAllFirstBaseline = 1<<NSLayoutAttribute::FirstBaseline.0;
        #[doc(alias = "NSLayoutFormatAlignAllBaseline")]
        const AlignAllBaseline = NSLayoutFormatOptions::AlignAllLastBaseline.0;
        #[doc(alias = "NSLayoutFormatAlignmentMask")]
        const AlignmentMask = 0xFFFF;
        #[doc(alias = "NSLayoutFormatDirectionLeadingToTrailing")]
        const DirectionLeadingToTrailing = 0<<16;
        #[doc(alias = "NSLayoutFormatDirectionLeftToRight")]
        const DirectionLeftToRight = 1<<16;
        #[doc(alias = "NSLayoutFormatDirectionRightToLeft")]
        const DirectionRightToLeft = 2<<16;
        #[doc(alias = "NSLayoutFormatDirectionMask")]
        const DirectionMask = 0x3<<16;
    }
}

unsafe impl Encode for NSLayoutFormatOptions {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

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

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

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

impl NSLayoutConstraint {
    extern_methods!(
        /// # Safety
        ///
        /// - `metrics` generic should be of the correct type.
        /// - `views` generic should be of the correct type.
        #[unsafe(method(constraintsWithVisualFormat:options:metrics:views:))]
        #[unsafe(method_family = none)]
        pub unsafe fn constraintsWithVisualFormat_options_metrics_views(
            format: &NSString,
            opts: NSLayoutFormatOptions,
            metrics: Option<&NSDictionary<NSString, AnyObject>>,
            views: &NSDictionary<NSString, AnyObject>,
        ) -> Retained<NSArray<NSLayoutConstraint>>;

        #[cfg(feature = "objc2-core-foundation")]
        /// # Safety
        ///
        /// - `view1` should be of the correct type.
        /// - `view2` should be of the correct type.
        #[unsafe(method(constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:))]
        #[unsafe(method_family = none)]
        pub unsafe fn constraintWithItem_attribute_relatedBy_toItem_attribute_multiplier_constant(
            view1: &AnyObject,
            attr1: NSLayoutAttribute,
            relation: NSLayoutRelation,
            view2: Option<&AnyObject>,
            attr2: NSLayoutAttribute,
            multiplier: CGFloat,
            c: CGFloat,
        ) -> Retained<Self>;

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

        /// Setter for [`priority`][Self::priority].
        #[unsafe(method(setPriority:))]
        #[unsafe(method_family = none)]
        pub fn setPriority(&self, priority: NSLayoutPriority);

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

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

        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(firstItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn firstItem(&self) -> Option<Retained<AnyObject>>;

        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(secondItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondItem(&self) -> Option<Retained<AnyObject>>;

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

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

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

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

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

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

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

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

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

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

        #[unsafe(method(activateConstraints:))]
        #[unsafe(method_family = none)]
        pub fn activateConstraints(constraints: &NSArray<NSLayoutConstraint>);

        #[unsafe(method(deactivateConstraints:))]
        #[unsafe(method_family = none)]
        pub fn deactivateConstraints(constraints: &NSArray<NSLayoutConstraint>);
    );
}

/// Methods declared on superclass `NSObject`.
impl NSLayoutConstraint {
    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 NSLayoutConstraint {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

/// NSIdentifier.
impl NSLayoutConstraint {
    extern_methods!(
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub fn identifier(&self) -> Option<Retained<NSString>>;

        /// Setter for [`identifier`][Self::identifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setIdentifier:))]
        #[unsafe(method_family = none)]
        pub fn setIdentifier(&self, identifier: Option<&NSString>);
    );
}

impl NSLayoutConstraint {
    extern_methods!();
}

#[cfg(feature = "NSAnimation")]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for NSLayoutConstraint {}
);

/// NSConstraintBasedLayoutInstallingConstraints.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[cfg(feature = "NSLayoutAnchor")]
        #[unsafe(method(leadingAnchor))]
        #[unsafe(method_family = none)]
        pub fn leadingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;

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

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

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

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

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

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

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

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

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

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

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

        #[unsafe(method(constraints))]
        #[unsafe(method_family = none)]
        pub fn constraints(&self) -> Retained<NSArray<NSLayoutConstraint>>;

        #[unsafe(method(addConstraint:))]
        #[unsafe(method_family = none)]
        pub fn addConstraint(&self, constraint: &NSLayoutConstraint);

        #[unsafe(method(addConstraints:))]
        #[unsafe(method_family = none)]
        pub fn addConstraints(&self, constraints: &NSArray<NSLayoutConstraint>);

        #[unsafe(method(removeConstraint:))]
        #[unsafe(method_family = none)]
        pub fn removeConstraint(&self, constraint: &NSLayoutConstraint);

        #[unsafe(method(removeConstraints:))]
        #[unsafe(method_family = none)]
        pub fn removeConstraints(&self, constraints: &NSArray<NSLayoutConstraint>);
    );
}

/// NSConstraintBasedLayoutCoreMethods.
#[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
impl NSWindow {
    extern_methods!(
        #[unsafe(method(updateConstraintsIfNeeded))]
        #[unsafe(method_family = none)]
        pub fn updateConstraintsIfNeeded(&self);

        #[unsafe(method(layoutIfNeeded))]
        #[unsafe(method_family = none)]
        pub fn layoutIfNeeded(&self);
    );
}

/// NSConstraintBasedLayoutCoreMethods.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[unsafe(method(updateConstraintsForSubtreeIfNeeded))]
        #[unsafe(method_family = none)]
        pub fn updateConstraintsForSubtreeIfNeeded(&self);

        #[unsafe(method(updateConstraints))]
        #[unsafe(method_family = none)]
        pub fn updateConstraints(&self);

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

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

/// NSConstraintBasedCompatibility.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[unsafe(method(translatesAutoresizingMaskIntoConstraints))]
        #[unsafe(method_family = none)]
        pub fn translatesAutoresizingMaskIntoConstraints(&self) -> bool;

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

        #[unsafe(method(requiresConstraintBasedLayout))]
        #[unsafe(method_family = none)]
        pub fn requiresConstraintBasedLayout(mtm: MainThreadMarker) -> bool;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewnoinstrinsicmetric?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    #[deprecated]
    pub static NSViewNoInstrinsicMetric: CGFloat;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewnointrinsicmetric?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static NSViewNoIntrinsicMetric: CGFloat;
}

/// NSConstraintBasedLayoutLayering.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[unsafe(method(alignmentRectForFrame:))]
        #[unsafe(method_family = none)]
        pub fn alignmentRectForFrame(&self, frame: NSRect) -> NSRect;

        #[unsafe(method(frameForAlignmentRect:))]
        #[unsafe(method_family = none)]
        pub fn frameForAlignmentRect(&self, alignment_rect: NSRect) -> NSRect;

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

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

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

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

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

        #[unsafe(method(invalidateIntrinsicContentSize))]
        #[unsafe(method_family = none)]
        pub fn invalidateIntrinsicContentSize(&self);

        #[unsafe(method(contentHuggingPriorityForOrientation:))]
        #[unsafe(method_family = none)]
        pub fn contentHuggingPriorityForOrientation(
            &self,
            orientation: NSLayoutConstraintOrientation,
        ) -> NSLayoutPriority;

        #[unsafe(method(setContentHuggingPriority:forOrientation:))]
        #[unsafe(method_family = none)]
        pub fn setContentHuggingPriority_forOrientation(
            &self,
            priority: NSLayoutPriority,
            orientation: NSLayoutConstraintOrientation,
        );

        #[unsafe(method(contentCompressionResistancePriorityForOrientation:))]
        #[unsafe(method_family = none)]
        pub fn contentCompressionResistancePriorityForOrientation(
            &self,
            orientation: NSLayoutConstraintOrientation,
        ) -> NSLayoutPriority;

        #[unsafe(method(setContentCompressionResistancePriority:forOrientation:))]
        #[unsafe(method_family = none)]
        pub fn setContentCompressionResistancePriority_forOrientation(
            &self,
            priority: NSLayoutPriority,
            orientation: NSLayoutConstraintOrientation,
        );

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

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

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

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

/// NSConstraintBasedLayoutLayering.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSControl {
    extern_methods!(
        #[cfg(feature = "NSCell")]
        #[unsafe(method(invalidateIntrinsicContentSizeForCell:))]
        #[unsafe(method_family = none)]
        pub fn invalidateIntrinsicContentSizeForCell(&self, cell: &NSCell);
    );
}

/// NSConstraintBasedLayoutAnchoring.
#[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
impl NSWindow {
    extern_methods!(
        #[unsafe(method(anchorAttributeForOrientation:))]
        #[unsafe(method_family = none)]
        pub fn anchorAttributeForOrientation(
            &self,
            orientation: NSLayoutConstraintOrientation,
        ) -> NSLayoutAttribute;

        #[unsafe(method(setAnchorAttribute:forOrientation:))]
        #[unsafe(method_family = none)]
        pub fn setAnchorAttribute_forOrientation(
            &self,
            attr: NSLayoutAttribute,
            orientation: NSLayoutConstraintOrientation,
        );
    );
}

/// NSConstraintBasedLayoutFittingSize.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[unsafe(method(fittingSize))]
        #[unsafe(method_family = none)]
        pub fn fittingSize(&self) -> NSSize;
    );
}

/// NSConstraintBasedLayoutDebugging.
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
    extern_methods!(
        #[unsafe(method(constraintsAffectingLayoutForOrientation:))]
        #[unsafe(method_family = none)]
        pub fn constraintsAffectingLayoutForOrientation(
            &self,
            orientation: NSLayoutConstraintOrientation,
        ) -> Retained<NSArray<NSLayoutConstraint>>;

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

        #[unsafe(method(exerciseAmbiguityInLayout))]
        #[unsafe(method_family = none)]
        pub fn exerciseAmbiguityInLayout(&self);
    );
}

/// NSConstraintBasedLayoutDebugging.
#[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
impl NSWindow {
    extern_methods!(
        #[unsafe(method(visualizeConstraints:))]
        #[unsafe(method_family = none)]
        pub fn visualizeConstraints(&self, constraints: Option<&NSArray<NSLayoutConstraint>>);
    );
}
