//! 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/uicollectionviewcontroller?language=objc)
    #[unsafe(super(UIViewController, UIResponder, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
    pub struct UICollectionViewController;
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl NSCoding for UICollectionViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UICollectionViewController {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UICollectionViewController {}
);

#[cfg(all(
    feature = "UICollectionView",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UICollectionViewDataSource for UICollectionViewController {}
);

#[cfg(all(
    feature = "UICollectionView",
    feature = "UIResponder",
    feature = "UIScrollView",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UICollectionViewDelegate for UICollectionViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIContentContainer for UICollectionViewController {}
);

#[cfg(all(
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UICollectionViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UICollectionViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIScrollView",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UIScrollViewDelegate for UICollectionViewController {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIViewController"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UICollectionViewController {}
);

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UICollectionViewController {
    extern_methods!(
        #[cfg(feature = "UICollectionViewLayout")]
        #[unsafe(method(initWithCollectionViewLayout:))]
        #[unsafe(method_family = init)]
        pub fn initWithCollectionViewLayout(
            this: Allocated<Self>,
            layout: &UICollectionViewLayout,
        ) -> Retained<Self>;

        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSString>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> 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>>;

        #[cfg(all(
            feature = "UICollectionView",
            feature = "UIScrollView",
            feature = "UIView"
        ))]
        #[unsafe(method(collectionView))]
        #[unsafe(method_family = none)]
        pub fn collectionView(&self) -> Option<Retained<UICollectionView>>;

        #[cfg(all(
            feature = "UICollectionView",
            feature = "UIScrollView",
            feature = "UIView"
        ))]
        /// Setter for [`collectionView`][Self::collectionView].
        ///
        /// # Safety
        ///
        /// `collection_view` might not allow `None`.
        #[unsafe(method(setCollectionView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCollectionView(&self, collection_view: Option<&UICollectionView>);

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

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

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

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

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

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

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

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UICollectionViewController {
    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>;
    );
}
