use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UICollectionUpdateAction(pub NSInteger);
impl UICollectionUpdateAction {
#[doc(alias = "UICollectionUpdateActionInsert")]
pub const Insert: Self = Self(0);
#[doc(alias = "UICollectionUpdateActionDelete")]
pub const Delete: Self = Self(1);
#[doc(alias = "UICollectionUpdateActionReload")]
pub const Reload: Self = Self(2);
#[doc(alias = "UICollectionUpdateActionMove")]
pub const Move: Self = Self(3);
#[doc(alias = "UICollectionUpdateActionNone")]
pub const None: Self = Self(4);
}
unsafe impl Encode for UICollectionUpdateAction {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UICollectionUpdateAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UICollectionViewUpdateItem;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UICollectionViewUpdateItem {}
);
impl UICollectionViewUpdateItem {
extern_methods!(
#[unsafe(method(indexPathBeforeUpdate))]
#[unsafe(method_family = none)]
pub fn indexPathBeforeUpdate(&self) -> Option<Retained<NSIndexPath>>;
#[unsafe(method(indexPathAfterUpdate))]
#[unsafe(method_family = none)]
pub fn indexPathAfterUpdate(&self) -> Option<Retained<NSIndexPath>>;
#[unsafe(method(updateAction))]
#[unsafe(method_family = none)]
pub fn updateAction(&self) -> UICollectionUpdateAction;
);
}
impl UICollectionViewUpdateItem {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}