1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSIndexPath;

    unsafe impl ClassType for NSIndexPath {
        type Super = NSObject;
        type Mutability = Immutable;
    }
);

#[cfg(feature = "NSObject")]
unsafe impl NSCoding for NSIndexPath {}

#[cfg(feature = "NSObject")]
unsafe impl NSCopying for NSIndexPath {}

unsafe impl NSObjectProtocol for NSIndexPath {}

#[cfg(feature = "NSObject")]
unsafe impl NSSecureCoding for NSIndexPath {}

extern_methods!(
    unsafe impl NSIndexPath {
        #[method_id(@__retain_semantics Other indexPathWithIndex:)]
        pub unsafe fn indexPathWithIndex(index: NSUInteger) -> Retained<Self>;

        #[method_id(@__retain_semantics Other indexPathWithIndexes:length:)]
        pub unsafe fn indexPathWithIndexes_length(
            indexes: *mut NSUInteger,
            length: NSUInteger,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithIndexes:length:)]
        pub unsafe fn initWithIndexes_length(
            this: Allocated<Self>,
            indexes: *mut NSUInteger,
            length: NSUInteger,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithIndex:)]
        pub unsafe fn initWithIndex(this: Allocated<Self>, index: NSUInteger) -> Retained<Self>;

        #[method_id(@__retain_semantics Other indexPathByAddingIndex:)]
        pub unsafe fn indexPathByAddingIndex(&self, index: NSUInteger) -> Retained<NSIndexPath>;

        #[method_id(@__retain_semantics Other indexPathByRemovingLastIndex)]
        pub unsafe fn indexPathByRemovingLastIndex(&self) -> Retained<NSIndexPath>;

        #[method(indexAtPosition:)]
        pub unsafe fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger;

        #[method(length)]
        pub unsafe fn length(&self) -> NSUInteger;

        #[cfg(feature = "NSRange")]
        #[method(getIndexes:range:)]
        pub unsafe fn getIndexes_range(
            &self,
            indexes: NonNull<NSUInteger>,
            position_range: NSRange,
        );

        #[cfg(feature = "NSObjCRuntime")]
        #[method(compare:)]
        pub unsafe fn compare(&self, other_object: &NSIndexPath) -> NSComparisonResult;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSIndexPath {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_methods!(
    /// NSDeprecated
    unsafe impl NSIndexPath {
        #[deprecated]
        #[method(getIndexes:)]
        pub unsafe fn getIndexes(&self, indexes: NonNull<NSUInteger>);
    }
);