use crate::common::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSInteger)]
pub enum NSCollectionChangeType {
NSCollectionChangeInsert = 0,
NSCollectionChangeRemove = 1,
}
);
__inner_extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSOrderedCollectionChange")]
pub struct NSOrderedCollectionChange<ObjectType: ?Sized = AnyObject> {
__superclass: NSObject,
_inner0: PhantomData<*mut ObjectType>,
notunwindsafe: PhantomData<&'static mut ()>,
}
#[cfg(feature = "Foundation_NSOrderedCollectionChange")]
unsafe impl<ObjectType: ?Sized + Message> ClassType for NSOrderedCollectionChange<ObjectType> {
type Super = NSObject;
type Mutability = InteriorMutable;
fn as_super(&self) -> &Self::Super {
&self.__superclass
}
fn as_super_mut(&mut self) -> &mut Self::Super {
&mut self.__superclass
}
}
);
#[cfg(feature = "Foundation_NSOrderedCollectionChange")]
unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSOrderedCollectionChange<ObjectType> {}
extern_methods!(
#[cfg(feature = "Foundation_NSOrderedCollectionChange")]
unsafe impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
#[method_id(@__retain_semantics Other changeWithObject:type:index:)]
pub unsafe fn changeWithObject_type_index(
an_object: Option<&ObjectType>,
r#type: NSCollectionChangeType,
index: NSUInteger,
) -> Id<NSOrderedCollectionChange<ObjectType>>;
#[method_id(@__retain_semantics Other changeWithObject:type:index:associatedIndex:)]
pub unsafe fn changeWithObject_type_index_associatedIndex(
an_object: Option<&ObjectType>,
r#type: NSCollectionChangeType,
index: NSUInteger,
associated_index: NSUInteger,
) -> Id<NSOrderedCollectionChange<ObjectType>>;
#[method_id(@__retain_semantics Other object)]
pub unsafe fn object(&self) -> Option<Id<ObjectType>>;
#[method(changeType)]
pub unsafe fn changeType(&self) -> NSCollectionChangeType;
#[method(index)]
pub unsafe fn index(&self) -> NSUInteger;
#[method(associatedIndex)]
pub unsafe fn associatedIndex(&self) -> NSUInteger;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics Init initWithObject:type:index:)]
pub unsafe fn initWithObject_type_index(
this: Allocated<Self>,
an_object: Option<&ObjectType>,
r#type: NSCollectionChangeType,
index: NSUInteger,
) -> Id<Self>;
#[method_id(@__retain_semantics Init initWithObject:type:index:associatedIndex:)]
pub unsafe fn initWithObject_type_index_associatedIndex(
this: Allocated<Self>,
an_object: Option<&ObjectType>,
r#type: NSCollectionChangeType,
index: NSUInteger,
associated_index: NSUInteger,
) -> Id<Self>;
}
);
extern_methods!(
#[cfg(feature = "Foundation_NSOrderedCollectionChange")]
unsafe impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);