objc2_intents/generated/
INRequestRideIntent.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-location")]
7use objc2_core_location::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inrequestrideintent?language=objc)
14    #[unsafe(super(INIntent, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "INIntent")]
17    pub struct INRequestRideIntent;
18);
19
20#[cfg(feature = "INIntent")]
21extern_conformance!(
22    unsafe impl NSCoding for INRequestRideIntent {}
23);
24
25#[cfg(feature = "INIntent")]
26extern_conformance!(
27    unsafe impl NSCopying for INRequestRideIntent {}
28);
29
30#[cfg(feature = "INIntent")]
31unsafe impl CopyingHelper for INRequestRideIntent {
32    type Result = Self;
33}
34
35#[cfg(feature = "INIntent")]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for INRequestRideIntent {}
38);
39
40#[cfg(feature = "INIntent")]
41extern_conformance!(
42    unsafe impl NSSecureCoding for INRequestRideIntent {}
43);
44
45#[cfg(feature = "INIntent")]
46impl INRequestRideIntent {
47    extern_methods!(
48        #[cfg(all(
49            feature = "INDateComponentsRange",
50            feature = "INPaymentMethod",
51            feature = "INSpeakableString",
52            feature = "objc2-core-location"
53        ))]
54        #[unsafe(method(initWithPickupLocation:dropOffLocation:rideOptionName:partySize:paymentMethod:scheduledPickupTime:))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn initWithPickupLocation_dropOffLocation_rideOptionName_partySize_paymentMethod_scheduledPickupTime(
57            this: Allocated<Self>,
58            pickup_location: Option<&CLPlacemark>,
59            drop_off_location: Option<&CLPlacemark>,
60            ride_option_name: Option<&INSpeakableString>,
61            party_size: Option<&NSNumber>,
62            payment_method: Option<&INPaymentMethod>,
63            scheduled_pickup_time: Option<&INDateComponentsRange>,
64        ) -> Retained<Self>;
65
66        #[cfg(feature = "objc2-core-location")]
67        #[unsafe(method(pickupLocation))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn pickupLocation(&self) -> Option<Retained<CLPlacemark>>;
70
71        #[cfg(feature = "objc2-core-location")]
72        #[unsafe(method(dropOffLocation))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn dropOffLocation(&self) -> Option<Retained<CLPlacemark>>;
75
76        #[cfg(feature = "INSpeakableString")]
77        #[unsafe(method(rideOptionName))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn rideOptionName(&self) -> Option<Retained<INSpeakableString>>;
80
81        #[unsafe(method(partySize))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn partySize(&self) -> Option<Retained<NSNumber>>;
84
85        #[cfg(feature = "INPaymentMethod")]
86        #[unsafe(method(paymentMethod))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn paymentMethod(&self) -> Option<Retained<INPaymentMethod>>;
89
90        #[cfg(feature = "INDateComponentsRange")]
91        #[unsafe(method(scheduledPickupTime))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn scheduledPickupTime(&self) -> Option<Retained<INDateComponentsRange>>;
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98#[cfg(feature = "INIntent")]
99impl INRequestRideIntent {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}
110
111extern_protocol!(
112    /// Protocol to declare support for handling an INRequestRideIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
113    ///
114    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The resolution and confirmation methods are optional. The handling method is always called last, after resolving and confirming the intent.
115    ///
116    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inrequestrideintenthandling?language=objc)
117    pub unsafe trait INRequestRideIntentHandling: NSObjectProtocol {
118        #[cfg(all(
119            feature = "INIntent",
120            feature = "INIntentResponse",
121            feature = "INRequestRideIntentResponse",
122            feature = "block2"
123        ))]
124        /// Handling method - Execute the task represented by the INRequestRideIntent that's passed in
125        ///
126        /// Called to actually execute the intent. The app must return a response for this intent.
127        ///
128        ///
129        /// Parameter `intent`: The input intent
130        ///
131        /// Parameter `completion`: The response handling block takes a INRequestRideIntentResponse containing the details of the result of having executed the intent
132        ///
133        ///
134        /// See: INRequestRideIntentResponse
135        #[unsafe(method(handleRequestRide:completion:))]
136        #[unsafe(method_family = none)]
137        unsafe fn handleRequestRide_completion(
138            &self,
139            intent: &INRequestRideIntent,
140            completion: &block2::DynBlock<dyn Fn(NonNull<INRequestRideIntentResponse>)>,
141        );
142
143        #[cfg(all(
144            feature = "INIntent",
145            feature = "INIntentResponse",
146            feature = "INRequestRideIntentResponse",
147            feature = "block2"
148        ))]
149        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
150        ///
151        /// Called prior to asking the app to handle the intent. The app should return a response object that contains additional information about the intent, which may be relevant for the system to show the user prior to handling. If unimplemented, the system will assume the intent is valid following resolution, and will assume there is no additional information relevant to this intent.
152        ///
153        ///
154        /// Parameter `intent`: The input intent
155        ///
156        /// Parameter `completion`: The response block contains an INRequestRideIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
157        ///
158        ///
159        /// See: INRequestRideIntentResponse
160        #[optional]
161        #[unsafe(method(confirmRequestRide:completion:))]
162        #[unsafe(method_family = none)]
163        unsafe fn confirmRequestRide_completion(
164            &self,
165            intent: &INRequestRideIntent,
166            completion: &block2::DynBlock<dyn Fn(NonNull<INRequestRideIntentResponse>)>,
167        );
168
169        #[cfg(all(
170            feature = "INIntent",
171            feature = "INIntentResolutionResult",
172            feature = "INPlacemarkResolutionResult",
173            feature = "block2"
174        ))]
175        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
176        ///
177        /// Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out.
178        ///
179        ///
180        /// Parameter `intent`: The input intent
181        ///
182        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
183        ///
184        ///
185        /// See: INIntentResolutionResult
186        #[optional]
187        #[unsafe(method(resolvePickupLocationForRequestRide:withCompletion:))]
188        #[unsafe(method_family = none)]
189        unsafe fn resolvePickupLocationForRequestRide_withCompletion(
190            &self,
191            intent: &INRequestRideIntent,
192            completion: &block2::DynBlock<dyn Fn(NonNull<INPlacemarkResolutionResult>)>,
193        );
194
195        #[cfg(all(
196            feature = "INIntent",
197            feature = "INIntentResolutionResult",
198            feature = "INPlacemarkResolutionResult",
199            feature = "block2"
200        ))]
201        #[optional]
202        #[unsafe(method(resolveDropOffLocationForRequestRide:withCompletion:))]
203        #[unsafe(method_family = none)]
204        unsafe fn resolveDropOffLocationForRequestRide_withCompletion(
205            &self,
206            intent: &INRequestRideIntent,
207            completion: &block2::DynBlock<dyn Fn(NonNull<INPlacemarkResolutionResult>)>,
208        );
209
210        #[cfg(all(
211            feature = "INIntent",
212            feature = "INIntentResolutionResult",
213            feature = "INSpeakableStringResolutionResult",
214            feature = "block2"
215        ))]
216        #[optional]
217        #[unsafe(method(resolveRideOptionNameForRequestRide:withCompletion:))]
218        #[unsafe(method_family = none)]
219        unsafe fn resolveRideOptionNameForRequestRide_withCompletion(
220            &self,
221            intent: &INRequestRideIntent,
222            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
223        );
224
225        #[cfg(all(
226            feature = "INIntegerResolutionResult",
227            feature = "INIntent",
228            feature = "INIntentResolutionResult",
229            feature = "block2"
230        ))]
231        #[optional]
232        #[unsafe(method(resolvePartySizeForRequestRide:withCompletion:))]
233        #[unsafe(method_family = none)]
234        unsafe fn resolvePartySizeForRequestRide_withCompletion(
235            &self,
236            intent: &INRequestRideIntent,
237            completion: &block2::DynBlock<dyn Fn(NonNull<INIntegerResolutionResult>)>,
238        );
239
240        #[cfg(all(
241            feature = "INDateComponentsRangeResolutionResult",
242            feature = "INIntent",
243            feature = "INIntentResolutionResult",
244            feature = "block2"
245        ))]
246        #[optional]
247        #[unsafe(method(resolveScheduledPickupTimeForRequestRide:withCompletion:))]
248        #[unsafe(method_family = none)]
249        unsafe fn resolveScheduledPickupTimeForRequestRide_withCompletion(
250            &self,
251            intent: &INRequestRideIntent,
252            completion: &block2::DynBlock<dyn Fn(NonNull<INDateComponentsRangeResolutionResult>)>,
253        );
254    }
255);