objc2_ui_kit/generated/
NSDiffableDataSourceSectionSnapshot.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdiffabledatasourcesectionsnapshot?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSDiffableDataSourceSectionSnapshot<ItemIdentifierType: ?Sized = AnyObject>;
15);
16
17impl<ItemIdentifierType: ?Sized + Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
18    /// Unchecked conversion of the generic parameter.
19    ///
20    /// # Safety
21    ///
22    /// The generic must be valid to reinterpret as the given type.
23    #[inline]
24    pub unsafe fn cast_unchecked<NewItemIdentifierType: ?Sized + Message>(
25        &self,
26    ) -> &NSDiffableDataSourceSectionSnapshot<NewItemIdentifierType> {
27        unsafe { &*((self as *const Self).cast()) }
28    }
29}
30
31extern_conformance!(
32    unsafe impl<ItemIdentifierType: ?Sized> NSCopying
33        for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
34    {
35    }
36);
37
38unsafe impl<ItemIdentifierType: ?Sized + Message> CopyingHelper
39    for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
40{
41    type Result = Self;
42}
43
44extern_conformance!(
45    unsafe impl<ItemIdentifierType: ?Sized> NSObjectProtocol
46        for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
47    {
48    }
49);
50
51impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
52    extern_methods!(
53        #[unsafe(method(init))]
54        #[unsafe(method_family = init)]
55        pub fn init(this: Allocated<Self>) -> Retained<Self>;
56
57        #[unsafe(method(appendItems:))]
58        #[unsafe(method_family = none)]
59        pub fn appendItems(&self, items: &NSArray<ItemIdentifierType>);
60
61        #[unsafe(method(appendItems:intoParentItem:))]
62        #[unsafe(method_family = none)]
63        pub fn appendItems_intoParentItem(
64            &self,
65            items: &NSArray<ItemIdentifierType>,
66            parent_item: Option<&ItemIdentifierType>,
67        );
68
69        #[unsafe(method(insertItems:beforeItem:))]
70        #[unsafe(method_family = none)]
71        pub fn insertItems_beforeItem(
72            &self,
73            items: &NSArray<ItemIdentifierType>,
74            before_identifier: &ItemIdentifierType,
75        );
76
77        #[unsafe(method(insertItems:afterItem:))]
78        #[unsafe(method_family = none)]
79        pub fn insertItems_afterItem(
80            &self,
81            items: &NSArray<ItemIdentifierType>,
82            after_identifier: &ItemIdentifierType,
83        );
84
85        #[unsafe(method(deleteItems:))]
86        #[unsafe(method_family = none)]
87        pub fn deleteItems(&self, items: &NSArray<ItemIdentifierType>);
88
89        #[unsafe(method(deleteAllItems))]
90        #[unsafe(method_family = none)]
91        pub fn deleteAllItems(&self);
92
93        #[unsafe(method(expandItems:))]
94        #[unsafe(method_family = none)]
95        pub fn expandItems(&self, items: &NSArray<ItemIdentifierType>);
96
97        #[unsafe(method(collapseItems:))]
98        #[unsafe(method_family = none)]
99        pub fn collapseItems(&self, items: &NSArray<ItemIdentifierType>);
100
101        #[unsafe(method(replaceChildrenOfParentItem:withSnapshot:))]
102        #[unsafe(method_family = none)]
103        pub fn replaceChildrenOfParentItem_withSnapshot(
104            &self,
105            parent_item: &ItemIdentifierType,
106            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
107        );
108
109        #[unsafe(method(insertSnapshot:beforeItem:))]
110        #[unsafe(method_family = none)]
111        pub fn insertSnapshot_beforeItem(
112            &self,
113            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
114            item: &ItemIdentifierType,
115        );
116
117        #[unsafe(method(insertSnapshot:afterItem:))]
118        #[unsafe(method_family = none)]
119        pub fn insertSnapshot_afterItem(
120            &self,
121            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
122            item: &ItemIdentifierType,
123        ) -> Retained<ItemIdentifierType>;
124
125        #[unsafe(method(isExpanded:))]
126        #[unsafe(method_family = none)]
127        pub fn isExpanded(&self, item: &ItemIdentifierType) -> bool;
128
129        #[unsafe(method(isVisible:))]
130        #[unsafe(method_family = none)]
131        pub fn isVisible(&self, item: &ItemIdentifierType) -> bool;
132
133        #[unsafe(method(containsItem:))]
134        #[unsafe(method_family = none)]
135        pub fn containsItem(&self, item: &ItemIdentifierType) -> bool;
136
137        #[unsafe(method(levelOfItem:))]
138        #[unsafe(method_family = none)]
139        pub fn levelOfItem(&self, item: &ItemIdentifierType) -> NSInteger;
140
141        #[unsafe(method(indexOfItem:))]
142        #[unsafe(method_family = none)]
143        pub fn indexOfItem(&self, item: &ItemIdentifierType) -> NSInteger;
144
145        #[unsafe(method(expandedItems))]
146        #[unsafe(method_family = none)]
147        pub fn expandedItems(&self) -> Retained<NSArray<ItemIdentifierType>>;
148
149        #[unsafe(method(parentOfChildItem:))]
150        #[unsafe(method_family = none)]
151        pub fn parentOfChildItem(
152            &self,
153            child_item: &ItemIdentifierType,
154        ) -> Option<Retained<ItemIdentifierType>>;
155
156        #[unsafe(method(snapshotOfParentItem:))]
157        #[unsafe(method_family = none)]
158        pub fn snapshotOfParentItem(
159            &self,
160            parent_item: &ItemIdentifierType,
161        ) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;
162
163        #[unsafe(method(snapshotOfParentItem:includingParentItem:))]
164        #[unsafe(method_family = none)]
165        pub fn snapshotOfParentItem_includingParentItem(
166            &self,
167            parent_item: &ItemIdentifierType,
168            including_parent_item: bool,
169        ) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;
170
171        #[unsafe(method(rootItems))]
172        #[unsafe(method_family = none)]
173        pub fn rootItems(&self) -> Retained<NSArray<ItemIdentifierType>>;
174
175        #[unsafe(method(visibleItems))]
176        #[unsafe(method_family = none)]
177        pub fn visibleItems(&self) -> Retained<NSArray<ItemIdentifierType>>;
178
179        #[unsafe(method(visualDescription))]
180        #[unsafe(method_family = none)]
181        pub fn visualDescription(&self) -> Retained<NSString>;
182    );
183}
184
185/// Methods declared on superclass `NSObject`.
186impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
187    extern_methods!(
188        #[unsafe(method(new))]
189        #[unsafe(method_family = new)]
190        pub fn new() -> Retained<Self>;
191    );
192}
193
194impl<ItemIdentifierType: Message> DefaultRetained
195    for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
196{
197    #[inline]
198    fn default_retained() -> Retained<Self> {
199        Self::new()
200    }
201}