objc2_foundation/generated/
NSIndexPath.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSIndexPath;
14);
15
16#[cfg(feature = "NSObject")]
17extern_conformance!(
18 unsafe impl NSCoding for NSIndexPath {}
19);
20
21#[cfg(feature = "NSObject")]
22extern_conformance!(
23 unsafe impl NSCopying for NSIndexPath {}
24);
25
26#[cfg(feature = "NSObject")]
27unsafe impl CopyingHelper for NSIndexPath {
28 type Result = Self;
29}
30
31extern_conformance!(
32 unsafe impl NSObjectProtocol for NSIndexPath {}
33);
34
35#[cfg(feature = "NSObject")]
36extern_conformance!(
37 unsafe impl NSSecureCoding for NSIndexPath {}
38);
39
40impl NSIndexPath {
41 extern_methods!(
42 #[unsafe(method(indexPathWithIndex:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn indexPathWithIndex(index: NSUInteger) -> Retained<Self>;
45
46 #[unsafe(method(indexPathWithIndexes:length:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn indexPathWithIndexes_length(
49 indexes: *mut NSUInteger,
50 length: NSUInteger,
51 ) -> Retained<Self>;
52
53 #[unsafe(method(initWithIndexes:length:))]
54 #[unsafe(method_family = init)]
55 pub unsafe fn initWithIndexes_length(
56 this: Allocated<Self>,
57 indexes: *mut NSUInteger,
58 length: NSUInteger,
59 ) -> Retained<Self>;
60
61 #[unsafe(method(initWithIndex:))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn initWithIndex(this: Allocated<Self>, index: NSUInteger) -> Retained<Self>;
64
65 #[unsafe(method(indexPathByAddingIndex:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn indexPathByAddingIndex(&self, index: NSUInteger) -> Retained<NSIndexPath>;
68
69 #[unsafe(method(indexPathByRemovingLastIndex))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn indexPathByRemovingLastIndex(&self) -> Retained<NSIndexPath>;
72
73 #[unsafe(method(indexAtPosition:))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger;
76
77 #[unsafe(method(length))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn length(&self) -> NSUInteger;
80
81 #[cfg(feature = "NSRange")]
82 #[unsafe(method(getIndexes:range:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn getIndexes_range(
92 &self,
93 indexes: NonNull<NSUInteger>,
94 position_range: NSRange,
95 );
96
97 #[cfg(feature = "NSObjCRuntime")]
98 #[unsafe(method(compare:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn compare(&self, other_object: &NSIndexPath) -> NSComparisonResult;
101 );
102}
103
104impl NSIndexPath {
106 extern_methods!(
107 #[unsafe(method(init))]
108 #[unsafe(method_family = init)]
109 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
110
111 #[unsafe(method(new))]
112 #[unsafe(method_family = new)]
113 pub unsafe fn new() -> Retained<Self>;
114 );
115}
116
117impl NSIndexPath {
119 extern_methods!(
120 #[deprecated]
122 #[unsafe(method(getIndexes:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn getIndexes(&self, indexes: NonNull<NSUInteger>);
125 );
126}