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 fn indexPathWithIndex(index: NSUInteger) -> Retained<Self>;
45
46 #[unsafe(method(indexPathWithIndexes:length:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn indexPathWithIndexes_length(
52 indexes: *mut NSUInteger,
53 length: NSUInteger,
54 ) -> Retained<Self>;
55
56 #[unsafe(method(initWithIndexes:length:))]
60 #[unsafe(method_family = init)]
61 pub unsafe fn initWithIndexes_length(
62 this: Allocated<Self>,
63 indexes: *mut NSUInteger,
64 length: NSUInteger,
65 ) -> Retained<Self>;
66
67 #[unsafe(method(initWithIndex:))]
68 #[unsafe(method_family = init)]
69 pub fn initWithIndex(this: Allocated<Self>, index: NSUInteger) -> Retained<Self>;
70
71 #[unsafe(method(indexPathByAddingIndex:))]
72 #[unsafe(method_family = none)]
73 pub fn indexPathByAddingIndex(&self, index: NSUInteger) -> Retained<NSIndexPath>;
74
75 #[unsafe(method(indexPathByRemovingLastIndex))]
76 #[unsafe(method_family = none)]
77 pub fn indexPathByRemovingLastIndex(&self) -> Retained<NSIndexPath>;
78
79 #[unsafe(method(indexAtPosition:))]
80 #[unsafe(method_family = none)]
81 pub fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger;
82
83 #[unsafe(method(length))]
84 #[unsafe(method_family = none)]
85 pub fn length(&self) -> NSUInteger;
86
87 #[cfg(feature = "NSRange")]
88 #[unsafe(method(getIndexes:range:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn getIndexes_range(
102 &self,
103 indexes: NonNull<NSUInteger>,
104 position_range: NSRange,
105 );
106
107 #[cfg(feature = "NSObjCRuntime")]
108 #[unsafe(method(compare:))]
109 #[unsafe(method_family = none)]
110 pub fn compare(&self, other_object: &NSIndexPath) -> NSComparisonResult;
111 );
112}
113
114impl NSIndexPath {
116 extern_methods!(
117 #[unsafe(method(init))]
118 #[unsafe(method_family = init)]
119 pub fn init(this: Allocated<Self>) -> Retained<Self>;
120
121 #[unsafe(method(new))]
122 #[unsafe(method_family = new)]
123 pub fn new() -> Retained<Self>;
124 );
125}
126
127impl DefaultRetained for NSIndexPath {
128 #[inline]
129 fn default_retained() -> Retained<Self> {
130 Self::new()
131 }
132}
133
134impl NSIndexPath {
136 extern_methods!(
137 #[deprecated]
143 #[unsafe(method(getIndexes:))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn getIndexes(&self, indexes: NonNull<NSUInteger>);
146 );
147}