//! 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<ObjectType: ?Sized = AnyObject>;
);

extern_conformance!(
    unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSOrderedCollectionChange<ObjectType> {}
);

impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
    extern_methods!(
        #[unsafe(method(changeWithObject:type:index:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeWithObject_type_index(
            an_object: Option<&ObjectType>,
            r#type: NSCollectionChangeType,
            index: NSUInteger,
        ) -> Retained<NSOrderedCollectionChange<ObjectType>>;

        #[unsafe(method(changeWithObject:type:index:associatedIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeWithObject_type_index_associatedIndex(
            an_object: Option<&ObjectType>,
            r#type: NSCollectionChangeType,
            index: NSUInteger,
            associated_index: NSUInteger,
        ) -> Retained<NSOrderedCollectionChange<ObjectType>>;

        #[unsafe(method(object))]
        #[unsafe(method_family = none)]
        pub unsafe fn object(&self) -> Option<Retained<ObjectType>>;

        #[unsafe(method(changeType))]
        #[unsafe(method_family = none)]
        pub unsafe fn changeType(&self) -> NSCollectionChangeType;

        #[unsafe(method(index))]
        #[unsafe(method_family = none)]
        pub unsafe fn index(&self) -> NSUInteger;

        #[unsafe(method(associatedIndex))]
        #[unsafe(method_family = none)]
        pub unsafe fn associatedIndex(&self) -> NSUInteger;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initWithObject:type:index:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithObject_type_index(
            this: Allocated<Self>,
            an_object: Option<&ObjectType>,
            r#type: NSCollectionChangeType,
            index: NSUInteger,
        ) -> Retained<Self>;

        #[unsafe(method(initWithObject:type:index:associatedIndex:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithObject_type_index_associatedIndex(
            this: Allocated<Self>,
            an_object: Option<&ObjectType>,
            r#type: NSCollectionChangeType,
            index: NSUInteger,
            associated_index: NSUInteger,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl<ObjectType: Message> NSOrderedCollectionChange<ObjectType> {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
