objc2_car_play/generated/
CPContact.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-ui-kit")]
8use objc2_ui_kit::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct CPContact;
17);
18
19extern_conformance!(
20 unsafe impl NSCoding for CPContact {}
21);
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for CPContact {}
25);
26
27extern_conformance!(
28 unsafe impl NSSecureCoding for CPContact {}
29);
30
31impl CPContact {
32 extern_methods!(
33 #[cfg(feature = "objc2-ui-kit")]
34 #[unsafe(method(initWithName:image:))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn initWithName_image(
59 this: Allocated<Self>,
60 name: &NSString,
61 image: &UIImage,
62 ) -> Retained<Self>;
63
64 #[unsafe(method(name))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn name(&self) -> Retained<NSString>;
68
69 #[unsafe(method(setName:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setName(&self, name: &NSString);
75
76 #[cfg(feature = "objc2-ui-kit")]
77 #[unsafe(method(image))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn image(&self) -> Retained<UIImage>;
81
82 #[cfg(feature = "objc2-ui-kit")]
83 #[unsafe(method(setImage:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn setImage(&self, image: &UIImage);
87
88 #[cfg(feature = "CPButton")]
89 #[unsafe(method(actions))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn actions(&self) -> Option<Retained<NSArray<CPButton>>>;
95
96 #[cfg(feature = "CPButton")]
97 #[unsafe(method(setActions:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setActions(&self, actions: Option<&NSArray<CPButton>>);
103
104 #[unsafe(method(subtitle))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
108
109 #[unsafe(method(setSubtitle:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
115
116 #[unsafe(method(informativeText))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn informativeText(&self) -> Option<Retained<NSString>>;
120
121 #[unsafe(method(setInformativeText:))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn setInformativeText(&self, informative_text: Option<&NSString>);
127 );
128}
129
130impl CPContact {
132 extern_methods!(
133 #[unsafe(method(init))]
134 #[unsafe(method_family = init)]
135 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
136
137 #[unsafe(method(new))]
138 #[unsafe(method_family = new)]
139 pub unsafe fn new() -> Retained<Self>;
140 );
141}
142
143extern_class!(
144 #[unsafe(super(CPButton, NSObject))]
146 #[derive(Debug, PartialEq, Eq, Hash)]
147 #[cfg(feature = "CPButton")]
148 pub struct CPContactCallButton;
149);
150
151#[cfg(feature = "CPButton")]
152extern_conformance!(
153 unsafe impl NSObjectProtocol for CPContactCallButton {}
154);
155
156#[cfg(feature = "CPButton")]
157impl CPContactCallButton {
158 extern_methods!(
159 #[cfg(feature = "block2")]
160 #[unsafe(method(initWithHandler:))]
165 #[unsafe(method_family = init)]
166 pub unsafe fn initWithHandler(
167 this: Allocated<Self>,
168 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPButton>)>>,
169 ) -> Retained<Self>;
170
171 #[cfg(all(feature = "block2", feature = "objc2-ui-kit"))]
172 #[unsafe(method(initWithImage:handler:))]
173 #[unsafe(method_family = init)]
174 pub unsafe fn initWithImage_handler(
175 this: Allocated<Self>,
176 image: &UIImage,
177 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPButton>)>>,
178 ) -> Retained<Self>;
179 );
180}
181
182#[cfg(feature = "CPButton")]
184impl CPContactCallButton {
185 extern_methods!(
186 #[unsafe(method(new))]
187 #[unsafe(method_family = new)]
188 pub unsafe fn new() -> Retained<Self>;
189
190 #[unsafe(method(init))]
191 #[unsafe(method_family = init)]
192 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
193 );
194}
195
196extern_class!(
197 #[unsafe(super(CPButton, NSObject))]
199 #[derive(Debug, PartialEq, Eq, Hash)]
200 #[cfg(feature = "CPButton")]
201 pub struct CPContactMessageButton;
202);
203
204#[cfg(feature = "CPButton")]
205extern_conformance!(
206 unsafe impl NSObjectProtocol for CPContactMessageButton {}
207);
208
209#[cfg(feature = "CPButton")]
210impl CPContactMessageButton {
211 extern_methods!(
212 #[unsafe(method(initWithPhoneOrEmail:))]
220 #[unsafe(method_family = init)]
221 pub unsafe fn initWithPhoneOrEmail(
222 this: Allocated<Self>,
223 phone_or_email: &NSString,
224 ) -> Retained<Self>;
225
226 #[unsafe(method(phoneOrEmail))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn phoneOrEmail(&self) -> Retained<NSString>;
229 );
230}
231
232#[cfg(feature = "CPButton")]
234impl CPContactMessageButton {
235 extern_methods!(
236 #[cfg(all(feature = "block2", feature = "objc2-ui-kit"))]
237 #[unsafe(method(initWithImage:handler:))]
259 #[unsafe(method_family = init)]
260 pub unsafe fn initWithImage_handler(
261 this: Allocated<Self>,
262 image: &UIImage,
263 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPButton>)>>,
264 ) -> Retained<Self>;
265
266 #[unsafe(method(new))]
267 #[unsafe(method_family = new)]
268 pub unsafe fn new() -> Retained<Self>;
269
270 #[unsafe(method(init))]
271 #[unsafe(method_family = init)]
272 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
273 );
274}
275
276extern_class!(
277 #[unsafe(super(CPButton, NSObject))]
279 #[derive(Debug, PartialEq, Eq, Hash)]
280 #[cfg(feature = "CPButton")]
281 pub struct CPContactDirectionsButton;
282);
283
284#[cfg(feature = "CPButton")]
285extern_conformance!(
286 unsafe impl NSObjectProtocol for CPContactDirectionsButton {}
287);
288
289#[cfg(feature = "CPButton")]
290impl CPContactDirectionsButton {
291 extern_methods!(
292 #[cfg(feature = "block2")]
293 #[unsafe(method(initWithHandler:))]
298 #[unsafe(method_family = init)]
299 pub unsafe fn initWithHandler(
300 this: Allocated<Self>,
301 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPButton>)>>,
302 ) -> Retained<Self>;
303
304 #[cfg(all(feature = "block2", feature = "objc2-ui-kit"))]
305 #[unsafe(method(initWithImage:handler:))]
306 #[unsafe(method_family = init)]
307 pub unsafe fn initWithImage_handler(
308 this: Allocated<Self>,
309 image: &UIImage,
310 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPButton>)>>,
311 ) -> Retained<Self>;
312 );
313}
314
315#[cfg(feature = "CPButton")]
317impl CPContactDirectionsButton {
318 extern_methods!(
319 #[unsafe(method(new))]
320 #[unsafe(method_family = new)]
321 pub unsafe fn new() -> Retained<Self>;
322
323 #[unsafe(method(init))]
324 #[unsafe(method_family = init)]
325 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
326 );
327}