objc2_intents/generated/
INBookRestaurantReservationIntent.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inbookrestaurantreservationintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INBookRestaurantReservationIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INBookRestaurantReservationIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INBookRestaurantReservationIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INBookRestaurantReservationIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INBookRestaurantReservationIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INBookRestaurantReservationIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INBookRestaurantReservationIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INPerson",
48            feature = "INRestaurant",
49            feature = "INRestaurantGuest",
50            feature = "INRestaurantOffer"
51        ))]
52        #[unsafe(method(initWithRestaurant:bookingDateComponents:partySize:bookingIdentifier:guest:selectedOffer:guestProvidedSpecialRequestText:))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn initWithRestaurant_bookingDateComponents_partySize_bookingIdentifier_guest_selectedOffer_guestProvidedSpecialRequestText(
55            this: Allocated<Self>,
56            restaurant: &INRestaurant,
57            booking_date_components: &NSDateComponents,
58            party_size: NSUInteger,
59            booking_identifier: Option<&NSString>,
60            guest: Option<&INRestaurantGuest>,
61            selected_offer: Option<&INRestaurantOffer>,
62            guest_provided_special_request_text: Option<&NSString>,
63        ) -> Retained<Self>;
64
65        #[cfg(feature = "INRestaurant")]
66        #[unsafe(method(restaurant))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn restaurant(&self) -> Retained<INRestaurant>;
69
70        #[cfg(feature = "INRestaurant")]
71        /// Setter for [`restaurant`][Self::restaurant].
72        ///
73        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
74        #[unsafe(method(setRestaurant:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setRestaurant(&self, restaurant: &INRestaurant);
77
78        #[unsafe(method(bookingDateComponents))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn bookingDateComponents(&self) -> Retained<NSDateComponents>;
81
82        /// Setter for [`bookingDateComponents`][Self::bookingDateComponents].
83        ///
84        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
85        #[unsafe(method(setBookingDateComponents:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setBookingDateComponents(&self, booking_date_components: &NSDateComponents);
88
89        #[unsafe(method(partySize))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn partySize(&self) -> NSUInteger;
92
93        /// Setter for [`partySize`][Self::partySize].
94        #[unsafe(method(setPartySize:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setPartySize(&self, party_size: NSUInteger);
97
98        #[unsafe(method(bookingIdentifier))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn bookingIdentifier(&self) -> Option<Retained<NSString>>;
101
102        /// Setter for [`bookingIdentifier`][Self::bookingIdentifier].
103        ///
104        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
105        #[unsafe(method(setBookingIdentifier:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn setBookingIdentifier(&self, booking_identifier: Option<&NSString>);
108
109        #[cfg(all(feature = "INPerson", feature = "INRestaurantGuest"))]
110        #[unsafe(method(guest))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn guest(&self) -> Option<Retained<INRestaurantGuest>>;
113
114        #[cfg(all(feature = "INPerson", feature = "INRestaurantGuest"))]
115        /// Setter for [`guest`][Self::guest].
116        ///
117        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
118        #[unsafe(method(setGuest:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setGuest(&self, guest: Option<&INRestaurantGuest>);
121
122        #[cfg(feature = "INRestaurantOffer")]
123        #[unsafe(method(selectedOffer))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn selectedOffer(&self) -> Option<Retained<INRestaurantOffer>>;
126
127        #[cfg(feature = "INRestaurantOffer")]
128        /// Setter for [`selectedOffer`][Self::selectedOffer].
129        ///
130        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
131        #[unsafe(method(setSelectedOffer:))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn setSelectedOffer(&self, selected_offer: Option<&INRestaurantOffer>);
134
135        #[unsafe(method(guestProvidedSpecialRequestText))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn guestProvidedSpecialRequestText(&self) -> Option<Retained<NSString>>;
138
139        /// Setter for [`guestProvidedSpecialRequestText`][Self::guestProvidedSpecialRequestText].
140        ///
141        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
142        #[unsafe(method(setGuestProvidedSpecialRequestText:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn setGuestProvidedSpecialRequestText(
145            &self,
146            guest_provided_special_request_text: Option<&NSString>,
147        );
148    );
149}
150
151/// Methods declared on superclass `NSObject`.
152#[cfg(feature = "INIntent")]
153impl INBookRestaurantReservationIntent {
154    extern_methods!(
155        #[unsafe(method(init))]
156        #[unsafe(method_family = init)]
157        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
158
159        #[unsafe(method(new))]
160        #[unsafe(method_family = new)]
161        pub unsafe fn new() -> Retained<Self>;
162    );
163}
164
165extern_protocol!(
166    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inbookrestaurantreservationintenthandling?language=objc)
167    pub unsafe trait INBookRestaurantReservationIntentHandling: NSObjectProtocol {
168        #[cfg(all(
169            feature = "INBookRestaurantReservationIntentResponse",
170            feature = "INIntent",
171            feature = "INIntentResponse",
172            feature = "block2"
173        ))]
174        /// Handling method - Execute the task represented by the INBookRestaurantReservationIntent that's passed in
175        ///
176        /// This method is called to actually execute the intent, the app must return a response for this intent and an NSUserActivity capturing the state that the app must be restored to at the end of handling this intent
177        ///
178        ///
179        /// Parameter `intent`: The input intent
180        ///
181        /// Parameter `completion`: The response handling block to invoke with the response to handling the intent.
182        ///
183        ///
184        /// See: INBookRestaurantReservationIntentResponse
185        #[unsafe(method(handleBookRestaurantReservation:completion:))]
186        #[unsafe(method_family = none)]
187        unsafe fn handleBookRestaurantReservation_completion(
188            &self,
189            intent: &INBookRestaurantReservationIntent,
190            completion: &block2::DynBlock<
191                dyn Fn(NonNull<INBookRestaurantReservationIntentResponse>),
192            >,
193        );
194
195        #[cfg(all(
196            feature = "INBookRestaurantReservationIntentResponse",
197            feature = "INIntent",
198            feature = "INIntentResponse",
199            feature = "block2"
200        ))]
201        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
202        ///
203        /// These methods are 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.
204        ///
205        ///
206        /// Parameter `intent`: The input intent
207        ///
208        /// Parameter `completion`: The response block contains an INBookRestaurantReservationIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
209        ///
210        ///
211        /// See: INEndWorkoutIntentResponse
212        #[optional]
213        #[unsafe(method(confirmBookRestaurantReservation:completion:))]
214        #[unsafe(method_family = none)]
215        unsafe fn confirmBookRestaurantReservation_completion(
216            &self,
217            intent: &INBookRestaurantReservationIntent,
218            completion: &block2::DynBlock<
219                dyn Fn(NonNull<INBookRestaurantReservationIntentResponse>),
220            >,
221        );
222
223        #[cfg(all(
224            feature = "INIntent",
225            feature = "INIntentResolutionResult",
226            feature = "INRestaurantResolutionResult",
227            feature = "block2"
228        ))]
229        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
230        ///
231        /// These methods are 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.
232        ///
233        ///
234        /// Parameter `intent`: The input intent
235        ///
236        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
237        ///
238        ///
239        /// See: INIntentResolutionResult
240        #[optional]
241        #[unsafe(method(resolveRestaurantForBookRestaurantReservation:withCompletion:))]
242        #[unsafe(method_family = none)]
243        unsafe fn resolveRestaurantForBookRestaurantReservation_withCompletion(
244            &self,
245            intent: &INBookRestaurantReservationIntent,
246            completion: &block2::DynBlock<dyn Fn(NonNull<INRestaurantResolutionResult>)>,
247        );
248
249        #[cfg(all(
250            feature = "INDateComponentsResolutionResult",
251            feature = "INIntent",
252            feature = "INIntentResolutionResult",
253            feature = "block2"
254        ))]
255        #[optional]
256        #[unsafe(method(resolveBookingDateComponentsForBookRestaurantReservation:withCompletion:))]
257        #[unsafe(method_family = none)]
258        unsafe fn resolveBookingDateComponentsForBookRestaurantReservation_withCompletion(
259            &self,
260            intent: &INBookRestaurantReservationIntent,
261            completion: &block2::DynBlock<dyn Fn(NonNull<INDateComponentsResolutionResult>)>,
262        );
263
264        #[cfg(all(
265            feature = "INIntegerResolutionResult",
266            feature = "INIntent",
267            feature = "INIntentResolutionResult",
268            feature = "block2"
269        ))]
270        #[optional]
271        #[unsafe(method(resolvePartySizeForBookRestaurantReservation:withCompletion:))]
272        #[unsafe(method_family = none)]
273        unsafe fn resolvePartySizeForBookRestaurantReservation_withCompletion(
274            &self,
275            intent: &INBookRestaurantReservationIntent,
276            completion: &block2::DynBlock<dyn Fn(NonNull<INIntegerResolutionResult>)>,
277        );
278
279        #[cfg(all(
280            feature = "INIntent",
281            feature = "INIntentResolutionResult",
282            feature = "INRestaurantGuestResolutionResult",
283            feature = "block2"
284        ))]
285        #[optional]
286        #[unsafe(method(resolveGuestForBookRestaurantReservation:withCompletion:))]
287        #[unsafe(method_family = none)]
288        unsafe fn resolveGuestForBookRestaurantReservation_withCompletion(
289            &self,
290            intent: &INBookRestaurantReservationIntent,
291            completion: &block2::DynBlock<dyn Fn(NonNull<INRestaurantGuestResolutionResult>)>,
292        );
293
294        #[cfg(all(
295            feature = "INIntent",
296            feature = "INIntentResolutionResult",
297            feature = "INStringResolutionResult",
298            feature = "block2"
299        ))]
300        #[optional]
301        #[unsafe(method(resolveGuestProvidedSpecialRequestTextForBookRestaurantReservation:withCompletion:))]
302        #[unsafe(method_family = none)]
303        unsafe fn resolveGuestProvidedSpecialRequestTextForBookRestaurantReservation_withCompletion(
304            &self,
305            intent: &INBookRestaurantReservationIntent,
306            completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
307        );
308    }
309);