use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
pub type UICollectionViewCellRegistrationConfigurationHandler = *mut block2::DynBlock<
dyn Fn(NonNull<UICollectionViewCell>, NonNull<NSIndexPath>, NonNull<AnyObject>),
>;
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewCellRegistration;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UICollectionViewCellRegistration {}
);
impl UICollectionViewCellRegistration {
extern_methods!(
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[unsafe(method(registrationWithCellClass:configurationHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn registrationWithCellClass_configurationHandler(
cell_class: &AnyClass,
configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UINib",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(registrationWithCellNib:configurationHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn registrationWithCellNib_configurationHandler(
cell_nib: &UINib,
configuration_handler: UICollectionViewCellRegistrationConfigurationHandler,
) -> Retained<Self>;
#[unsafe(method(cellClass))]
#[unsafe(method_family = none)]
pub fn cellClass(&self) -> Option<&'static AnyClass>;
#[cfg(feature = "UINib")]
#[unsafe(method(cellNib))]
#[unsafe(method_family = none)]
pub fn cellNib(&self) -> Option<Retained<UINib>>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[unsafe(method(configurationHandler))]
#[unsafe(method_family = none)]
pub unsafe fn configurationHandler(
&self,
) -> UICollectionViewCellRegistrationConfigurationHandler;
);
}
impl UICollectionViewCellRegistration {
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>;
);
}
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
pub type UICollectionViewSupplementaryRegistrationConfigurationHandler = *mut block2::DynBlock<
dyn Fn(NonNull<UICollectionReusableView>, NonNull<NSString>, NonNull<NSIndexPath>),
>;
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewSupplementaryRegistration;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UICollectionViewSupplementaryRegistration {}
);
impl UICollectionViewSupplementaryRegistration {
extern_methods!(
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[unsafe(method(registrationWithSupplementaryClass:elementKind:configurationHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn registrationWithSupplementaryClass_elementKind_configurationHandler(
supplementary_class: &AnyClass,
element_kind: &NSString,
configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UINib",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[deprecated = "Loading Interface Builder products will not be supported in a future version of visionOS."]
#[unsafe(method(registrationWithSupplementaryNib:elementKind:configurationHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn registrationWithSupplementaryNib_elementKind_configurationHandler(
supplementary_nib: &UINib,
element_kind: &NSString,
configuration_handler: UICollectionViewSupplementaryRegistrationConfigurationHandler,
) -> Retained<Self>;
#[unsafe(method(supplementaryClass))]
#[unsafe(method_family = none)]
pub fn supplementaryClass(&self) -> Option<&'static AnyClass>;
#[cfg(feature = "UINib")]
#[unsafe(method(supplementaryNib))]
#[unsafe(method_family = none)]
pub fn supplementaryNib(&self) -> Option<Retained<UINib>>;
#[unsafe(method(elementKind))]
#[unsafe(method_family = none)]
pub fn elementKind(&self) -> Retained<NSString>;
#[cfg(all(
feature = "UICollectionViewCell",
feature = "UIResponder",
feature = "UIView",
feature = "block2"
))]
#[unsafe(method(configurationHandler))]
#[unsafe(method_family = none)]
pub unsafe fn configurationHandler(
&self,
) -> UICollectionViewSupplementaryRegistrationConfigurationHandler;
);
}
impl UICollectionViewSupplementaryRegistration {
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>;
);
}