objc2_foundation/generated/
NSPointerArray.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 NSPointerArray;
14);
15
16#[cfg(feature = "NSObject")]
17unsafe impl NSCoding for NSPointerArray {}
18
19#[cfg(feature = "NSObject")]
20unsafe impl NSCopying for NSPointerArray {}
21
22#[cfg(feature = "NSObject")]
23unsafe impl CopyingHelper for NSPointerArray {
24 type Result = Self;
25}
26
27#[cfg(feature = "NSEnumerator")]
28unsafe impl NSFastEnumeration for NSPointerArray {}
29
30unsafe impl NSObjectProtocol for NSPointerArray {}
31
32#[cfg(feature = "NSObject")]
33unsafe impl NSSecureCoding for NSPointerArray {}
34
35impl NSPointerArray {
36 extern_methods!(
37 #[cfg(feature = "NSPointerFunctions")]
38 #[unsafe(method(initWithOptions:))]
39 #[unsafe(method_family = init)]
40 pub unsafe fn initWithOptions(
41 this: Allocated<Self>,
42 options: NSPointerFunctionsOptions,
43 ) -> Retained<Self>;
44
45 #[cfg(feature = "NSPointerFunctions")]
46 #[unsafe(method(initWithPointerFunctions:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithPointerFunctions(
49 this: Allocated<Self>,
50 functions: &NSPointerFunctions,
51 ) -> Retained<Self>;
52
53 #[cfg(feature = "NSPointerFunctions")]
54 #[unsafe(method(pointerArrayWithOptions:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn pointerArrayWithOptions(
57 options: NSPointerFunctionsOptions,
58 ) -> Retained<NSPointerArray>;
59
60 #[cfg(feature = "NSPointerFunctions")]
61 #[unsafe(method(pointerArrayWithPointerFunctions:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn pointerArrayWithPointerFunctions(
64 functions: &NSPointerFunctions,
65 ) -> Retained<NSPointerArray>;
66
67 #[cfg(feature = "NSPointerFunctions")]
68 #[unsafe(method(pointerFunctions))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn pointerFunctions(&self) -> Retained<NSPointerFunctions>;
71
72 #[unsafe(method(pointerAtIndex:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn pointerAtIndex(&self, index: NSUInteger) -> *mut c_void;
75
76 #[unsafe(method(addPointer:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn addPointer(&self, pointer: *mut c_void);
79
80 #[unsafe(method(removePointerAtIndex:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn removePointerAtIndex(&self, index: NSUInteger);
83
84 #[unsafe(method(insertPointer:atIndex:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn insertPointer_atIndex(&self, item: *mut c_void, index: NSUInteger);
87
88 #[unsafe(method(replacePointerAtIndex:withPointer:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn replacePointerAtIndex_withPointer(
91 &self,
92 index: NSUInteger,
93 item: *mut c_void,
94 );
95
96 #[unsafe(method(compact))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn compact(&self);
99
100 #[unsafe(method(count))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn count(&self) -> NSUInteger;
103
104 #[unsafe(method(setCount:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn setCount(&self, count: NSUInteger);
108 );
109}
110
111impl NSPointerArray {
113 extern_methods!(
114 #[unsafe(method(init))]
115 #[unsafe(method_family = init)]
116 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
117
118 #[unsafe(method(new))]
119 #[unsafe(method_family = new)]
120 pub unsafe fn new() -> Retained<Self>;
121 );
122}
123
124impl NSPointerArray {
126 extern_methods!(
127 #[deprecated = "GC no longer supported"]
128 #[unsafe(method(pointerArrayWithStrongObjects))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn pointerArrayWithStrongObjects() -> Retained<AnyObject>;
131
132 #[deprecated = "GC no longer supported"]
133 #[unsafe(method(pointerArrayWithWeakObjects))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn pointerArrayWithWeakObjects() -> Retained<AnyObject>;
136
137 #[unsafe(method(strongObjectsPointerArray))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn strongObjectsPointerArray() -> Retained<NSPointerArray>;
140
141 #[unsafe(method(weakObjectsPointerArray))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn weakObjectsPointerArray() -> Retained<NSPointerArray>;
144
145 #[cfg(feature = "NSArray")]
146 #[unsafe(method(allObjects))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn allObjects(&self) -> Retained<NSArray>;
149 );
150}