//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

__inner_extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSDiffableDataSourceSectionSnapshot<ItemIdentifierType: ?Sized = AnyObject> {
        __superclass: NSObject,
        _inner0: PhantomData<*mut ItemIdentifierType>,
        notunwindsafe: PhantomData<&'static mut ()>,
    }

    unsafe impl<ItemIdentifierType: ?Sized + Message> ClassType
        for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
    {
        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
        }
    }
);

unsafe impl<ItemIdentifierType: ?Sized + IsIdCloneable> NSCopying
    for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
}

unsafe impl<ItemIdentifierType: ?Sized> NSObjectProtocol
    for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
}

extern_methods!(
    unsafe impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method(appendItems:)]
        pub unsafe fn appendItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(appendItems:intoParentItem:)]
        pub unsafe fn appendItems_intoParentItem(
            &self,
            items: &NSArray<ItemIdentifierType>,
            parent_item: Option<&ItemIdentifierType>,
        );

        #[method(insertItems:beforeItem:)]
        pub unsafe fn insertItems_beforeItem(
            &self,
            items: &NSArray<ItemIdentifierType>,
            before_identifier: &ItemIdentifierType,
        );

        #[method(insertItems:afterItem:)]
        pub unsafe fn insertItems_afterItem(
            &self,
            items: &NSArray<ItemIdentifierType>,
            after_identifier: &ItemIdentifierType,
        );

        #[method(deleteItems:)]
        pub unsafe fn deleteItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(deleteAllItems)]
        pub unsafe fn deleteAllItems(&self);

        #[method(expandItems:)]
        pub unsafe fn expandItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(collapseItems:)]
        pub unsafe fn collapseItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(replaceChildrenOfParentItem:withSnapshot:)]
        pub unsafe fn replaceChildrenOfParentItem_withSnapshot(
            &self,
            parent_item: &ItemIdentifierType,
            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
        );

        #[method(insertSnapshot:beforeItem:)]
        pub unsafe fn insertSnapshot_beforeItem(
            &self,
            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
            item: &ItemIdentifierType,
        );

        #[method_id(@__retain_semantics Other insertSnapshot:afterItem:)]
        pub unsafe fn insertSnapshot_afterItem(
            &self,
            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
            item: &ItemIdentifierType,
        ) -> Retained<ItemIdentifierType>;

        #[method(isExpanded:)]
        pub unsafe fn isExpanded(&self, item: &ItemIdentifierType) -> bool;

        #[method(isVisible:)]
        pub unsafe fn isVisible(&self, item: &ItemIdentifierType) -> bool;

        #[method(containsItem:)]
        pub unsafe fn containsItem(&self, item: &ItemIdentifierType) -> bool;

        #[method(levelOfItem:)]
        pub unsafe fn levelOfItem(&self, item: &ItemIdentifierType) -> NSInteger;

        #[method(indexOfItem:)]
        pub unsafe fn indexOfItem(&self, item: &ItemIdentifierType) -> NSInteger;

        #[method_id(@__retain_semantics Other expandedItems)]
        pub unsafe fn expandedItems(&self) -> Retained<NSArray<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other parentOfChildItem:)]
        pub unsafe fn parentOfChildItem(
            &self,
            child_item: &ItemIdentifierType,
        ) -> Option<Retained<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other snapshotOfParentItem:)]
        pub unsafe fn snapshotOfParentItem(
            &self,
            parent_item: &ItemIdentifierType,
        ) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other snapshotOfParentItem:includingParentItem:)]
        pub unsafe fn snapshotOfParentItem_includingParentItem(
            &self,
            parent_item: &ItemIdentifierType,
            including_parent_item: bool,
        ) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other rootItems)]
        pub unsafe fn rootItems(&self) -> Retained<NSArray<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other visibleItems)]
        pub unsafe fn visibleItems(&self) -> Retained<NSArray<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other visualDescription)]
        pub unsafe fn visualDescription(&self) -> Retained<NSString>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);
