objc2_ui_kit/generated/
UICollectionViewController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionviewcontroller?language=objc)
12    #[unsafe(super(UIViewController, UIResponder, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
16    pub struct UICollectionViewController;
17);
18
19#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
20extern_conformance!(
21    unsafe impl NSCoding for UICollectionViewController {}
22);
23
24#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for UICollectionViewController {}
27);
28
29#[cfg(all(
30    feature = "UIAppearance",
31    feature = "UIResponder",
32    feature = "UIViewController"
33))]
34extern_conformance!(
35    unsafe impl UIAppearanceContainer for UICollectionViewController {}
36);
37
38#[cfg(all(
39    feature = "UICollectionView",
40    feature = "UIResponder",
41    feature = "UIViewController"
42))]
43extern_conformance!(
44    unsafe impl UICollectionViewDataSource for UICollectionViewController {}
45);
46
47#[cfg(all(
48    feature = "UICollectionView",
49    feature = "UIResponder",
50    feature = "UIScrollView",
51    feature = "UIViewController"
52))]
53extern_conformance!(
54    unsafe impl UICollectionViewDelegate for UICollectionViewController {}
55);
56
57#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
58extern_conformance!(
59    unsafe impl UIContentContainer for UICollectionViewController {}
60);
61
62#[cfg(all(
63    feature = "UIFocus",
64    feature = "UIResponder",
65    feature = "UIViewController"
66))]
67extern_conformance!(
68    unsafe impl UIFocusEnvironment for UICollectionViewController {}
69);
70
71#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
72extern_conformance!(
73    unsafe impl UIResponderStandardEditActions for UICollectionViewController {}
74);
75
76#[cfg(all(
77    feature = "UIResponder",
78    feature = "UIScrollView",
79    feature = "UIViewController"
80))]
81extern_conformance!(
82    unsafe impl UIScrollViewDelegate for UICollectionViewController {}
83);
84
85#[cfg(all(
86    feature = "UIResponder",
87    feature = "UITraitCollection",
88    feature = "UIViewController"
89))]
90extern_conformance!(
91    unsafe impl UITraitEnvironment for UICollectionViewController {}
92);
93
94#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
95impl UICollectionViewController {
96    extern_methods!(
97        #[cfg(feature = "UICollectionViewLayout")]
98        #[unsafe(method(initWithCollectionViewLayout:))]
99        #[unsafe(method_family = init)]
100        pub fn initWithCollectionViewLayout(
101            this: Allocated<Self>,
102            layout: &UICollectionViewLayout,
103        ) -> Retained<Self>;
104
105        #[unsafe(method(initWithNibName:bundle:))]
106        #[unsafe(method_family = init)]
107        pub fn initWithNibName_bundle(
108            this: Allocated<Self>,
109            nib_name_or_nil: Option<&NSString>,
110            nib_bundle_or_nil: Option<&NSBundle>,
111        ) -> Retained<Self>;
112
113        /// # Safety
114        ///
115        /// `coder` possibly has further requirements.
116        #[unsafe(method(initWithCoder:))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn initWithCoder(
119            this: Allocated<Self>,
120            coder: &NSCoder,
121        ) -> Option<Retained<Self>>;
122
123        #[cfg(all(
124            feature = "UICollectionView",
125            feature = "UIScrollView",
126            feature = "UIView"
127        ))]
128        #[unsafe(method(collectionView))]
129        #[unsafe(method_family = none)]
130        pub fn collectionView(&self) -> Option<Retained<UICollectionView>>;
131
132        #[cfg(all(
133            feature = "UICollectionView",
134            feature = "UIScrollView",
135            feature = "UIView"
136        ))]
137        /// Setter for [`collectionView`][Self::collectionView].
138        ///
139        /// # Safety
140        ///
141        /// `collection_view` might not allow `None`.
142        #[unsafe(method(setCollectionView:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn setCollectionView(&self, collection_view: Option<&UICollectionView>);
145
146        #[unsafe(method(clearsSelectionOnViewWillAppear))]
147        #[unsafe(method_family = none)]
148        pub fn clearsSelectionOnViewWillAppear(&self) -> bool;
149
150        /// Setter for [`clearsSelectionOnViewWillAppear`][Self::clearsSelectionOnViewWillAppear].
151        #[unsafe(method(setClearsSelectionOnViewWillAppear:))]
152        #[unsafe(method_family = none)]
153        pub fn setClearsSelectionOnViewWillAppear(
154            &self,
155            clears_selection_on_view_will_appear: bool,
156        );
157
158        #[unsafe(method(useLayoutToLayoutNavigationTransitions))]
159        #[unsafe(method_family = none)]
160        pub fn useLayoutToLayoutNavigationTransitions(&self) -> bool;
161
162        /// Setter for [`useLayoutToLayoutNavigationTransitions`][Self::useLayoutToLayoutNavigationTransitions].
163        #[unsafe(method(setUseLayoutToLayoutNavigationTransitions:))]
164        #[unsafe(method_family = none)]
165        pub fn setUseLayoutToLayoutNavigationTransitions(
166            &self,
167            use_layout_to_layout_navigation_transitions: bool,
168        );
169
170        #[cfg(feature = "UICollectionViewLayout")]
171        #[unsafe(method(collectionViewLayout))]
172        #[unsafe(method_family = none)]
173        pub fn collectionViewLayout(&self) -> Retained<UICollectionViewLayout>;
174
175        #[unsafe(method(installsStandardGestureForInteractiveMovement))]
176        #[unsafe(method_family = none)]
177        pub fn installsStandardGestureForInteractiveMovement(&self) -> bool;
178
179        /// Setter for [`installsStandardGestureForInteractiveMovement`][Self::installsStandardGestureForInteractiveMovement].
180        #[unsafe(method(setInstallsStandardGestureForInteractiveMovement:))]
181        #[unsafe(method_family = none)]
182        pub fn setInstallsStandardGestureForInteractiveMovement(
183            &self,
184            installs_standard_gesture_for_interactive_movement: bool,
185        );
186    );
187}
188
189/// Methods declared on superclass `NSObject`.
190#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
191impl UICollectionViewController {
192    extern_methods!(
193        #[unsafe(method(init))]
194        #[unsafe(method_family = init)]
195        pub fn init(this: Allocated<Self>) -> Retained<Self>;
196
197        #[unsafe(method(new))]
198        #[unsafe(method_family = new)]
199        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
200    );
201}