objc2-intents 0.3.2

Bindings to the Intents framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inbookrestaurantreservationintent?language=objc)
    #[unsafe(super(INIntent, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "INIntent")]
    pub struct INBookRestaurantReservationIntent;
);

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSCoding for INBookRestaurantReservationIntent {}
);

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSCopying for INBookRestaurantReservationIntent {}
);

#[cfg(feature = "INIntent")]
unsafe impl CopyingHelper for INBookRestaurantReservationIntent {
    type Result = Self;
}

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSObjectProtocol for INBookRestaurantReservationIntent {}
);

#[cfg(feature = "INIntent")]
extern_conformance!(
    unsafe impl NSSecureCoding for INBookRestaurantReservationIntent {}
);

#[cfg(feature = "INIntent")]
impl INBookRestaurantReservationIntent {
    extern_methods!(
        #[cfg(all(
            feature = "INPerson",
            feature = "INRestaurant",
            feature = "INRestaurantGuest",
            feature = "INRestaurantOffer"
        ))]
        #[unsafe(method(initWithRestaurant:bookingDateComponents:partySize:bookingIdentifier:guest:selectedOffer:guestProvidedSpecialRequestText:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRestaurant_bookingDateComponents_partySize_bookingIdentifier_guest_selectedOffer_guestProvidedSpecialRequestText(
            this: Allocated<Self>,
            restaurant: &INRestaurant,
            booking_date_components: &NSDateComponents,
            party_size: NSUInteger,
            booking_identifier: Option<&NSString>,
            guest: Option<&INRestaurantGuest>,
            selected_offer: Option<&INRestaurantOffer>,
            guest_provided_special_request_text: Option<&NSString>,
        ) -> Retained<Self>;

        #[cfg(feature = "INRestaurant")]
        #[unsafe(method(restaurant))]
        #[unsafe(method_family = none)]
        pub unsafe fn restaurant(&self) -> Retained<INRestaurant>;

        #[cfg(feature = "INRestaurant")]
        /// Setter for [`restaurant`][Self::restaurant].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setRestaurant:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRestaurant(&self, restaurant: &INRestaurant);

        #[unsafe(method(bookingDateComponents))]
        #[unsafe(method_family = none)]
        pub unsafe fn bookingDateComponents(&self) -> Retained<NSDateComponents>;

        /// Setter for [`bookingDateComponents`][Self::bookingDateComponents].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBookingDateComponents:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBookingDateComponents(&self, booking_date_components: &NSDateComponents);

        #[unsafe(method(partySize))]
        #[unsafe(method_family = none)]
        pub unsafe fn partySize(&self) -> NSUInteger;

        /// Setter for [`partySize`][Self::partySize].
        #[unsafe(method(setPartySize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPartySize(&self, party_size: NSUInteger);

        #[unsafe(method(bookingIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn bookingIdentifier(&self) -> Option<Retained<NSString>>;

        /// Setter for [`bookingIdentifier`][Self::bookingIdentifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBookingIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBookingIdentifier(&self, booking_identifier: Option<&NSString>);

        #[cfg(all(feature = "INPerson", feature = "INRestaurantGuest"))]
        #[unsafe(method(guest))]
        #[unsafe(method_family = none)]
        pub unsafe fn guest(&self) -> Option<Retained<INRestaurantGuest>>;

        #[cfg(all(feature = "INPerson", feature = "INRestaurantGuest"))]
        /// Setter for [`guest`][Self::guest].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setGuest:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setGuest(&self, guest: Option<&INRestaurantGuest>);

        #[cfg(feature = "INRestaurantOffer")]
        #[unsafe(method(selectedOffer))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedOffer(&self) -> Option<Retained<INRestaurantOffer>>;

        #[cfg(feature = "INRestaurantOffer")]
        /// Setter for [`selectedOffer`][Self::selectedOffer].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSelectedOffer:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectedOffer(&self, selected_offer: Option<&INRestaurantOffer>);

        #[unsafe(method(guestProvidedSpecialRequestText))]
        #[unsafe(method_family = none)]
        pub unsafe fn guestProvidedSpecialRequestText(&self) -> Option<Retained<NSString>>;

        /// Setter for [`guestProvidedSpecialRequestText`][Self::guestProvidedSpecialRequestText].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setGuestProvidedSpecialRequestText:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setGuestProvidedSpecialRequestText(
            &self,
            guest_provided_special_request_text: Option<&NSString>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "INIntent")]
impl INBookRestaurantReservationIntent {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inbookrestaurantreservationintenthandling?language=objc)
    pub unsafe trait INBookRestaurantReservationIntentHandling: NSObjectProtocol {
        #[cfg(all(
            feature = "INBookRestaurantReservationIntentResponse",
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "block2"
        ))]
        /// Handling method - Execute the task represented by the INBookRestaurantReservationIntent that's passed in
        ///
        /// 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
        ///
        ///
        /// Parameter `intent`: The input intent
        ///
        /// Parameter `completion`: The response handling block to invoke with the response to handling the intent.
        ///
        ///
        /// See: INBookRestaurantReservationIntentResponse
        #[unsafe(method(handleBookRestaurantReservation:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn handleBookRestaurantReservation_completion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<
                dyn Fn(NonNull<INBookRestaurantReservationIntentResponse>),
            >,
        );

        #[cfg(all(
            feature = "INBookRestaurantReservationIntentResponse",
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "block2"
        ))]
        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
        ///
        /// 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.
        ///
        ///
        /// Parameter `intent`: The input intent
        ///
        /// 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.
        ///
        ///
        /// See: INEndWorkoutIntentResponse
        #[optional]
        #[unsafe(method(confirmBookRestaurantReservation:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn confirmBookRestaurantReservation_completion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<
                dyn Fn(NonNull<INBookRestaurantReservationIntentResponse>),
            >,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INRestaurantResolutionResult",
            feature = "block2"
        ))]
        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
        ///
        /// 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.
        ///
        ///
        /// Parameter `intent`: The input intent
        ///
        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
        ///
        ///
        /// See: INIntentResolutionResult
        #[optional]
        #[unsafe(method(resolveRestaurantForBookRestaurantReservation:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveRestaurantForBookRestaurantReservation_withCompletion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INRestaurantResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INDateComponentsResolutionResult",
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveBookingDateComponentsForBookRestaurantReservation:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveBookingDateComponentsForBookRestaurantReservation_withCompletion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INDateComponentsResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntegerResolutionResult",
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolvePartySizeForBookRestaurantReservation:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolvePartySizeForBookRestaurantReservation_withCompletion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INIntegerResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INRestaurantGuestResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveGuestForBookRestaurantReservation:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveGuestForBookRestaurantReservation_withCompletion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INRestaurantGuestResolutionResult>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResolutionResult",
            feature = "INStringResolutionResult",
            feature = "block2"
        ))]
        #[optional]
        #[unsafe(method(resolveGuestProvidedSpecialRequestTextForBookRestaurantReservation:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveGuestProvidedSpecialRequestTextForBookRestaurantReservation_withCompletion(
            &self,
            intent: &INBookRestaurantReservationIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INStringResolutionResult>)>,
        );
    }
);