//! This file has been automatically generated by `objc2`'s `header-translator`. //! DO NOT EDIT use core::ptr::NonNull; use objc2::__framework_prelude::*; use crate::*; /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscollectionchangetype?language=objc) // NS_ENUM #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct NSCollectionChangeType(pub NSInteger); impl NSCollectionChangeType { #[doc(alias = "NSCollectionChangeInsert")] pub const Insert: Self = Self(0); #[doc(alias = "NSCollectionChangeRemove")] pub const Remove: Self = Self(1); } unsafe impl Encode for NSCollectionChangeType { const ENCODING: Encoding = NSInteger::ENCODING; } unsafe impl RefEncode for NSCollectionChangeType { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsorderedcollectionchange?language=objc) #[unsafe(super(NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] pub struct NSOrderedCollectionChange; ); impl NSOrderedCollectionChange { /// Unchecked conversion of the generic parameter. /// /// # Safety /// /// The generic must be valid to reinterpret as the given type. #[inline] pub unsafe fn cast_unchecked( &self, ) -> &NSOrderedCollectionChange { unsafe { &*((self as *const Self).cast()) } } } extern_conformance!( unsafe impl NSObjectProtocol for NSOrderedCollectionChange {} ); impl NSOrderedCollectionChange { extern_methods!( #[unsafe(method(changeWithObject:type:index:))] #[unsafe(method_family = none)] pub fn changeWithObject_type_index( an_object: Option<&ObjectType>, r#type: NSCollectionChangeType, index: NSUInteger, ) -> Retained>; #[unsafe(method(changeWithObject:type:index:associatedIndex:))] #[unsafe(method_family = none)] pub fn changeWithObject_type_index_associatedIndex( an_object: Option<&ObjectType>, r#type: NSCollectionChangeType, index: NSUInteger, associated_index: NSUInteger, ) -> Retained>; #[unsafe(method(object))] #[unsafe(method_family = none)] pub fn object(&self) -> Option>; #[unsafe(method(changeType))] #[unsafe(method_family = none)] pub fn changeType(&self) -> NSCollectionChangeType; #[unsafe(method(index))] #[unsafe(method_family = none)] pub fn index(&self) -> NSUInteger; #[unsafe(method(associatedIndex))] #[unsafe(method_family = none)] pub fn associatedIndex(&self) -> NSUInteger; #[unsafe(method(init))] #[unsafe(method_family = init)] pub unsafe fn init(this: Allocated) -> Retained; #[unsafe(method(initWithObject:type:index:))] #[unsafe(method_family = init)] pub fn initWithObject_type_index( this: Allocated, an_object: Option<&ObjectType>, r#type: NSCollectionChangeType, index: NSUInteger, ) -> Retained; #[unsafe(method(initWithObject:type:index:associatedIndex:))] #[unsafe(method_family = init)] pub fn initWithObject_type_index_associatedIndex( this: Allocated, an_object: Option<&ObjectType>, r#type: NSCollectionChangeType, index: NSUInteger, associated_index: NSUInteger, ) -> Retained; ); } /// Methods declared on superclass `NSObject`. impl NSOrderedCollectionChange { extern_methods!( #[unsafe(method(new))] #[unsafe(method_family = new)] pub unsafe fn new() -> Retained; ); }