objc2_ui_kit/generated/
UICollectionViewUpdateItem.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionupdateaction?language=objc)
10// NS_ENUM
11#[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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionviewupdateitem?language=objc)
37    #[unsafe(super(NSObject))]
38    #[thread_kind = MainThreadOnly]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    pub struct UICollectionViewUpdateItem;
41);
42
43extern_conformance!(
44    unsafe impl NSObjectProtocol for UICollectionViewUpdateItem {}
45);
46
47impl UICollectionViewUpdateItem {
48    extern_methods!(
49        #[unsafe(method(indexPathBeforeUpdate))]
50        #[unsafe(method_family = none)]
51        pub fn indexPathBeforeUpdate(&self) -> Option<Retained<NSIndexPath>>;
52
53        #[unsafe(method(indexPathAfterUpdate))]
54        #[unsafe(method_family = none)]
55        pub fn indexPathAfterUpdate(&self) -> Option<Retained<NSIndexPath>>;
56
57        #[unsafe(method(updateAction))]
58        #[unsafe(method_family = none)]
59        pub fn updateAction(&self) -> UICollectionUpdateAction;
60    );
61}
62
63/// Methods declared on superclass `NSObject`.
64impl UICollectionViewUpdateItem {
65    extern_methods!(
66        #[unsafe(method(init))]
67        #[unsafe(method_family = init)]
68        pub fn init(this: Allocated<Self>) -> Retained<Self>;
69
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
73    );
74}