objc2_ui_kit/generated/
UICollectionViewItemRegistration.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[cfg(all(
12 feature = "UICollectionViewCell",
13 feature = "UIResponder",
14 feature = "UIView",
15 feature = "block2"
16))]
17pub type UICollectionViewCellRegistrationConfigurationHandler = *mut block2::DynBlock<
18 dyn Fn(NonNull<UICollectionViewCell>, NonNull<NSIndexPath>, NonNull<AnyObject>),
19>;
20
21extern_class!(
22 #[unsafe(super(NSObject))]
24 #[thread_kind = MainThreadOnly]
25 #[derive(Debug, PartialEq, Eq, Hash)]
26 pub struct UICollectionViewCellRegistration;
27);
28
29extern_conformance!(
30 unsafe impl NSObjectProtocol for UICollectionViewCellRegistration {}
31);
32
33impl UICollectionViewCellRegistration {
34 extern_methods!(
35 #[cfg(all(
36 feature = "UICollectionViewCell",
37 feature = "UIResponder",
38 feature = "UIView",
39 feature = "block2"
40 ))]
41 #[unsafe(method(registrationWithCellClass:configurationHandler:))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn registrationWithCellClass_configurationHandler(
48 cell_class: &AnyClass,
49 configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
50 mtm: MainThreadMarker,
51 ) -> Retained<Self>;
52
53 #[cfg(all(
54 feature = "UICollectionViewCell",
55 feature = "UINib",
56 feature = "UIResponder",
57 feature = "UIView",
58 feature = "block2"
59 ))]
60 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
64 #[unsafe(method(registrationWithCellNib:configurationHandler:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn registrationWithCellNib_configurationHandler(
67 cell_nib: &UINib,
68 configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
69 ) -> Retained<Self>;
70
71 #[unsafe(method(cellClass))]
72 #[unsafe(method_family = none)]
73 pub fn cellClass(&self) -> Option<&'static AnyClass>;
74
75 #[cfg(feature = "UINib")]
76 #[unsafe(method(cellNib))]
77 #[unsafe(method_family = none)]
78 pub fn cellNib(&self) -> Option<Retained<UINib>>;
79
80 #[cfg(all(
81 feature = "UICollectionViewCell",
82 feature = "UIResponder",
83 feature = "UIView",
84 feature = "block2"
85 ))]
86 #[unsafe(method(configurationHandler))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn configurationHandler(
94 &self,
95 ) -> UICollectionViewCellRegistrationConfigurationHandler;
96 );
97}
98
99impl UICollectionViewCellRegistration {
101 extern_methods!(
102 #[unsafe(method(init))]
103 #[unsafe(method_family = init)]
104 pub fn init(this: Allocated<Self>) -> Retained<Self>;
105
106 #[unsafe(method(new))]
107 #[unsafe(method_family = new)]
108 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
109 );
110}
111
112#[cfg(all(
114 feature = "UICollectionViewCell",
115 feature = "UIResponder",
116 feature = "UIView",
117 feature = "block2"
118))]
119pub type UICollectionViewSupplementaryRegistrationConfigurationHandler = *mut block2::DynBlock<
120 dyn Fn(NonNull<UICollectionReusableView>, NonNull<NSString>, NonNull<NSIndexPath>),
121>;
122
123extern_class!(
124 #[unsafe(super(NSObject))]
126 #[thread_kind = MainThreadOnly]
127 #[derive(Debug, PartialEq, Eq, Hash)]
128 pub struct UICollectionViewSupplementaryRegistration;
129);
130
131extern_conformance!(
132 unsafe impl NSObjectProtocol for UICollectionViewSupplementaryRegistration {}
133);
134
135impl UICollectionViewSupplementaryRegistration {
136 extern_methods!(
137 #[cfg(all(
138 feature = "UICollectionViewCell",
139 feature = "UIResponder",
140 feature = "UIView",
141 feature = "block2"
142 ))]
143 #[unsafe(method(registrationWithSupplementaryClass:elementKind:configurationHandler:))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn registrationWithSupplementaryClass_elementKind_configurationHandler(
150 supplementary_class: &AnyClass,
151 element_kind: &NSString,
152 configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
153 mtm: MainThreadMarker,
154 ) -> Retained<Self>;
155
156 #[cfg(all(
157 feature = "UICollectionViewCell",
158 feature = "UINib",
159 feature = "UIResponder",
160 feature = "UIView",
161 feature = "block2"
162 ))]
163 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
167 #[unsafe(method(registrationWithSupplementaryNib:elementKind:configurationHandler:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn registrationWithSupplementaryNib_elementKind_configurationHandler(
170 supplementary_nib: &UINib,
171 element_kind: &NSString,
172 configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
173 ) -> Retained<Self>;
174
175 #[unsafe(method(supplementaryClass))]
176 #[unsafe(method_family = none)]
177 pub fn supplementaryClass(&self) -> Option<&'static AnyClass>;
178
179 #[cfg(feature = "UINib")]
180 #[unsafe(method(supplementaryNib))]
181 #[unsafe(method_family = none)]
182 pub fn supplementaryNib(&self) -> Option<Retained<UINib>>;
183
184 #[unsafe(method(elementKind))]
185 #[unsafe(method_family = none)]
186 pub fn elementKind(&self) -> Retained<NSString>;
187
188 #[cfg(all(
189 feature = "UICollectionViewCell",
190 feature = "UIResponder",
191 feature = "UIView",
192 feature = "block2"
193 ))]
194 #[unsafe(method(configurationHandler))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn configurationHandler(
202 &self,
203 ) -> UICollectionViewSupplementaryRegistrationConfigurationHandler;
204 );
205}
206
207impl UICollectionViewSupplementaryRegistration {
209 extern_methods!(
210 #[unsafe(method(init))]
211 #[unsafe(method_family = init)]
212 pub fn init(this: Allocated<Self>) -> Retained<Self>;
213
214 #[unsafe(method(new))]
215 #[unsafe(method_family = new)]
216 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
217 );
218}