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")]
17unsafe impl NSCoding for NSIndexPath {}
18
19#[cfg(feature = "NSObject")]
20unsafe impl NSCopying for NSIndexPath {}
21
22#[cfg(feature = "NSObject")]
23unsafe impl CopyingHelper for NSIndexPath {
24 type Result = Self;
25}
26
27unsafe impl NSObjectProtocol for NSIndexPath {}
28
29#[cfg(feature = "NSObject")]
30unsafe impl NSSecureCoding for NSIndexPath {}
31
32impl NSIndexPath {
33 extern_methods!(
34 #[unsafe(method(indexPathWithIndex:))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn indexPathWithIndex(index: NSUInteger) -> Retained<Self>;
37
38 #[unsafe(method(indexPathWithIndexes:length:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn indexPathWithIndexes_length(
41 indexes: *mut NSUInteger,
42 length: NSUInteger,
43 ) -> Retained<Self>;
44
45 #[unsafe(method(initWithIndexes:length:))]
46 #[unsafe(method_family = init)]
47 pub unsafe fn initWithIndexes_length(
48 this: Allocated<Self>,
49 indexes: *mut NSUInteger,
50 length: NSUInteger,
51 ) -> Retained<Self>;
52
53 #[unsafe(method(initWithIndex:))]
54 #[unsafe(method_family = init)]
55 pub unsafe fn initWithIndex(this: Allocated<Self>, index: NSUInteger) -> Retained<Self>;
56
57 #[unsafe(method(indexPathByAddingIndex:))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn indexPathByAddingIndex(&self, index: NSUInteger) -> Retained<NSIndexPath>;
60
61 #[unsafe(method(indexPathByRemovingLastIndex))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn indexPathByRemovingLastIndex(&self) -> Retained<NSIndexPath>;
64
65 #[unsafe(method(indexAtPosition:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn indexAtPosition(&self, position: NSUInteger) -> NSUInteger;
68
69 #[unsafe(method(length))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn length(&self) -> NSUInteger;
72
73 #[cfg(feature = "NSRange")]
74 #[unsafe(method(getIndexes:range:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn getIndexes_range(
84 &self,
85 indexes: NonNull<NSUInteger>,
86 position_range: NSRange,
87 );
88
89 #[cfg(feature = "NSObjCRuntime")]
90 #[unsafe(method(compare:))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn compare(&self, other_object: &NSIndexPath) -> NSComparisonResult;
93 );
94}
95
96impl NSIndexPath {
98 extern_methods!(
99 #[unsafe(method(init))]
100 #[unsafe(method_family = init)]
101 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103 #[unsafe(method(new))]
104 #[unsafe(method_family = new)]
105 pub unsafe fn new() -> Retained<Self>;
106 );
107}
108
109impl NSIndexPath {
111 extern_methods!(
112 #[deprecated]
114 #[unsafe(method(getIndexes:))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn getIndexes(&self, indexes: NonNull<NSUInteger>);
117 );
118}