objc2_app_kit/generated/
NSTableViewDiffableDataSource.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableviewdiffabledatasourcecellprovider?language=objc)
10#[cfg(all(
11    feature = "NSControl",
12    feature = "NSResponder",
13    feature = "NSTableColumn",
14    feature = "NSTableView",
15    feature = "NSView",
16    feature = "block2"
17))]
18pub type NSTableViewDiffableDataSourceCellProvider = *mut block2::Block<
19    dyn Fn(
20        NonNull<NSTableView>,
21        NonNull<NSTableColumn>,
22        NSInteger,
23        NonNull<AnyObject>,
24    ) -> NonNull<NSView>,
25>;
26
27/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableviewdiffabledatasourcerowprovider?language=objc)
28#[cfg(all(
29    feature = "NSControl",
30    feature = "NSResponder",
31    feature = "NSTableRowView",
32    feature = "NSTableView",
33    feature = "NSView",
34    feature = "block2"
35))]
36pub type NSTableViewDiffableDataSourceRowProvider = *mut block2::Block<
37    dyn Fn(NonNull<NSTableView>, NSInteger, NonNull<AnyObject>) -> NonNull<NSTableRowView>,
38>;
39
40/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableviewdiffabledatasourcesectionheaderviewprovider?language=objc)
41#[cfg(all(
42    feature = "NSControl",
43    feature = "NSResponder",
44    feature = "NSTableView",
45    feature = "NSView",
46    feature = "block2"
47))]
48pub type NSTableViewDiffableDataSourceSectionHeaderViewProvider = *mut block2::Block<
49    dyn Fn(NonNull<NSTableView>, NSInteger, NonNull<AnyObject>) -> NonNull<NSView>,
50>;
51
52extern_class!(
53    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstableviewdiffabledatasource?language=objc)
54    #[unsafe(super(NSObject))]
55    #[derive(Debug, PartialEq, Eq, Hash)]
56    pub struct NSTableViewDiffableDataSource<
57        SectionIdentifierType: ?Sized = AnyObject,
58        ItemIdentifierType: ?Sized = AnyObject,
59    >;
60);
61
62unsafe impl<SectionIdentifierType: ?Sized, ItemIdentifierType: ?Sized> NSObjectProtocol
63    for NSTableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>
64{
65}
66
67#[cfg(feature = "NSTableView")]
68unsafe impl<SectionIdentifierType: ?Sized, ItemIdentifierType: ?Sized> NSTableViewDataSource
69    for NSTableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>
70{
71}
72
73impl<SectionIdentifierType: Message, ItemIdentifierType: Message>
74    NSTableViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>
75{
76    extern_methods!(
77        #[cfg(all(
78            feature = "NSControl",
79            feature = "NSResponder",
80            feature = "NSTableColumn",
81            feature = "NSTableView",
82            feature = "NSView",
83            feature = "block2"
84        ))]
85        #[unsafe(method(initWithTableView:cellProvider:))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithTableView_cellProvider(
88            this: Allocated<Self>,
89            table_view: &NSTableView,
90            cell_provider: NSTableViewDiffableDataSourceCellProvider,
91        ) -> Retained<Self>;
92
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96
97        #[unsafe(method(new))]
98        #[unsafe(method_family = new)]
99        pub unsafe fn new() -> Retained<Self>;
100
101        #[cfg(feature = "NSDiffableDataSource")]
102        #[unsafe(method(snapshot))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn snapshot(
105            &self,
106        ) -> Retained<NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>>;
107
108        #[cfg(feature = "NSDiffableDataSource")]
109        #[unsafe(method(applySnapshot:animatingDifferences:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn applySnapshot_animatingDifferences(
112            &self,
113            snapshot: &NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>,
114            animating_differences: bool,
115        );
116
117        #[cfg(all(feature = "NSDiffableDataSource", feature = "block2"))]
118        #[unsafe(method(applySnapshot:animatingDifferences:completion:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn applySnapshot_animatingDifferences_completion(
121            &self,
122            snapshot: &NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>,
123            animating_differences: bool,
124            completion: Option<&block2::Block<dyn Fn()>>,
125        );
126
127        #[unsafe(method(itemIdentifierForRow:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn itemIdentifierForRow(
130            &self,
131            row: NSInteger,
132        ) -> Option<Retained<ItemIdentifierType>>;
133
134        #[unsafe(method(rowForItemIdentifier:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn rowForItemIdentifier(&self, identifier: &ItemIdentifierType) -> NSInteger;
137
138        #[unsafe(method(sectionIdentifierForRow:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn sectionIdentifierForRow(
141            &self,
142            row: NSInteger,
143        ) -> Option<Retained<SectionIdentifierType>>;
144
145        #[unsafe(method(rowForSectionIdentifier:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn rowForSectionIdentifier(
148            &self,
149            identifier: &SectionIdentifierType,
150        ) -> NSInteger;
151
152        #[cfg(all(
153            feature = "NSControl",
154            feature = "NSResponder",
155            feature = "NSTableRowView",
156            feature = "NSTableView",
157            feature = "NSView",
158            feature = "block2"
159        ))]
160        #[unsafe(method(rowViewProvider))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn rowViewProvider(
163            &self,
164            mtm: MainThreadMarker,
165        ) -> NSTableViewDiffableDataSourceRowProvider;
166
167        #[cfg(all(
168            feature = "NSControl",
169            feature = "NSResponder",
170            feature = "NSTableRowView",
171            feature = "NSTableView",
172            feature = "NSView",
173            feature = "block2"
174        ))]
175        /// Setter for [`rowViewProvider`][Self::rowViewProvider].
176        #[unsafe(method(setRowViewProvider:))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn setRowViewProvider(
179            &self,
180            row_view_provider: NSTableViewDiffableDataSourceRowProvider,
181        );
182
183        #[cfg(all(
184            feature = "NSControl",
185            feature = "NSResponder",
186            feature = "NSTableView",
187            feature = "NSView",
188            feature = "block2"
189        ))]
190        #[unsafe(method(sectionHeaderViewProvider))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn sectionHeaderViewProvider(
193            &self,
194            mtm: MainThreadMarker,
195        ) -> NSTableViewDiffableDataSourceSectionHeaderViewProvider;
196
197        #[cfg(all(
198            feature = "NSControl",
199            feature = "NSResponder",
200            feature = "NSTableView",
201            feature = "NSView",
202            feature = "block2"
203        ))]
204        /// Setter for [`sectionHeaderViewProvider`][Self::sectionHeaderViewProvider].
205        #[unsafe(method(setSectionHeaderViewProvider:))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn setSectionHeaderViewProvider(
208            &self,
209            section_header_view_provider: NSTableViewDiffableDataSourceSectionHeaderViewProvider,
210        );
211
212        #[cfg(feature = "NSTableView")]
213        #[unsafe(method(defaultRowAnimation))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn defaultRowAnimation(&self) -> NSTableViewAnimationOptions;
216
217        #[cfg(feature = "NSTableView")]
218        /// Setter for [`defaultRowAnimation`][Self::defaultRowAnimation].
219        #[unsafe(method(setDefaultRowAnimation:))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn setDefaultRowAnimation(
222            &self,
223            default_row_animation: NSTableViewAnimationOptions,
224        );
225    );
226}