use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIContentInsetsReference(pub NSInteger);
impl UIContentInsetsReference {
#[doc(alias = "UIContentInsetsReferenceAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIContentInsetsReferenceNone")]
pub const None: Self = Self(1);
#[doc(alias = "UIContentInsetsReferenceSafeArea")]
pub const SafeArea: Self = Self(2);
#[doc(alias = "UIContentInsetsReferenceLayoutMargins")]
pub const LayoutMargins: Self = Self(3);
#[doc(alias = "UIContentInsetsReferenceReadableContent")]
pub const ReadableContent: Self = Self(4);
}
unsafe impl Encode for UIContentInsetsReference {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIContentInsetsReference {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewCompositionalLayoutConfiguration;
);
extern_conformance!(
unsafe impl NSCopying for UICollectionViewCompositionalLayoutConfiguration {}
);
unsafe impl CopyingHelper for UICollectionViewCompositionalLayoutConfiguration {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICollectionViewCompositionalLayoutConfiguration {}
);
impl UICollectionViewCompositionalLayoutConfiguration {
extern_methods!(
#[cfg(feature = "UICollectionViewLayout")]
#[unsafe(method(scrollDirection))]
#[unsafe(method_family = none)]
pub fn scrollDirection(&self) -> UICollectionViewScrollDirection;
#[cfg(feature = "UICollectionViewLayout")]
#[unsafe(method(setScrollDirection:))]
#[unsafe(method_family = none)]
pub fn setScrollDirection(&self, scroll_direction: UICollectionViewScrollDirection);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(interSectionSpacing))]
#[unsafe(method_family = none)]
pub fn interSectionSpacing(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setInterSectionSpacing:))]
#[unsafe(method_family = none)]
pub fn setInterSectionSpacing(&self, inter_section_spacing: CGFloat);
#[unsafe(method(boundarySupplementaryItems))]
#[unsafe(method_family = none)]
pub fn boundarySupplementaryItems(
&self,
) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
#[unsafe(method(setBoundarySupplementaryItems:))]
#[unsafe(method_family = none)]
pub fn setBoundarySupplementaryItems(
&self,
boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
);
#[unsafe(method(contentInsetsReference))]
#[unsafe(method_family = none)]
pub fn contentInsetsReference(&self) -> UIContentInsetsReference;
#[unsafe(method(setContentInsetsReference:))]
#[unsafe(method_family = none)]
pub fn setContentInsetsReference(&self, content_insets_reference: UIContentInsetsReference);
);
}
impl UICollectionViewCompositionalLayoutConfiguration {
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(feature = "block2")]
pub type UICollectionViewCompositionalLayoutSectionProvider = *mut block2::DynBlock<
dyn Fn(
NSInteger,
NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
) -> *mut NSCollectionLayoutSection,
>;
extern_class!(
#[unsafe(super(UICollectionViewLayout, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UICollectionViewLayout")]
pub struct UICollectionViewCompositionalLayout;
);
#[cfg(feature = "UICollectionViewLayout")]
extern_conformance!(
unsafe impl NSCoding for UICollectionViewCompositionalLayout {}
);
#[cfg(feature = "UICollectionViewLayout")]
extern_conformance!(
unsafe impl NSObjectProtocol for UICollectionViewCompositionalLayout {}
);
#[cfg(feature = "UICollectionViewLayout")]
impl UICollectionViewCompositionalLayout {
extern_methods!(
#[unsafe(method(initWithSection:))]
#[unsafe(method_family = init)]
pub fn initWithSection(
this: Allocated<Self>,
section: &NSCollectionLayoutSection,
) -> Retained<Self>;
#[unsafe(method(initWithSection:configuration:))]
#[unsafe(method_family = init)]
pub fn initWithSection_configuration(
this: Allocated<Self>,
section: &NSCollectionLayoutSection,
configuration: &UICollectionViewCompositionalLayoutConfiguration,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(initWithSectionProvider:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSectionProvider(
this: Allocated<Self>,
section_provider: UICollectionViewCompositionalLayoutSectionProvider,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(initWithSectionProvider:configuration:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSectionProvider_configuration(
this: Allocated<Self>,
section_provider: UICollectionViewCompositionalLayoutSectionProvider,
configuration: &UICollectionViewCompositionalLayoutConfiguration,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(configuration))]
#[unsafe(method_family = none)]
pub fn configuration(&self) -> Retained<UICollectionViewCompositionalLayoutConfiguration>;
#[unsafe(method(setConfiguration:))]
#[unsafe(method_family = none)]
pub fn setConfiguration(
&self,
configuration: &UICollectionViewCompositionalLayoutConfiguration,
);
);
}
#[cfg(feature = "UICollectionViewLayout")]
impl UICollectionViewCompositionalLayout {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionLayoutSectionOrthogonalScrollingBehavior(pub NSInteger);
impl UICollectionLayoutSectionOrthogonalScrollingBehavior {
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorNone")]
pub const None: Self = Self(0);
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorContinuous")]
pub const Continuous: Self = Self(1);
#[doc(
alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorContinuousGroupLeadingBoundary"
)]
pub const ContinuousGroupLeadingBoundary: Self = Self(2);
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorPaging")]
pub const Paging: Self = Self(3);
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorGroupPaging")]
pub const GroupPaging: Self = Self(4);
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBehaviorGroupPagingCentered")]
pub const GroupPagingCentered: Self = Self(5);
}
unsafe impl Encode for UICollectionLayoutSectionOrthogonalScrollingBehavior {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionLayoutSectionOrthogonalScrollingBehavior {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "block2",
feature = "objc2-core-foundation"
))]
pub type NSCollectionLayoutSectionVisibleItemsInvalidationHandler = *mut block2::DynBlock<
dyn Fn(
NonNull<NSArray<ProtocolObject<dyn NSCollectionLayoutVisibleItem>>>,
CGPoint,
NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
),
>;
#[cfg(feature = "objc2-core-foundation")]
pub type UICollectionLayoutSectionOrthogonalScrollingDecelerationRate = CGFloat;
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UICollectionLayoutSectionOrthogonalScrollingDecelerationRateAutomatic:
UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UICollectionLayoutSectionOrthogonalScrollingDecelerationRateNormal:
UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
}
extern "C" {
#[cfg(feature = "objc2-core-foundation")]
pub static UICollectionLayoutSectionOrthogonalScrollingDecelerationRateFast:
UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionLayoutSectionOrthogonalScrollingBounce(pub NSInteger);
impl UICollectionLayoutSectionOrthogonalScrollingBounce {
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBounceAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBounceAlways")]
pub const Always: Self = Self(1);
#[doc(alias = "UICollectionLayoutSectionOrthogonalScrollingBounceNever")]
pub const Never: Self = Self(2);
}
unsafe impl Encode for UICollectionLayoutSectionOrthogonalScrollingBounce {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionLayoutSectionOrthogonalScrollingBounce {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionLayoutSectionOrthogonalScrollingProperties;
);
extern_conformance!(
unsafe impl NSCopying for UICollectionLayoutSectionOrthogonalScrollingProperties {}
);
unsafe impl CopyingHelper for UICollectionLayoutSectionOrthogonalScrollingProperties {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UICollectionLayoutSectionOrthogonalScrollingProperties {}
);
impl UICollectionLayoutSectionOrthogonalScrollingProperties {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(decelerationRate))]
#[unsafe(method_family = none)]
pub fn decelerationRate(
&self,
) -> UICollectionLayoutSectionOrthogonalScrollingDecelerationRate;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setDecelerationRate:))]
#[unsafe(method_family = none)]
pub fn setDecelerationRate(
&self,
deceleration_rate: UICollectionLayoutSectionOrthogonalScrollingDecelerationRate,
);
#[unsafe(method(bounce))]
#[unsafe(method_family = none)]
pub fn bounce(&self) -> UICollectionLayoutSectionOrthogonalScrollingBounce;
#[unsafe(method(setBounce:))]
#[unsafe(method_family = none)]
pub fn setBounce(&self, bounce: UICollectionLayoutSectionOrthogonalScrollingBounce);
);
}
impl UICollectionLayoutSectionOrthogonalScrollingProperties {
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>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSection;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutSection {}
);
unsafe impl CopyingHelper for NSCollectionLayoutSection {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutSection {}
);
impl NSCollectionLayoutSection {
extern_methods!(
#[unsafe(method(sectionWithGroup:))]
#[unsafe(method_family = none)]
pub fn sectionWithGroup(group: &NSCollectionLayoutGroup) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(contentInsets))]
#[unsafe(method_family = none)]
pub fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(setContentInsets:))]
#[unsafe(method_family = none)]
pub fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(interGroupSpacing))]
#[unsafe(method_family = none)]
pub fn interGroupSpacing(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setInterGroupSpacing:))]
#[unsafe(method_family = none)]
pub fn setInterGroupSpacing(&self, inter_group_spacing: CGFloat);
#[unsafe(method(contentInsetsReference))]
#[unsafe(method_family = none)]
pub fn contentInsetsReference(&self) -> UIContentInsetsReference;
#[unsafe(method(setContentInsetsReference:))]
#[unsafe(method_family = none)]
pub fn setContentInsetsReference(&self, content_insets_reference: UIContentInsetsReference);
#[unsafe(method(supplementaryContentInsetsReference))]
#[unsafe(method_family = none)]
pub fn supplementaryContentInsetsReference(&self) -> UIContentInsetsReference;
#[unsafe(method(setSupplementaryContentInsetsReference:))]
#[unsafe(method_family = none)]
pub fn setSupplementaryContentInsetsReference(
&self,
supplementary_content_insets_reference: UIContentInsetsReference,
);
#[unsafe(method(orthogonalScrollingBehavior))]
#[unsafe(method_family = none)]
pub fn orthogonalScrollingBehavior(
&self,
) -> UICollectionLayoutSectionOrthogonalScrollingBehavior;
#[unsafe(method(setOrthogonalScrollingBehavior:))]
#[unsafe(method_family = none)]
pub fn setOrthogonalScrollingBehavior(
&self,
orthogonal_scrolling_behavior: UICollectionLayoutSectionOrthogonalScrollingBehavior,
);
#[unsafe(method(orthogonalScrollingProperties))]
#[unsafe(method_family = none)]
pub fn orthogonalScrollingProperties(
&self,
) -> Retained<UICollectionLayoutSectionOrthogonalScrollingProperties>;
#[unsafe(method(boundarySupplementaryItems))]
#[unsafe(method_family = none)]
pub fn boundarySupplementaryItems(
&self,
) -> Retained<NSArray<NSCollectionLayoutBoundarySupplementaryItem>>;
#[unsafe(method(setBoundarySupplementaryItems:))]
#[unsafe(method_family = none)]
pub fn setBoundarySupplementaryItems(
&self,
boundary_supplementary_items: &NSArray<NSCollectionLayoutBoundarySupplementaryItem>,
);
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "block2",
feature = "objc2-core-foundation"
))]
#[unsafe(method(visibleItemsInvalidationHandler))]
#[unsafe(method_family = none)]
pub unsafe fn visibleItemsInvalidationHandler(
&self,
) -> NSCollectionLayoutSectionVisibleItemsInvalidationHandler;
#[cfg(all(
feature = "UIDynamicBehavior",
feature = "block2",
feature = "objc2-core-foundation"
))]
#[unsafe(method(setVisibleItemsInvalidationHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setVisibleItemsInvalidationHandler(
&self,
visible_items_invalidation_handler: NSCollectionLayoutSectionVisibleItemsInvalidationHandler,
);
#[unsafe(method(decorationItems))]
#[unsafe(method_family = none)]
pub fn decorationItems(&self) -> Retained<NSArray<NSCollectionLayoutDecorationItem>>;
#[unsafe(method(setDecorationItems:))]
#[unsafe(method_family = none)]
pub fn setDecorationItems(
&self,
decoration_items: &NSArray<NSCollectionLayoutDecorationItem>,
);
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutItem;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutItem {}
);
unsafe impl CopyingHelper for NSCollectionLayoutItem {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutItem {}
);
impl NSCollectionLayoutItem {
extern_methods!(
#[unsafe(method(itemWithLayoutSize:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
#[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize_supplementaryItems(
layout_size: &NSCollectionLayoutSize,
supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(contentInsets))]
#[unsafe(method_family = none)]
pub fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(setContentInsets:))]
#[unsafe(method_family = none)]
pub fn setContentInsets(&self, content_insets: NSDirectionalEdgeInsets);
#[unsafe(method(edgeSpacing))]
#[unsafe(method_family = none)]
pub fn edgeSpacing(&self) -> Option<Retained<NSCollectionLayoutEdgeSpacing>>;
#[unsafe(method(setEdgeSpacing:))]
#[unsafe(method_family = none)]
pub fn setEdgeSpacing(&self, edge_spacing: Option<&NSCollectionLayoutEdgeSpacing>);
#[unsafe(method(layoutSize))]
#[unsafe(method_family = none)]
pub fn layoutSize(&self) -> Retained<NSCollectionLayoutSize>;
#[unsafe(method(supplementaryItems))]
#[unsafe(method_family = none)]
pub fn supplementaryItems(&self) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutGroupCustomItem;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutGroupCustomItem {}
);
unsafe impl CopyingHelper for NSCollectionLayoutGroupCustomItem {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutGroupCustomItem {}
);
impl NSCollectionLayoutGroupCustomItem {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(customItemWithFrame:))]
#[unsafe(method_family = none)]
pub fn customItemWithFrame(frame: CGRect, mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(customItemWithFrame:zIndex:))]
#[unsafe(method_family = none)]
pub fn customItemWithFrame_zIndex(
frame: CGRect,
z_index: NSInteger,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(frame))]
#[unsafe(method_family = none)]
pub fn frame(&self) -> CGRect;
#[unsafe(method(zIndex))]
#[unsafe(method_family = none)]
pub fn zIndex(&self) -> NSInteger;
);
}
#[cfg(feature = "block2")]
pub type NSCollectionLayoutGroupCustomItemProvider = *mut block2::DynBlock<
dyn Fn(
NonNull<ProtocolObject<dyn NSCollectionLayoutEnvironment>>,
) -> NonNull<NSArray<NSCollectionLayoutGroupCustomItem>>,
>;
extern_class!(
#[unsafe(super(NSCollectionLayoutItem, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutGroup;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutGroup {}
);
unsafe impl CopyingHelper for NSCollectionLayoutGroup {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutGroup {}
);
impl NSCollectionLayoutGroup {
extern_methods!(
#[unsafe(method(horizontalGroupWithLayoutSize:repeatingSubitem:count:))]
#[unsafe(method_family = none)]
pub fn horizontalGroupWithLayoutSize_repeatingSubitem_count(
layout_size: &NSCollectionLayoutSize,
subitem: &NSCollectionLayoutItem,
count: NSInteger,
) -> Retained<Self>;
#[unsafe(method(horizontalGroupWithLayoutSize:subitems:))]
#[unsafe(method_family = none)]
pub fn horizontalGroupWithLayoutSize_subitems(
layout_size: &NSCollectionLayoutSize,
subitems: &NSArray<NSCollectionLayoutItem>,
) -> Retained<Self>;
#[unsafe(method(verticalGroupWithLayoutSize:repeatingSubitem:count:))]
#[unsafe(method_family = none)]
pub fn verticalGroupWithLayoutSize_repeatingSubitem_count(
layout_size: &NSCollectionLayoutSize,
subitem: &NSCollectionLayoutItem,
count: NSInteger,
) -> Retained<Self>;
#[unsafe(method(verticalGroupWithLayoutSize:subitems:))]
#[unsafe(method_family = none)]
pub fn verticalGroupWithLayoutSize_subitems(
layout_size: &NSCollectionLayoutSize,
subitems: &NSArray<NSCollectionLayoutItem>,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(customGroupWithLayoutSize:itemProvider:))]
#[unsafe(method_family = none)]
pub unsafe fn customGroupWithLayoutSize_itemProvider(
layout_size: &NSCollectionLayoutSize,
item_provider: NSCollectionLayoutGroupCustomItemProvider,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(supplementaryItems))]
#[unsafe(method_family = none)]
pub fn supplementaryItems(&self) -> Retained<NSArray<NSCollectionLayoutSupplementaryItem>>;
#[unsafe(method(setSupplementaryItems:))]
#[unsafe(method_family = none)]
pub fn setSupplementaryItems(
&self,
supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
);
#[unsafe(method(interItemSpacing))]
#[unsafe(method_family = none)]
pub fn interItemSpacing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
#[unsafe(method(setInterItemSpacing:))]
#[unsafe(method_family = none)]
pub fn setInterItemSpacing(&self, inter_item_spacing: Option<&NSCollectionLayoutSpacing>);
#[unsafe(method(subitems))]
#[unsafe(method_family = none)]
pub fn subitems(&self) -> Retained<NSArray<NSCollectionLayoutItem>>;
#[unsafe(method(visualDescription))]
#[unsafe(method_family = none)]
pub fn visualDescription(&self) -> Retained<NSString>;
);
}
impl NSCollectionLayoutGroup {
extern_methods!(
#[unsafe(method(itemWithLayoutSize:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
#[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize_supplementaryItems(
layout_size: &NSCollectionLayoutSize,
supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutDimension;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutDimension {}
);
unsafe impl CopyingHelper for NSCollectionLayoutDimension {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutDimension {}
);
impl NSCollectionLayoutDimension {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(fractionalWidthDimension:))]
#[unsafe(method_family = none)]
pub fn fractionalWidthDimension(
fractional_width: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(fractionalHeightDimension:))]
#[unsafe(method_family = none)]
pub fn fractionalHeightDimension(
fractional_height: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(absoluteDimension:))]
#[unsafe(method_family = none)]
pub fn absoluteDimension(
absolute_dimension: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(estimatedDimension:))]
#[unsafe(method_family = none)]
pub fn estimatedDimension(
estimated_dimension: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(uniformAcrossSiblingsWithEstimate:))]
#[unsafe(method_family = none)]
pub fn uniformAcrossSiblingsWithEstimate(
estimated_dimension: CGFloat,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(isFractionalWidth))]
#[unsafe(method_family = none)]
pub fn isFractionalWidth(&self) -> bool;
#[unsafe(method(isFractionalHeight))]
#[unsafe(method_family = none)]
pub fn isFractionalHeight(&self) -> bool;
#[unsafe(method(isAbsolute))]
#[unsafe(method_family = none)]
pub fn isAbsolute(&self) -> bool;
#[unsafe(method(isEstimated))]
#[unsafe(method_family = none)]
pub fn isEstimated(&self) -> bool;
#[unsafe(method(isUniformAcrossSiblings))]
#[unsafe(method_family = none)]
pub fn isUniformAcrossSiblings(&self) -> bool;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(dimension))]
#[unsafe(method_family = none)]
pub fn dimension(&self) -> CGFloat;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSize;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutSize {}
);
unsafe impl CopyingHelper for NSCollectionLayoutSize {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutSize {}
);
impl NSCollectionLayoutSize {
extern_methods!(
#[unsafe(method(sizeWithWidthDimension:heightDimension:))]
#[unsafe(method_family = none)]
pub fn sizeWithWidthDimension_heightDimension(
width: &NSCollectionLayoutDimension,
height: &NSCollectionLayoutDimension,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(widthDimension))]
#[unsafe(method_family = none)]
pub fn widthDimension(&self) -> Retained<NSCollectionLayoutDimension>;
#[unsafe(method(heightDimension))]
#[unsafe(method_family = none)]
pub fn heightDimension(&self) -> Retained<NSCollectionLayoutDimension>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSpacing;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutSpacing {}
);
unsafe impl CopyingHelper for NSCollectionLayoutSpacing {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutSpacing {}
);
impl NSCollectionLayoutSpacing {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(flexibleSpacing:))]
#[unsafe(method_family = none)]
pub fn flexibleSpacing(flexible_spacing: CGFloat, mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(fixedSpacing:))]
#[unsafe(method_family = none)]
pub fn fixedSpacing(fixed_spacing: CGFloat, mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(spacing))]
#[unsafe(method_family = none)]
pub fn spacing(&self) -> CGFloat;
#[unsafe(method(isFlexibleSpacing))]
#[unsafe(method_family = none)]
pub fn isFlexibleSpacing(&self) -> bool;
#[unsafe(method(isFixedSpacing))]
#[unsafe(method_family = none)]
pub fn isFixedSpacing(&self) -> bool;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutEdgeSpacing;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutEdgeSpacing {}
);
unsafe impl CopyingHelper for NSCollectionLayoutEdgeSpacing {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutEdgeSpacing {}
);
impl NSCollectionLayoutEdgeSpacing {
extern_methods!(
#[unsafe(method(spacingForLeading:top:trailing:bottom:))]
#[unsafe(method_family = none)]
pub fn spacingForLeading_top_trailing_bottom(
leading: Option<&NSCollectionLayoutSpacing>,
top: Option<&NSCollectionLayoutSpacing>,
trailing: Option<&NSCollectionLayoutSpacing>,
bottom: Option<&NSCollectionLayoutSpacing>,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(leading))]
#[unsafe(method_family = none)]
pub fn leading(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
#[unsafe(method(top))]
#[unsafe(method_family = none)]
pub fn top(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
#[unsafe(method(trailing))]
#[unsafe(method_family = none)]
pub fn trailing(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
#[unsafe(method(bottom))]
#[unsafe(method_family = none)]
pub fn bottom(&self) -> Option<Retained<NSCollectionLayoutSpacing>>;
);
}
extern_class!(
#[unsafe(super(NSCollectionLayoutItem, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutSupplementaryItem;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutSupplementaryItem {}
);
unsafe impl CopyingHelper for NSCollectionLayoutSupplementaryItem {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutSupplementaryItem {}
);
impl NSCollectionLayoutSupplementaryItem {
extern_methods!(
#[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
#[unsafe(method_family = none)]
pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
layout_size: &NSCollectionLayoutSize,
element_kind: &NSString,
container_anchor: &NSCollectionLayoutAnchor,
) -> Retained<Self>;
#[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
#[unsafe(method_family = none)]
pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
layout_size: &NSCollectionLayoutSize,
element_kind: &NSString,
container_anchor: &NSCollectionLayoutAnchor,
item_anchor: &NSCollectionLayoutAnchor,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(zIndex))]
#[unsafe(method_family = none)]
pub fn zIndex(&self) -> NSInteger;
#[unsafe(method(setZIndex:))]
#[unsafe(method_family = none)]
pub fn setZIndex(&self, z_index: NSInteger);
#[unsafe(method(elementKind))]
#[unsafe(method_family = none)]
pub fn elementKind(&self) -> Retained<NSString>;
#[unsafe(method(containerAnchor))]
#[unsafe(method_family = none)]
pub fn containerAnchor(&self) -> Retained<NSCollectionLayoutAnchor>;
#[unsafe(method(itemAnchor))]
#[unsafe(method_family = none)]
pub fn itemAnchor(&self) -> Option<Retained<NSCollectionLayoutAnchor>>;
);
}
impl NSCollectionLayoutSupplementaryItem {
extern_methods!(
#[unsafe(method(itemWithLayoutSize:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
#[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize_supplementaryItems(
layout_size: &NSCollectionLayoutSize,
supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSCollectionLayoutSupplementaryItem, NSCollectionLayoutItem, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutBoundarySupplementaryItem;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutBoundarySupplementaryItem {}
);
unsafe impl CopyingHelper for NSCollectionLayoutBoundarySupplementaryItem {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutBoundarySupplementaryItem {}
);
impl NSCollectionLayoutBoundarySupplementaryItem {
extern_methods!(
#[cfg(feature = "UIGeometry")]
#[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:))]
#[unsafe(method_family = none)]
pub fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment(
layout_size: &NSCollectionLayoutSize,
element_kind: &NSString,
alignment: NSRectAlignment,
) -> Retained<Self>;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(boundarySupplementaryItemWithLayoutSize:elementKind:alignment:absoluteOffset:))]
#[unsafe(method_family = none)]
pub fn boundarySupplementaryItemWithLayoutSize_elementKind_alignment_absoluteOffset(
layout_size: &NSCollectionLayoutSize,
element_kind: &NSString,
alignment: NSRectAlignment,
absolute_offset: CGPoint,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(extendsBoundary))]
#[unsafe(method_family = none)]
pub fn extendsBoundary(&self) -> bool;
#[unsafe(method(setExtendsBoundary:))]
#[unsafe(method_family = none)]
pub fn setExtendsBoundary(&self, extends_boundary: bool);
#[unsafe(method(pinToVisibleBounds))]
#[unsafe(method_family = none)]
pub fn pinToVisibleBounds(&self) -> bool;
#[unsafe(method(setPinToVisibleBounds:))]
#[unsafe(method_family = none)]
pub fn setPinToVisibleBounds(&self, pin_to_visible_bounds: bool);
#[cfg(feature = "UIGeometry")]
#[unsafe(method(alignment))]
#[unsafe(method_family = none)]
pub fn alignment(&self) -> NSRectAlignment;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(offset))]
#[unsafe(method_family = none)]
pub fn offset(&self) -> CGPoint;
);
}
impl NSCollectionLayoutBoundarySupplementaryItem {
extern_methods!(
#[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:))]
#[unsafe(method_family = none)]
pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor(
layout_size: &NSCollectionLayoutSize,
element_kind: &NSString,
container_anchor: &NSCollectionLayoutAnchor,
) -> Retained<Self>;
#[unsafe(method(supplementaryItemWithLayoutSize:elementKind:containerAnchor:itemAnchor:))]
#[unsafe(method_family = none)]
pub fn supplementaryItemWithLayoutSize_elementKind_containerAnchor_itemAnchor(
layout_size: &NSCollectionLayoutSize,
element_kind: &NSString,
container_anchor: &NSCollectionLayoutAnchor,
item_anchor: &NSCollectionLayoutAnchor,
) -> Retained<Self>;
);
}
impl NSCollectionLayoutBoundarySupplementaryItem {
extern_methods!(
#[unsafe(method(itemWithLayoutSize:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
#[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize_supplementaryItems(
layout_size: &NSCollectionLayoutSize,
supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSCollectionLayoutItem, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutDecorationItem;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutDecorationItem {}
);
unsafe impl CopyingHelper for NSCollectionLayoutDecorationItem {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutDecorationItem {}
);
impl NSCollectionLayoutDecorationItem {
extern_methods!(
#[unsafe(method(backgroundDecorationItemWithElementKind:))]
#[unsafe(method_family = none)]
pub fn backgroundDecorationItemWithElementKind(
element_kind: &NSString,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(zIndex))]
#[unsafe(method_family = none)]
pub fn zIndex(&self) -> NSInteger;
#[unsafe(method(setZIndex:))]
#[unsafe(method_family = none)]
pub fn setZIndex(&self, z_index: NSInteger);
#[unsafe(method(elementKind))]
#[unsafe(method_family = none)]
pub fn elementKind(&self) -> Retained<NSString>;
);
}
impl NSCollectionLayoutDecorationItem {
extern_methods!(
#[unsafe(method(itemWithLayoutSize:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize(layout_size: &NSCollectionLayoutSize) -> Retained<Self>;
#[unsafe(method(itemWithLayoutSize:supplementaryItems:))]
#[unsafe(method_family = none)]
pub fn itemWithLayoutSize_supplementaryItems(
layout_size: &NSCollectionLayoutSize,
supplementary_items: &NSArray<NSCollectionLayoutSupplementaryItem>,
) -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSCollectionLayoutAnchor;
);
extern_conformance!(
unsafe impl NSCopying for NSCollectionLayoutAnchor {}
);
unsafe impl CopyingHelper for NSCollectionLayoutAnchor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSCollectionLayoutAnchor {}
);
impl NSCollectionLayoutAnchor {
extern_methods!(
#[cfg(feature = "UIGeometry")]
#[unsafe(method(layoutAnchorWithEdges:))]
#[unsafe(method_family = none)]
pub fn layoutAnchorWithEdges(
edges: NSDirectionalRectEdge,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(layoutAnchorWithEdges:absoluteOffset:))]
#[unsafe(method_family = none)]
pub fn layoutAnchorWithEdges_absoluteOffset(
edges: NSDirectionalRectEdge,
absolute_offset: CGPoint,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(layoutAnchorWithEdges:fractionalOffset:))]
#[unsafe(method_family = none)]
pub fn layoutAnchorWithEdges_fractionalOffset(
edges: NSDirectionalRectEdge,
fractional_offset: CGPoint,
mtm: MainThreadMarker,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
#[cfg(feature = "UIGeometry")]
#[unsafe(method(edges))]
#[unsafe(method_family = none)]
pub fn edges(&self) -> NSDirectionalRectEdge;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(offset))]
#[unsafe(method_family = none)]
pub fn offset(&self) -> CGPoint;
#[unsafe(method(isAbsoluteOffset))]
#[unsafe(method_family = none)]
pub fn isAbsoluteOffset(&self) -> bool;
#[unsafe(method(isFractionalOffset))]
#[unsafe(method_family = none)]
pub fn isFractionalOffset(&self) -> bool;
);
}
extern_protocol!(
pub unsafe trait NSCollectionLayoutContainer: NSObjectProtocol + MainThreadOnly {
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(contentSize))]
#[unsafe(method_family = none)]
fn contentSize(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(effectiveContentSize))]
#[unsafe(method_family = none)]
fn effectiveContentSize(&self) -> CGSize;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(contentInsets))]
#[unsafe(method_family = none)]
fn contentInsets(&self) -> NSDirectionalEdgeInsets;
#[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
#[unsafe(method(effectiveContentInsets))]
#[unsafe(method_family = none)]
fn effectiveContentInsets(&self) -> NSDirectionalEdgeInsets;
}
);
extern_protocol!(
pub unsafe trait NSCollectionLayoutEnvironment:
NSObjectProtocol + MainThreadOnly
{
#[unsafe(method(container))]
#[unsafe(method_family = none)]
fn container(&self) -> Retained<ProtocolObject<dyn NSCollectionLayoutContainer>>;
#[cfg(feature = "UITraitCollection")]
#[unsafe(method(traitCollection))]
#[unsafe(method_family = none)]
fn traitCollection(&self) -> Retained<UITraitCollection>;
}
);
extern_protocol!(
#[cfg(feature = "UIDynamicBehavior")]
pub unsafe trait NSCollectionLayoutVisibleItem:
NSObjectProtocol + UIDynamicItem + MainThreadOnly
{
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(alpha))]
#[unsafe(method_family = none)]
fn alpha(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setAlpha:))]
#[unsafe(method_family = none)]
fn setAlpha(&self, alpha: CGFloat);
#[unsafe(method(zIndex))]
#[unsafe(method_family = none)]
fn zIndex(&self) -> NSInteger;
#[unsafe(method(setZIndex:))]
#[unsafe(method_family = none)]
fn setZIndex(&self, z_index: NSInteger);
#[unsafe(method(isHidden))]
#[unsafe(method_family = none)]
fn isHidden(&self) -> bool;
#[unsafe(method(setHidden:))]
#[unsafe(method_family = none)]
fn setHidden(&self, hidden: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(center))]
#[unsafe(method_family = none)]
fn center(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setCenter:))]
#[unsafe(method_family = none)]
fn setCenter(&self, center: CGPoint);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(transform))]
#[unsafe(method_family = none)]
fn transform(&self) -> CGAffineTransform;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setTransform:))]
#[unsafe(method_family = none)]
fn setTransform(&self, transform: CGAffineTransform);
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
#[unsafe(method(transform3D))]
#[unsafe(method_family = none)]
fn transform3D(&self) -> CATransform3D;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
#[unsafe(method(setTransform3D:))]
#[unsafe(method_family = none)]
fn setTransform3D(&self, transform3_d: CATransform3D);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
fn name(&self) -> Retained<NSString>;
#[unsafe(method(indexPath))]
#[unsafe(method_family = none)]
fn indexPath(&self) -> Retained<NSIndexPath>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(frame))]
#[unsafe(method_family = none)]
fn frame(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(bounds))]
#[unsafe(method_family = none)]
fn bounds(&self) -> CGRect;
#[cfg(feature = "UICollectionViewLayout")]
#[unsafe(method(representedElementCategory))]
#[unsafe(method_family = none)]
fn representedElementCategory(&self) -> UICollectionElementCategory;
#[unsafe(method(representedElementKind))]
#[unsafe(method_family = none)]
fn representedElementKind(&self) -> Option<Retained<NSString>>;
}
);
impl NSCollectionLayoutSection {
extern_methods!(
#[deprecated]
#[unsafe(method(supplementariesFollowContentInsets))]
#[unsafe(method_family = none)]
pub fn supplementariesFollowContentInsets(&self) -> bool;
#[deprecated]
#[unsafe(method(setSupplementariesFollowContentInsets:))]
#[unsafe(method_family = none)]
pub fn setSupplementariesFollowContentInsets(
&self,
supplementaries_follow_content_insets: bool,
);
);
}
impl NSCollectionLayoutGroup {
extern_methods!(
#[deprecated]
#[unsafe(method(horizontalGroupWithLayoutSize:subitem:count:))]
#[unsafe(method_family = none)]
pub fn horizontalGroupWithLayoutSize_subitem_count(
layout_size: &NSCollectionLayoutSize,
subitem: &NSCollectionLayoutItem,
count: NSInteger,
) -> Retained<Self>;
#[deprecated]
#[unsafe(method(verticalGroupWithLayoutSize:subitem:count:))]
#[unsafe(method_family = none)]
pub fn verticalGroupWithLayoutSize_subitem_count(
layout_size: &NSCollectionLayoutSize,
subitem: &NSCollectionLayoutItem,
count: NSInteger,
) -> Retained<Self>;
);
}