use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSIndexPath;
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCoding for NSIndexPath {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCopying for NSIndexPath {}
);
#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSIndexPath {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSIndexPath {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSSecureCoding for NSIndexPath {}
);
impl NSIndexPath {
extern_methods!(
#[unsafe(method(indexPathWithIndex:))]
#[unsafe(method_family = none)]
pub fn indexPathWithIndex(index: NSUInteger) -> Retained<Self>;
#[unsafe(method(indexPathWithIndexes:length:))]
#[unsafe(method_family = none)]
pub unsafe fn indexPathWithIndexes_length(
indexes: *mut NSUInteger,
length: NSUInteger,
) -> Retained<Self>;
#[unsafe(method(initWithIndexes:length:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIndexes_length(
this: Allocated<Self>,
indexes: *mut NSUInteger,
length: NSUInteger,
) -> Retained<Self>;
#[unsafe(method(initWithIndex:))]
#[unsafe(method_family = init)]
pub fn initWithIndex(this: Allocated<Self>, index: NSUInteger) -> Retained<Self>;
#[unsafe(method(indexPathByAddingIndex:))]
#[unsafe(method_family = none)]
pub fn indexPathByAddingIndex(&self, index: NSUInteger) -> Retained<NSIndexPath>;
#[unsafe(method(indexPathByRemovingLastIndex))]
#[unsafe(method_family = none)]
pub fn indexPathByRemovingLastIndex(&self) -> Retained<NSIndexPath>;
#[unsafe(method(indexAtPosition:))]
#[unsafe(method_family = none)]
pub fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger;
#[unsafe(method(length))]
#[unsafe(method_family = none)]
pub fn length(&self) -> NSUInteger;
#[cfg(feature = "NSRange")]
#[unsafe(method(getIndexes:range:))]
#[unsafe(method_family = none)]
pub unsafe fn getIndexes_range(
&self,
indexes: NonNull<NSUInteger>,
position_range: NSRange,
);
#[cfg(feature = "NSObjCRuntime")]
#[unsafe(method(compare:))]
#[unsafe(method_family = none)]
pub fn compare(&self, other_object: &NSIndexPath) -> NSComparisonResult;
);
}
impl NSIndexPath {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSIndexPath {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
impl NSIndexPath {
extern_methods!(
#[deprecated]
#[unsafe(method(getIndexes:))]
#[unsafe(method_family = none)]
pub unsafe fn getIndexes(&self, indexes: NonNull<NSUInteger>);
);
}