objc2_ui_kit/generated/
UICollectionViewUpdateItem.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct UICollectionUpdateAction(pub NSInteger);
14impl UICollectionUpdateAction {
15 #[doc(alias = "UICollectionUpdateActionInsert")]
16 pub const Insert: Self = Self(0);
17 #[doc(alias = "UICollectionUpdateActionDelete")]
18 pub const Delete: Self = Self(1);
19 #[doc(alias = "UICollectionUpdateActionReload")]
20 pub const Reload: Self = Self(2);
21 #[doc(alias = "UICollectionUpdateActionMove")]
22 pub const Move: Self = Self(3);
23 #[doc(alias = "UICollectionUpdateActionNone")]
24 pub const None: Self = Self(4);
25}
26
27unsafe impl Encode for UICollectionUpdateAction {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UICollectionUpdateAction {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36 #[unsafe(super(NSObject))]
38 #[thread_kind = MainThreadOnly]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 pub struct UICollectionViewUpdateItem;
41);
42
43unsafe impl NSObjectProtocol for UICollectionViewUpdateItem {}
44
45impl UICollectionViewUpdateItem {
46 extern_methods!(
47 #[unsafe(method(indexPathBeforeUpdate))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn indexPathBeforeUpdate(&self) -> Option<Retained<NSIndexPath>>;
50
51 #[unsafe(method(indexPathAfterUpdate))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn indexPathAfterUpdate(&self) -> Option<Retained<NSIndexPath>>;
54
55 #[unsafe(method(updateAction))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn updateAction(&self) -> UICollectionUpdateAction;
58 );
59}
60
61impl UICollectionViewUpdateItem {
63 extern_methods!(
64 #[unsafe(method(init))]
65 #[unsafe(method_family = init)]
66 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68 #[unsafe(method(new))]
69 #[unsafe(method_family = new)]
70 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
71 );
72}