use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct INObjectCollection<ObjectType: ?Sized = AnyObject>;
);
impl<ObjectType: ?Sized + Message> INObjectCollection<ObjectType> {
#[inline]
pub unsafe fn cast_unchecked<NewObjectType: ?Sized + Message>(
&self,
) -> &INObjectCollection<NewObjectType> {
unsafe { &*((self as *const Self).cast()) }
}
}
extern_conformance!(
unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding for INObjectCollection<ObjectType> {}
);
extern_conformance!(
unsafe impl<ObjectType: ?Sized> NSCopying for INObjectCollection<ObjectType> {}
);
unsafe impl<ObjectType: ?Sized + Message> CopyingHelper for INObjectCollection<ObjectType> {
type Result = Self;
}
extern_conformance!(
unsafe impl<ObjectType: ?Sized> NSObjectProtocol for INObjectCollection<ObjectType> {}
);
extern_conformance!(
unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding for INObjectCollection<ObjectType> {}
);
impl<ObjectType: Message> INObjectCollection<ObjectType> {
extern_methods!(
#[cfg(feature = "INObjectSection")]
#[unsafe(method(sections))]
#[unsafe(method_family = none)]
pub unsafe fn sections(&self) -> Retained<NSArray<INObjectSection<ObjectType>>>;
#[unsafe(method(allItems))]
#[unsafe(method_family = none)]
pub unsafe fn allItems(&self) -> Retained<NSArray<ObjectType>>;
#[unsafe(method(usesIndexedCollation))]
#[unsafe(method_family = none)]
pub unsafe fn usesIndexedCollation(&self) -> bool;
#[unsafe(method(setUsesIndexedCollation:))]
#[unsafe(method_family = none)]
pub unsafe fn setUsesIndexedCollation(&self, uses_indexed_collation: bool);
#[cfg(feature = "INObjectSection")]
#[unsafe(method(initWithSections:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSections(
this: Allocated<Self>,
sections: &NSArray<INObjectSection<ObjectType>>,
) -> Retained<Self>;
#[unsafe(method(initWithItems:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithItems(
this: Allocated<Self>,
items: &NSArray<ObjectType>,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl<ObjectType: Message> INObjectCollection<ObjectType> {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}