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

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

#[cfg(feature = "NSCollectionViewLayout")]
extern_conformance!(
    unsafe impl NSCoding for NSCollectionViewGridLayout {}
);

#[cfg(feature = "NSCollectionViewLayout")]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSCollectionViewGridLayout {}
);

#[cfg(feature = "NSCollectionViewLayout")]
impl NSCollectionViewGridLayout {
    extern_methods!(
        #[unsafe(method(margins))]
        #[unsafe(method_family = none)]
        pub fn margins(&self) -> NSEdgeInsets;

        /// Setter for [`margins`][Self::margins].
        #[unsafe(method(setMargins:))]
        #[unsafe(method_family = none)]
        pub fn setMargins(&self, margins: NSEdgeInsets);

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

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

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

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

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

        /// Setter for [`maximumNumberOfRows`][Self::maximumNumberOfRows].
        #[unsafe(method(setMaximumNumberOfRows:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumNumberOfRows(&self, maximum_number_of_rows: NSUInteger);

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

        /// Setter for [`maximumNumberOfColumns`][Self::maximumNumberOfColumns].
        #[unsafe(method(setMaximumNumberOfColumns:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumNumberOfColumns(&self, maximum_number_of_columns: NSUInteger);

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

        /// Setter for [`minimumItemSize`][Self::minimumItemSize].
        #[unsafe(method(setMinimumItemSize:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumItemSize(&self, minimum_item_size: NSSize);

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

        /// Setter for [`maximumItemSize`][Self::maximumItemSize].
        #[unsafe(method(setMaximumItemSize:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumItemSize(&self, maximum_item_size: NSSize);

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

        #[cfg(feature = "NSColor")]
        /// Setter for [`backgroundColors`][Self::backgroundColors].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBackgroundColors:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundColors(&self, background_colors: Option<&NSArray<NSColor>>);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "NSCollectionViewLayout")]
impl NSCollectionViewGridLayout {
    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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
