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::Block<
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
29unsafe impl NSObjectProtocol for UICollectionViewCellRegistration {}
30
31impl UICollectionViewCellRegistration {
32 extern_methods!(
33 #[cfg(all(
34 feature = "UICollectionViewCell",
35 feature = "UIResponder",
36 feature = "UIView",
37 feature = "block2"
38 ))]
39 #[unsafe(method(registrationWithCellClass:configurationHandler:))]
40 #[unsafe(method_family = none)]
41 pub unsafe fn registrationWithCellClass_configurationHandler(
42 cell_class: &AnyClass,
43 configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
44 mtm: MainThreadMarker,
45 ) -> Retained<Self>;
46
47 #[cfg(all(
48 feature = "UICollectionViewCell",
49 feature = "UINib",
50 feature = "UIResponder",
51 feature = "UIView",
52 feature = "block2"
53 ))]
54 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
55 #[unsafe(method(registrationWithCellNib:configurationHandler:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn registrationWithCellNib_configurationHandler(
58 cell_nib: &UINib,
59 configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
60 ) -> Retained<Self>;
61
62 #[unsafe(method(cellClass))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn cellClass(&self) -> Option<&'static AnyClass>;
65
66 #[cfg(feature = "UINib")]
67 #[unsafe(method(cellNib))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn cellNib(&self) -> Option<Retained<UINib>>;
70
71 #[cfg(all(
72 feature = "UICollectionViewCell",
73 feature = "UIResponder",
74 feature = "UIView",
75 feature = "block2"
76 ))]
77 #[unsafe(method(configurationHandler))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn configurationHandler(
80 &self,
81 ) -> UICollectionViewCellRegistrationConfigurationHandler;
82 );
83}
84
85impl UICollectionViewCellRegistration {
87 extern_methods!(
88 #[unsafe(method(init))]
89 #[unsafe(method_family = init)]
90 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
91
92 #[unsafe(method(new))]
93 #[unsafe(method_family = new)]
94 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
95 );
96}
97
98#[cfg(all(
100 feature = "UICollectionViewCell",
101 feature = "UIResponder",
102 feature = "UIView",
103 feature = "block2"
104))]
105pub type UICollectionViewSupplementaryRegistrationConfigurationHandler = *mut block2::Block<
106 dyn Fn(NonNull<UICollectionReusableView>, NonNull<NSString>, NonNull<NSIndexPath>),
107>;
108
109extern_class!(
110 #[unsafe(super(NSObject))]
112 #[thread_kind = MainThreadOnly]
113 #[derive(Debug, PartialEq, Eq, Hash)]
114 pub struct UICollectionViewSupplementaryRegistration;
115);
116
117unsafe impl NSObjectProtocol for UICollectionViewSupplementaryRegistration {}
118
119impl UICollectionViewSupplementaryRegistration {
120 extern_methods!(
121 #[cfg(all(
122 feature = "UICollectionViewCell",
123 feature = "UIResponder",
124 feature = "UIView",
125 feature = "block2"
126 ))]
127 #[unsafe(method(registrationWithSupplementaryClass:elementKind:configurationHandler:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn registrationWithSupplementaryClass_elementKind_configurationHandler(
130 supplementary_class: &AnyClass,
131 element_kind: &NSString,
132 configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
133 mtm: MainThreadMarker,
134 ) -> Retained<Self>;
135
136 #[cfg(all(
137 feature = "UICollectionViewCell",
138 feature = "UINib",
139 feature = "UIResponder",
140 feature = "UIView",
141 feature = "block2"
142 ))]
143 #[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
144 #[unsafe(method(registrationWithSupplementaryNib:elementKind:configurationHandler:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn registrationWithSupplementaryNib_elementKind_configurationHandler(
147 supplementary_nib: &UINib,
148 element_kind: &NSString,
149 configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
150 ) -> Retained<Self>;
151
152 #[unsafe(method(supplementaryClass))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn supplementaryClass(&self) -> Option<&'static AnyClass>;
155
156 #[cfg(feature = "UINib")]
157 #[unsafe(method(supplementaryNib))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn supplementaryNib(&self) -> Option<Retained<UINib>>;
160
161 #[unsafe(method(elementKind))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn elementKind(&self) -> Retained<NSString>;
164
165 #[cfg(all(
166 feature = "UICollectionViewCell",
167 feature = "UIResponder",
168 feature = "UIView",
169 feature = "block2"
170 ))]
171 #[unsafe(method(configurationHandler))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn configurationHandler(
174 &self,
175 ) -> UICollectionViewSupplementaryRegistrationConfigurationHandler;
176 );
177}
178
179impl UICollectionViewSupplementaryRegistration {
181 extern_methods!(
182 #[unsafe(method(init))]
183 #[unsafe(method_family = init)]
184 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
185
186 #[unsafe(method(new))]
187 #[unsafe(method_family = new)]
188 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
189 );
190}