//! This file has been automatically generated by `objc2`'s `header-translator`. //! DO NOT EDIT use objc2::__framework_prelude::*; use objc2_foundation::*; use crate::*; // NS_ENUM #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct NSCollectionViewDropOperation(pub NSInteger); impl NSCollectionViewDropOperation { pub const NSCollectionViewDropOn: Self = Self(0); pub const NSCollectionViewDropBefore: Self = Self(1); } unsafe impl Encode for NSCollectionViewDropOperation { const ENCODING: Encoding = NSInteger::ENCODING; } unsafe impl RefEncode for NSCollectionViewDropOperation { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } // NS_ENUM #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct NSCollectionViewItemHighlightState(pub NSInteger); impl NSCollectionViewItemHighlightState { pub const NSCollectionViewItemHighlightNone: Self = Self(0); pub const NSCollectionViewItemHighlightForSelection: Self = Self(1); pub const NSCollectionViewItemHighlightForDeselection: Self = Self(2); pub const NSCollectionViewItemHighlightAsDropTarget: Self = Self(3); } unsafe impl Encode for NSCollectionViewItemHighlightState { const ENCODING: Encoding = NSInteger::ENCODING; } unsafe impl RefEncode for NSCollectionViewItemHighlightState { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } // NS_OPTIONS #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct NSCollectionViewScrollPosition(pub NSUInteger); bitflags::bitflags! { impl NSCollectionViewScrollPosition: NSUInteger { #[doc(alias = "NSCollectionViewScrollPositionNone")] const None = 0; #[doc(alias = "NSCollectionViewScrollPositionTop")] const Top = 1<<0; #[doc(alias = "NSCollectionViewScrollPositionCenteredVertically")] const CenteredVertically = 1<<1; #[doc(alias = "NSCollectionViewScrollPositionBottom")] const Bottom = 1<<2; #[doc(alias = "NSCollectionViewScrollPositionNearestHorizontalEdge")] const NearestHorizontalEdge = 1<<9; #[doc(alias = "NSCollectionViewScrollPositionLeft")] const Left = 1<<3; #[doc(alias = "NSCollectionViewScrollPositionCenteredHorizontally")] const CenteredHorizontally = 1<<4; #[doc(alias = "NSCollectionViewScrollPositionRight")] const Right = 1<<5; #[doc(alias = "NSCollectionViewScrollPositionLeadingEdge")] const LeadingEdge = 1<<6; #[doc(alias = "NSCollectionViewScrollPositionTrailingEdge")] const TrailingEdge = 1<<7; #[doc(alias = "NSCollectionViewScrollPositionNearestVerticalEdge")] const NearestVerticalEdge = 1<<8; } } unsafe impl Encode for NSCollectionViewScrollPosition { const ENCODING: Encoding = NSUInteger::ENCODING; } unsafe impl RefEncode for NSCollectionViewScrollPosition { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } pub type NSCollectionViewSupplementaryElementKind = NSString; extern_protocol!( #[cfg(feature = "NSUserInterfaceItemIdentification")] pub unsafe trait NSCollectionViewElement: NSObjectProtocol + NSUserInterfaceItemIdentification + IsMainThreadOnly { #[optional] #[method(prepareForReuse)] unsafe fn prepareForReuse(&self); #[cfg(feature = "NSCollectionViewLayout")] #[optional] #[method(applyLayoutAttributes:)] unsafe fn applyLayoutAttributes( &self, layout_attributes: &NSCollectionViewLayoutAttributes, ); #[cfg(feature = "NSCollectionViewLayout")] #[optional] #[method(willTransitionFromLayout:toLayout:)] unsafe fn willTransitionFromLayout_toLayout( &self, old_layout: &NSCollectionViewLayout, new_layout: &NSCollectionViewLayout, ); #[cfg(feature = "NSCollectionViewLayout")] #[optional] #[method(didTransitionFromLayout:toLayout:)] unsafe fn didTransitionFromLayout_toLayout( &self, old_layout: &NSCollectionViewLayout, new_layout: &NSCollectionViewLayout, ); #[cfg(feature = "NSCollectionViewLayout")] #[optional] #[method_id(@__retain_semantics Other preferredLayoutAttributesFittingAttributes:)] unsafe fn preferredLayoutAttributesFittingAttributes( &self, layout_attributes: &NSCollectionViewLayoutAttributes, ) -> Retained; } #[cfg(feature = "NSUserInterfaceItemIdentification")] unsafe impl ProtocolType for dyn NSCollectionViewElement {} ); extern_protocol!( #[cfg(feature = "NSUserInterfaceItemIdentification")] pub unsafe trait NSCollectionViewSectionHeaderView: NSCollectionViewElement + IsMainThreadOnly { #[cfg(all( feature = "NSButton", feature = "NSControl", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method_id(@__retain_semantics Other sectionCollapseButton)] unsafe fn sectionCollapseButton(&self) -> Option>; #[cfg(all( feature = "NSButton", feature = "NSControl", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method(setSectionCollapseButton:)] unsafe fn setSectionCollapseButton(&self, section_collapse_button: Option<&NSButton>); } #[cfg(feature = "NSUserInterfaceItemIdentification")] unsafe impl ProtocolType for dyn NSCollectionViewSectionHeaderView {} ); extern_class!( #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] pub struct NSCollectionViewItem; #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl ClassType for NSCollectionViewItem { #[inherits(NSResponder, NSObject)] type Super = NSViewController; type Mutability = MainThreadOnly; } ); #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSCoding for NSCollectionViewItem {} #[cfg(all( feature = "NSResponder", feature = "NSUserInterfaceItemIdentification", feature = "NSViewController" ))] unsafe impl NSCollectionViewElement for NSCollectionViewItem {} #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSCopying for NSCollectionViewItem {} #[cfg(all( feature = "NSKeyValueBinding", feature = "NSResponder", feature = "NSViewController" ))] unsafe impl NSEditor for NSCollectionViewItem {} #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSObjectProtocol for NSCollectionViewItem {} #[cfg(all( feature = "NSResponder", feature = "NSStoryboardSegue", feature = "NSViewController" ))] unsafe impl NSSeguePerforming for NSCollectionViewItem {} #[cfg(all( feature = "NSResponder", feature = "NSUserInterfaceItemIdentification", feature = "NSViewController" ))] unsafe impl NSUserInterfaceItemIdentification for NSCollectionViewItem {} extern_methods!( #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSCollectionViewItem { #[cfg(feature = "NSView")] #[method_id(@__retain_semantics Other collectionView)] pub unsafe fn collectionView(&self) -> Option>; #[method(isSelected)] pub unsafe fn isSelected(&self) -> bool; #[method(setSelected:)] pub unsafe fn setSelected(&self, selected: bool); #[method(highlightState)] pub unsafe fn highlightState(&self) -> NSCollectionViewItemHighlightState; #[method(setHighlightState:)] pub unsafe fn setHighlightState(&self, highlight_state: NSCollectionViewItemHighlightState); #[cfg(all(feature = "NSControl", feature = "NSImageView", feature = "NSView"))] #[method_id(@__retain_semantics Other imageView)] pub unsafe fn imageView(&self) -> Option>; #[cfg(all(feature = "NSControl", feature = "NSImageView", feature = "NSView"))] #[method(setImageView:)] pub unsafe fn setImageView(&self, image_view: Option<&NSImageView>); #[cfg(all(feature = "NSControl", feature = "NSTextField", feature = "NSView"))] #[method_id(@__retain_semantics Other textField)] pub unsafe fn textField(&self) -> Option>; #[cfg(all(feature = "NSControl", feature = "NSTextField", feature = "NSView"))] #[method(setTextField:)] pub unsafe fn setTextField(&self, text_field: Option<&NSTextField>); #[cfg(feature = "NSDraggingItem")] #[method_id(@__retain_semantics Other draggingImageComponents)] pub unsafe fn draggingImageComponents(&self) -> Retained>; } ); extern_methods!( /// Methods declared on superclass `NSViewController` #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSCollectionViewItem { #[cfg(feature = "NSNib")] #[method_id(@__retain_semantics Init initWithNibName:bundle:)] pub unsafe fn initWithNibName_bundle( this: Allocated, nib_name_or_nil: Option<&NSNibName>, nib_bundle_or_nil: Option<&NSBundle>, ) -> Retained; #[method_id(@__retain_semantics Init initWithCoder:)] pub unsafe fn initWithCoder( this: Allocated, coder: &NSCoder, ) -> Option>; } ); extern_methods!( /// Methods declared on superclass `NSResponder` #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSCollectionViewItem { #[method_id(@__retain_semantics Init init)] pub unsafe fn init(this: Allocated) -> Retained; } ); extern_methods!( /// Methods declared on superclass `NSObject` #[cfg(all(feature = "NSResponder", feature = "NSViewController"))] unsafe impl NSCollectionViewItem { #[method_id(@__retain_semantics New new)] pub unsafe fn new(mtm: MainThreadMarker) -> Retained; } ); extern_class!( #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(all(feature = "NSResponder", feature = "NSView"))] pub struct NSCollectionView; #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl ClassType for NSCollectionView { #[inherits(NSResponder, NSObject)] type Super = NSView; type Mutability = MainThreadOnly; } ); #[cfg(all( feature = "NSAccessibilityProtocols", feature = "NSResponder", feature = "NSView" ))] unsafe impl NSAccessibility for NSCollectionView {} #[cfg(all( feature = "NSAccessibilityProtocols", feature = "NSResponder", feature = "NSView" ))] unsafe impl NSAccessibilityElementProtocol for NSCollectionView {} #[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))] unsafe impl NSAnimatablePropertyContainer for NSCollectionView {} #[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))] unsafe impl NSAppearanceCustomization for NSCollectionView {} #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSCoding for NSCollectionView {} #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] unsafe impl NSDraggingDestination for NSCollectionView {} #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] unsafe impl NSDraggingSource for NSCollectionView {} #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSObjectProtocol for NSCollectionView {} #[cfg(all( feature = "NSResponder", feature = "NSUserInterfaceItemIdentification", feature = "NSView" ))] unsafe impl NSUserInterfaceItemIdentification for NSCollectionView {} extern_methods!( #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSCollectionView { #[method_id(@__retain_semantics Other dataSource)] pub unsafe fn dataSource( &self, ) -> Option>>; #[method(setDataSource:)] pub unsafe fn setDataSource( &self, data_source: Option<&ProtocolObject>, ); #[method_id(@__retain_semantics Other prefetchDataSource)] pub unsafe fn prefetchDataSource( &self, ) -> Option>>; #[method(setPrefetchDataSource:)] pub unsafe fn setPrefetchDataSource( &self, prefetch_data_source: Option<&ProtocolObject>, ); #[method_id(@__retain_semantics Other content)] pub unsafe fn content(&self) -> Retained>; #[method(setContent:)] pub unsafe fn setContent(&self, content: &NSArray); #[method(reloadData)] pub unsafe fn reloadData(&self); #[method_id(@__retain_semantics Other delegate)] pub unsafe fn delegate( &self, ) -> Option>>; #[method(setDelegate:)] pub unsafe fn setDelegate( &self, delegate: Option<&ProtocolObject>, ); #[method_id(@__retain_semantics Other backgroundView)] pub unsafe fn backgroundView(&self) -> Option>; #[method(setBackgroundView:)] pub unsafe fn setBackgroundView(&self, background_view: Option<&NSView>); #[method(backgroundViewScrollsWithContent)] pub unsafe fn backgroundViewScrollsWithContent(&self) -> bool; #[method(setBackgroundViewScrollsWithContent:)] pub unsafe fn setBackgroundViewScrollsWithContent( &self, background_view_scrolls_with_content: bool, ); #[cfg(feature = "NSCollectionViewLayout")] #[method_id(@__retain_semantics Other collectionViewLayout)] pub unsafe fn collectionViewLayout(&self) -> Option>; #[cfg(feature = "NSCollectionViewLayout")] #[method(setCollectionViewLayout:)] pub unsafe fn setCollectionViewLayout( &self, collection_view_layout: Option<&NSCollectionViewLayout>, ); #[cfg(feature = "NSCollectionViewLayout")] #[method_id(@__retain_semantics Other layoutAttributesForItemAtIndexPath:)] pub unsafe fn layoutAttributesForItemAtIndexPath( &self, index_path: &NSIndexPath, ) -> Option>; #[cfg(feature = "NSCollectionViewLayout")] #[method_id(@__retain_semantics Other layoutAttributesForSupplementaryElementOfKind:atIndexPath:)] pub unsafe fn layoutAttributesForSupplementaryElementOfKind_atIndexPath( &self, kind: &NSCollectionViewSupplementaryElementKind, index_path: &NSIndexPath, ) -> Option>; #[method(frameForItemAtIndex:)] pub unsafe fn frameForItemAtIndex(&self, index: NSUInteger) -> NSRect; #[method(frameForItemAtIndex:withNumberOfItems:)] pub unsafe fn frameForItemAtIndex_withNumberOfItems( &self, index: NSUInteger, number_of_items: NSUInteger, ) -> NSRect; #[cfg(feature = "NSColor")] #[method_id(@__retain_semantics Other backgroundColors)] pub unsafe fn backgroundColors(&self) -> Retained>; #[cfg(feature = "NSColor")] #[method(setBackgroundColors:)] pub unsafe fn setBackgroundColors(&self, background_colors: Option<&NSArray>); #[method(numberOfSections)] pub unsafe fn numberOfSections(&self) -> NSInteger; #[method(numberOfItemsInSection:)] pub unsafe fn numberOfItemsInSection(&self, section: NSInteger) -> NSInteger; #[method(isFirstResponder)] pub unsafe fn isFirstResponder(&self) -> bool; #[method(isSelectable)] pub unsafe fn isSelectable(&self) -> bool; #[method(setSelectable:)] pub unsafe fn setSelectable(&self, selectable: bool); #[method(allowsEmptySelection)] pub unsafe fn allowsEmptySelection(&self) -> bool; #[method(setAllowsEmptySelection:)] pub unsafe fn setAllowsEmptySelection(&self, allows_empty_selection: bool); #[method(allowsMultipleSelection)] pub unsafe fn allowsMultipleSelection(&self) -> bool; #[method(setAllowsMultipleSelection:)] pub unsafe fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool); #[method_id(@__retain_semantics Other selectionIndexes)] pub unsafe fn selectionIndexes(&self) -> Retained; #[method(setSelectionIndexes:)] pub unsafe fn setSelectionIndexes(&self, selection_indexes: &NSIndexSet); #[method_id(@__retain_semantics Other selectionIndexPaths)] pub unsafe fn selectionIndexPaths(&self) -> Retained>; #[method(setSelectionIndexPaths:)] pub unsafe fn setSelectionIndexPaths(&self, selection_index_paths: &NSSet); #[method(selectItemsAtIndexPaths:scrollPosition:)] pub unsafe fn selectItemsAtIndexPaths_scrollPosition( &self, index_paths: &NSSet, scroll_position: NSCollectionViewScrollPosition, ); #[method(deselectItemsAtIndexPaths:)] pub unsafe fn deselectItemsAtIndexPaths(&self, index_paths: &NSSet); #[method(selectAll:)] pub unsafe fn selectAll(&self, sender: Option<&AnyObject>); #[method(deselectAll:)] pub unsafe fn deselectAll(&self, sender: Option<&AnyObject>); #[cfg(feature = "NSUserInterfaceItemIdentification")] #[method(registerClass:forItemWithIdentifier:)] pub unsafe fn registerClass_forItemWithIdentifier( &self, item_class: Option<&AnyClass>, identifier: &NSUserInterfaceItemIdentifier, ); #[cfg(all(feature = "NSNib", feature = "NSUserInterfaceItemIdentification"))] #[method(registerNib:forItemWithIdentifier:)] pub unsafe fn registerNib_forItemWithIdentifier( &self, nib: Option<&NSNib>, identifier: &NSUserInterfaceItemIdentifier, ); #[cfg(feature = "NSUserInterfaceItemIdentification")] #[method(registerClass:forSupplementaryViewOfKind:withIdentifier:)] pub unsafe fn registerClass_forSupplementaryViewOfKind_withIdentifier( &self, view_class: Option<&AnyClass>, kind: &NSCollectionViewSupplementaryElementKind, identifier: &NSUserInterfaceItemIdentifier, ); #[cfg(all(feature = "NSNib", feature = "NSUserInterfaceItemIdentification"))] #[method(registerNib:forSupplementaryViewOfKind:withIdentifier:)] pub unsafe fn registerNib_forSupplementaryViewOfKind_withIdentifier( &self, nib: Option<&NSNib>, kind: &NSCollectionViewSupplementaryElementKind, identifier: &NSUserInterfaceItemIdentifier, ); #[cfg(all( feature = "NSUserInterfaceItemIdentification", feature = "NSViewController" ))] #[method_id(@__retain_semantics Other makeItemWithIdentifier:forIndexPath:)] pub unsafe fn makeItemWithIdentifier_forIndexPath( &self, identifier: &NSUserInterfaceItemIdentifier, index_path: &NSIndexPath, ) -> Retained; #[cfg(feature = "NSUserInterfaceItemIdentification")] #[method_id(@__retain_semantics Other makeSupplementaryViewOfKind:withIdentifier:forIndexPath:)] pub unsafe fn makeSupplementaryViewOfKind_withIdentifier_forIndexPath( &self, element_kind: &NSCollectionViewSupplementaryElementKind, identifier: &NSUserInterfaceItemIdentifier, index_path: &NSIndexPath, ) -> Retained; #[cfg(feature = "NSViewController")] #[method_id(@__retain_semantics Other itemAtIndex:)] pub unsafe fn itemAtIndex( &self, index: NSUInteger, ) -> Option>; #[cfg(feature = "NSViewController")] #[method_id(@__retain_semantics Other itemAtIndexPath:)] pub unsafe fn itemAtIndexPath( &self, index_path: &NSIndexPath, ) -> Option>; #[cfg(feature = "NSViewController")] #[method_id(@__retain_semantics Other visibleItems)] pub unsafe fn visibleItems(&self) -> Retained>; #[method_id(@__retain_semantics Other indexPathsForVisibleItems)] pub unsafe fn indexPathsForVisibleItems(&self) -> Retained>; #[cfg(feature = "NSViewController")] #[method_id(@__retain_semantics Other indexPathForItem:)] pub unsafe fn indexPathForItem( &self, item: &NSCollectionViewItem, ) -> Option>; #[method_id(@__retain_semantics Other indexPathForItemAtPoint:)] pub unsafe fn indexPathForItemAtPoint( &self, point: NSPoint, ) -> Option>; #[cfg(feature = "NSUserInterfaceItemIdentification")] #[method_id(@__retain_semantics Other supplementaryViewForElementKind:atIndexPath:)] pub unsafe fn supplementaryViewForElementKind_atIndexPath( &self, element_kind: &NSCollectionViewSupplementaryElementKind, index_path: &NSIndexPath, ) -> Option>; #[cfg(feature = "NSUserInterfaceItemIdentification")] #[method_id(@__retain_semantics Other visibleSupplementaryViewsOfKind:)] pub unsafe fn visibleSupplementaryViewsOfKind( &self, element_kind: &NSCollectionViewSupplementaryElementKind, ) -> Retained>; #[method_id(@__retain_semantics Other indexPathsForVisibleSupplementaryElementsOfKind:)] pub unsafe fn indexPathsForVisibleSupplementaryElementsOfKind( &self, element_kind: &NSCollectionViewSupplementaryElementKind, ) -> Retained>; #[method(insertSections:)] pub unsafe fn insertSections(&self, sections: &NSIndexSet); #[method(deleteSections:)] pub unsafe fn deleteSections(&self, sections: &NSIndexSet); #[method(reloadSections:)] pub unsafe fn reloadSections(&self, sections: &NSIndexSet); #[method(moveSection:toSection:)] pub unsafe fn moveSection_toSection(&self, section: NSInteger, new_section: NSInteger); #[method(insertItemsAtIndexPaths:)] pub unsafe fn insertItemsAtIndexPaths(&self, index_paths: &NSSet); #[method(deleteItemsAtIndexPaths:)] pub unsafe fn deleteItemsAtIndexPaths(&self, index_paths: &NSSet); #[method(reloadItemsAtIndexPaths:)] pub unsafe fn reloadItemsAtIndexPaths(&self, index_paths: &NSSet); #[method(moveItemAtIndexPath:toIndexPath:)] pub unsafe fn moveItemAtIndexPath_toIndexPath( &self, index_path: &NSIndexPath, new_index_path: &NSIndexPath, ); #[cfg(feature = "block2")] #[method(performBatchUpdates:completionHandler:)] pub unsafe fn performBatchUpdates_completionHandler( &self, updates: Option<&block2::Block>, completion_handler: Option<&block2::Block>, ); #[method(toggleSectionCollapse:)] pub unsafe fn toggleSectionCollapse(&self, sender: &AnyObject); #[method(scrollToItemsAtIndexPaths:scrollPosition:)] pub unsafe fn scrollToItemsAtIndexPaths_scrollPosition( &self, index_paths: &NSSet, scroll_position: NSCollectionViewScrollPosition, ); #[cfg(feature = "NSDragging")] #[method(setDraggingSourceOperationMask:forLocal:)] pub unsafe fn setDraggingSourceOperationMask_forLocal( &self, drag_operation_mask: NSDragOperation, local_destination: bool, ); #[cfg(all(feature = "NSEvent", feature = "NSImage"))] #[method_id(@__retain_semantics Other draggingImageForItemsAtIndexPaths:withEvent:offset:)] pub unsafe fn draggingImageForItemsAtIndexPaths_withEvent_offset( &self, index_paths: &NSSet, event: &NSEvent, drag_image_offset: NSPointPointer, ) -> Retained; #[cfg(all(feature = "NSEvent", feature = "NSImage"))] #[method_id(@__retain_semantics Other draggingImageForItemsAtIndexes:withEvent:offset:)] pub unsafe fn draggingImageForItemsAtIndexes_withEvent_offset( &self, indexes: &NSIndexSet, event: &NSEvent, drag_image_offset: NSPointPointer, ) -> Retained; } ); extern_methods!( /// Methods declared on superclass `NSView` #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSCollectionView { #[method_id(@__retain_semantics Init initWithFrame:)] pub unsafe fn initWithFrame(this: Allocated, frame_rect: NSRect) -> Retained; #[method_id(@__retain_semantics Init initWithCoder:)] pub unsafe fn initWithCoder( this: Allocated, coder: &NSCoder, ) -> Option>; } ); extern_methods!( /// Methods declared on superclass `NSResponder` #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSCollectionView { #[method_id(@__retain_semantics Init init)] pub unsafe fn init(this: Allocated) -> Retained; } ); extern_methods!( /// Methods declared on superclass `NSObject` #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSCollectionView { #[method_id(@__retain_semantics New new)] pub unsafe fn new(mtm: MainThreadMarker) -> Retained; } ); extern_protocol!( pub unsafe trait NSCollectionViewDataSource: NSObjectProtocol + IsMainThreadOnly { #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[method(collectionView:numberOfItemsInSection:)] unsafe fn collectionView_numberOfItemsInSection( &self, collection_view: &NSCollectionView, section: NSInteger, ) -> NSInteger; #[cfg(all( feature = "NSResponder", feature = "NSView", feature = "NSViewController" ))] #[method_id(@__retain_semantics Other collectionView:itemForRepresentedObjectAtIndexPath:)] unsafe fn collectionView_itemForRepresentedObjectAtIndexPath( &self, collection_view: &NSCollectionView, index_path: &NSIndexPath, ) -> Retained; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(numberOfSectionsInCollectionView:)] unsafe fn numberOfSectionsInCollectionView( &self, collection_view: &NSCollectionView, ) -> NSInteger; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method_id(@__retain_semantics Other collectionView:viewForSupplementaryElementOfKind:atIndexPath:)] unsafe fn collectionView_viewForSupplementaryElementOfKind_atIndexPath( &self, collection_view: &NSCollectionView, kind: &NSCollectionViewSupplementaryElementKind, index_path: &NSIndexPath, ) -> Retained; } unsafe impl ProtocolType for dyn NSCollectionViewDataSource {} ); extern_protocol!( pub unsafe trait NSCollectionViewPrefetching: NSObjectProtocol + IsMainThreadOnly { #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[method(collectionView:prefetchItemsAtIndexPaths:)] unsafe fn collectionView_prefetchItemsAtIndexPaths( &self, collection_view: &NSCollectionView, index_paths: &NSArray, ); #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:cancelPrefetchingForItemsAtIndexPaths:)] unsafe fn collectionView_cancelPrefetchingForItemsAtIndexPaths( &self, collection_view: &NSCollectionView, index_paths: &NSArray, ); } unsafe impl ProtocolType for dyn NSCollectionViewPrefetching {} ); extern_protocol!( pub unsafe trait NSCollectionViewDelegate: NSObjectProtocol { #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:canDragItemsAtIndexPaths:withEvent:)] unsafe fn collectionView_canDragItemsAtIndexPaths_withEvent( &self, collection_view: &NSCollectionView, index_paths: &NSSet, event: &NSEvent, ) -> bool; #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:canDragItemsAtIndexes:withEvent:)] unsafe fn collectionView_canDragItemsAtIndexes_withEvent( &self, collection_view: &NSCollectionView, indexes: &NSIndexSet, event: &NSEvent, ) -> bool; #[cfg(all(feature = "NSPasteboard", feature = "NSResponder", feature = "NSView"))] #[deprecated = "Use -collectionView:pasteboardWriterForItemAtIndexPath: instead"] #[optional] #[method(collectionView:writeItemsAtIndexPaths:toPasteboard:)] unsafe fn collectionView_writeItemsAtIndexPaths_toPasteboard( &self, collection_view: &NSCollectionView, index_paths: &NSSet, pasteboard: &NSPasteboard, ) -> bool; #[cfg(all(feature = "NSPasteboard", feature = "NSResponder", feature = "NSView"))] #[deprecated = "Use -collectionView:pasteboardWriterForItemAtIndexPath: instead"] #[optional] #[method(collectionView:writeItemsAtIndexes:toPasteboard:)] unsafe fn collectionView_writeItemsAtIndexes_toPasteboard( &self, collection_view: &NSCollectionView, indexes: &NSIndexSet, pasteboard: &NSPasteboard, ) -> bool; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[deprecated = "Use NSFilePromiseReceiver objects instead"] #[optional] #[method_id(@__retain_semantics Other collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexPaths:)] unsafe fn collectionView_namesOfPromisedFilesDroppedAtDestination_forDraggedItemsAtIndexPaths( &self, collection_view: &NSCollectionView, drop_url: &NSURL, index_paths: &NSSet, ) -> Retained>; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[deprecated = "Use NSFilePromiseReceiver objects instead"] #[optional] #[method_id(@__retain_semantics Other collectionView:namesOfPromisedFilesDroppedAtDestination:forDraggedItemsAtIndexes:)] unsafe fn collectionView_namesOfPromisedFilesDroppedAtDestination_forDraggedItemsAtIndexes( &self, collection_view: &NSCollectionView, drop_url: &NSURL, indexes: &NSIndexSet, ) -> Retained>; #[cfg(all( feature = "NSEvent", feature = "NSImage", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method_id(@__retain_semantics Other collectionView:draggingImageForItemsAtIndexPaths:withEvent:offset:)] unsafe fn collectionView_draggingImageForItemsAtIndexPaths_withEvent_offset( &self, collection_view: &NSCollectionView, index_paths: &NSSet, event: &NSEvent, drag_image_offset: NSPointPointer, ) -> Retained; #[cfg(all( feature = "NSEvent", feature = "NSImage", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method_id(@__retain_semantics Other collectionView:draggingImageForItemsAtIndexes:withEvent:offset:)] unsafe fn collectionView_draggingImageForItemsAtIndexes_withEvent_offset( &self, collection_view: &NSCollectionView, indexes: &NSIndexSet, event: &NSEvent, drag_image_offset: NSPointPointer, ) -> Retained; #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:validateDrop:proposedIndexPath:dropOperation:)] unsafe fn collectionView_validateDrop_proposedIndexPath_dropOperation( &self, collection_view: &NSCollectionView, dragging_info: &ProtocolObject, proposed_drop_index_path: &mut Retained, proposed_drop_operation: NonNull, ) -> NSDragOperation; #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:validateDrop:proposedIndex:dropOperation:)] unsafe fn collectionView_validateDrop_proposedIndex_dropOperation( &self, collection_view: &NSCollectionView, dragging_info: &ProtocolObject, proposed_drop_index: NonNull, proposed_drop_operation: NonNull, ) -> NSDragOperation; #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:acceptDrop:indexPath:dropOperation:)] unsafe fn collectionView_acceptDrop_indexPath_dropOperation( &self, collection_view: &NSCollectionView, dragging_info: &ProtocolObject, index_path: &NSIndexPath, drop_operation: NSCollectionViewDropOperation, ) -> bool; #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:acceptDrop:index:dropOperation:)] unsafe fn collectionView_acceptDrop_index_dropOperation( &self, collection_view: &NSCollectionView, dragging_info: &ProtocolObject, index: NSInteger, drop_operation: NSCollectionViewDropOperation, ) -> bool; #[cfg(all(feature = "NSPasteboard", feature = "NSResponder", feature = "NSView"))] #[optional] #[method_id(@__retain_semantics Other collectionView:pasteboardWriterForItemAtIndexPath:)] unsafe fn collectionView_pasteboardWriterForItemAtIndexPath( &self, collection_view: &NSCollectionView, index_path: &NSIndexPath, ) -> Option>>; #[cfg(all(feature = "NSPasteboard", feature = "NSResponder", feature = "NSView"))] #[optional] #[method_id(@__retain_semantics Other collectionView:pasteboardWriterForItemAtIndex:)] unsafe fn collectionView_pasteboardWriterForItemAtIndex( &self, collection_view: &NSCollectionView, index: NSUInteger, ) -> Option>>; #[cfg(all( feature = "NSDraggingSession", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method(collectionView:draggingSession:willBeginAtPoint:forItemsAtIndexPaths:)] unsafe fn collectionView_draggingSession_willBeginAtPoint_forItemsAtIndexPaths( &self, collection_view: &NSCollectionView, session: &NSDraggingSession, screen_point: NSPoint, index_paths: &NSSet, ); #[cfg(all( feature = "NSDraggingSession", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method(collectionView:draggingSession:willBeginAtPoint:forItemsAtIndexes:)] unsafe fn collectionView_draggingSession_willBeginAtPoint_forItemsAtIndexes( &self, collection_view: &NSCollectionView, session: &NSDraggingSession, screen_point: NSPoint, indexes: &NSIndexSet, ); #[cfg(all( feature = "NSDragging", feature = "NSDraggingSession", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method(collectionView:draggingSession:endedAtPoint:dragOperation:)] unsafe fn collectionView_draggingSession_endedAtPoint_dragOperation( &self, collection_view: &NSCollectionView, session: &NSDraggingSession, screen_point: NSPoint, operation: NSDragOperation, ); #[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:updateDraggingItemsForDrag:)] unsafe fn collectionView_updateDraggingItemsForDrag( &self, collection_view: &NSCollectionView, dragging_info: &ProtocolObject, ); #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method_id(@__retain_semantics Other collectionView:shouldChangeItemsAtIndexPaths:toHighlightState:)] unsafe fn collectionView_shouldChangeItemsAtIndexPaths_toHighlightState( &self, collection_view: &NSCollectionView, index_paths: &NSSet, highlight_state: NSCollectionViewItemHighlightState, ) -> Retained>; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:didChangeItemsAtIndexPaths:toHighlightState:)] unsafe fn collectionView_didChangeItemsAtIndexPaths_toHighlightState( &self, collection_view: &NSCollectionView, index_paths: &NSSet, highlight_state: NSCollectionViewItemHighlightState, ); #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method_id(@__retain_semantics Other collectionView:shouldSelectItemsAtIndexPaths:)] unsafe fn collectionView_shouldSelectItemsAtIndexPaths( &self, collection_view: &NSCollectionView, index_paths: &NSSet, ) -> Retained>; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method_id(@__retain_semantics Other collectionView:shouldDeselectItemsAtIndexPaths:)] unsafe fn collectionView_shouldDeselectItemsAtIndexPaths( &self, collection_view: &NSCollectionView, index_paths: &NSSet, ) -> Retained>; #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:didSelectItemsAtIndexPaths:)] unsafe fn collectionView_didSelectItemsAtIndexPaths( &self, collection_view: &NSCollectionView, index_paths: &NSSet, ); #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:didDeselectItemsAtIndexPaths:)] unsafe fn collectionView_didDeselectItemsAtIndexPaths( &self, collection_view: &NSCollectionView, index_paths: &NSSet, ); #[cfg(all( feature = "NSResponder", feature = "NSView", feature = "NSViewController" ))] #[optional] #[method(collectionView:willDisplayItem:forRepresentedObjectAtIndexPath:)] unsafe fn collectionView_willDisplayItem_forRepresentedObjectAtIndexPath( &self, collection_view: &NSCollectionView, item: &NSCollectionViewItem, index_path: &NSIndexPath, ); #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:willDisplaySupplementaryView:forElementKind:atIndexPath:)] unsafe fn collectionView_willDisplaySupplementaryView_forElementKind_atIndexPath( &self, collection_view: &NSCollectionView, view: &NSView, element_kind: &NSCollectionViewSupplementaryElementKind, index_path: &NSIndexPath, ); #[cfg(all( feature = "NSResponder", feature = "NSView", feature = "NSViewController" ))] #[optional] #[method(collectionView:didEndDisplayingItem:forRepresentedObjectAtIndexPath:)] unsafe fn collectionView_didEndDisplayingItem_forRepresentedObjectAtIndexPath( &self, collection_view: &NSCollectionView, item: &NSCollectionViewItem, index_path: &NSIndexPath, ); #[cfg(all(feature = "NSResponder", feature = "NSView"))] #[optional] #[method(collectionView:didEndDisplayingSupplementaryView:forElementOfKind:atIndexPath:)] unsafe fn collectionView_didEndDisplayingSupplementaryView_forElementOfKind_atIndexPath( &self, collection_view: &NSCollectionView, view: &NSView, element_kind: &NSCollectionViewSupplementaryElementKind, index_path: &NSIndexPath, ); #[cfg(all( feature = "NSCollectionViewLayout", feature = "NSCollectionViewTransitionLayout", feature = "NSResponder", feature = "NSView" ))] #[optional] #[method_id(@__retain_semantics Other collectionView:transitionLayoutForOldLayout:newLayout:)] unsafe fn collectionView_transitionLayoutForOldLayout_newLayout( &self, collection_view: &NSCollectionView, from_layout: &NSCollectionViewLayout, to_layout: &NSCollectionViewLayout, ) -> Retained; } unsafe impl ProtocolType for dyn NSCollectionViewDelegate {} ); extern_category!( /// Category "NSCollectionViewAdditions" on [`NSIndexPath`]. #[doc(alias = "NSCollectionViewAdditions")] pub unsafe trait NSIndexPathNSCollectionViewAdditions { #[method_id(@__retain_semantics Other indexPathForItem:inSection:)] unsafe fn indexPathForItem_inSection( item: NSInteger, section: NSInteger, ) -> Retained; #[method(item)] unsafe fn item(&self) -> NSInteger; #[method(section)] unsafe fn section(&self) -> NSInteger; } unsafe impl NSIndexPathNSCollectionViewAdditions for NSIndexPath {} ); extern_category!( /// Category "NSCollectionViewAdditions" on [`NSSet`]. #[doc(alias = "NSCollectionViewAdditions")] pub unsafe trait NSSetNSCollectionViewAdditions { #[method_id(@__retain_semantics Other setWithCollectionViewIndexPath:)] unsafe fn setWithCollectionViewIndexPath(index_path: &NSIndexPath) -> Retained; #[method_id(@__retain_semantics Other setWithCollectionViewIndexPaths:)] unsafe fn setWithCollectionViewIndexPaths( index_paths: &NSArray, ) -> Retained; #[cfg(feature = "block2")] #[method(enumerateIndexPathsWithOptions:usingBlock:)] unsafe fn enumerateIndexPathsWithOptions_usingBlock( &self, opts: NSEnumerationOptions, block: &block2::Block, NonNull) + '_>, ); } unsafe impl NSSetNSCollectionViewAdditions for NSSet {} ); extern_methods!( /// NSDeprecated #[cfg(all(feature = "NSResponder", feature = "NSView"))] unsafe impl NSCollectionView { #[cfg(feature = "NSViewController")] #[deprecated = "Use -[NSCollectionViewDataSource collectionView:itemForRepresentedObjectAtIndexPath:] instead"] #[method_id(@__retain_semantics New newItemForRepresentedObject:)] pub unsafe fn newItemForRepresentedObject( &self, object: &AnyObject, ) -> Retained; #[cfg(feature = "NSViewController")] #[deprecated = "Use -registerNib:forItemWithIdentifier: or -registerClass:forItemWithIdentifier: instead."] #[method_id(@__retain_semantics Other itemPrototype)] pub unsafe fn itemPrototype(&self) -> Option>; #[cfg(feature = "NSViewController")] #[deprecated = "Use -registerNib:forItemWithIdentifier: or -registerClass:forItemWithIdentifier: instead."] #[method(setItemPrototype:)] pub unsafe fn setItemPrototype(&self, item_prototype: Option<&NSCollectionViewItem>); #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfRows instead"] #[method(maxNumberOfRows)] pub unsafe fn maxNumberOfRows(&self) -> NSUInteger; #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfRows instead"] #[method(setMaxNumberOfRows:)] pub unsafe fn setMaxNumberOfRows(&self, max_number_of_rows: NSUInteger); #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfColumns instead"] #[method(maxNumberOfColumns)] pub unsafe fn maxNumberOfColumns(&self) -> NSUInteger; #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumNumberOfColumns instead"] #[method(setMaxNumberOfColumns:)] pub unsafe fn setMaxNumberOfColumns(&self, max_number_of_columns: NSUInteger); #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its minimumItemSize instead"] #[method(minItemSize)] pub unsafe fn minItemSize(&self) -> NSSize; #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its minimumItemSize instead"] #[method(setMinItemSize:)] pub unsafe fn setMinItemSize(&self, min_item_size: NSSize); #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumItemSize instead"] #[method(maxItemSize)] pub unsafe fn maxItemSize(&self) -> NSSize; #[deprecated = "Use NSCollectionViewGridLayout as the receiver's collectionViewLayout, setting its maximumItemSize instead"] #[method(setMaxItemSize:)] pub unsafe fn setMaxItemSize(&self, max_item_size: NSSize); } );