objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionupdateaction?language=objc)
// NS_ENUM
#[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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicollectionviewupdateitem?language=objc)
    #[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;
    );
}

/// Methods declared on superclass `NSObject`.
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>;
    );
}