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/ingetusercurrentrestaurantreservationbookingsintent?language=objc)
    #[unsafe(super(INIntent, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "INIntent")]
    pub struct INGetUserCurrentRestaurantReservationBookingsIntent;
);

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

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

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

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

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

#[cfg(feature = "INIntent")]
impl INGetUserCurrentRestaurantReservationBookingsIntent {
    extern_methods!(
        #[cfg(feature = "INRestaurant")]
        #[unsafe(method(initWithRestaurant:reservationIdentifier:maximumNumberOfResults:earliestBookingDateForResults:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRestaurant_reservationIdentifier_maximumNumberOfResults_earliestBookingDateForResults(
            this: Allocated<Self>,
            restaurant: Option<&INRestaurant>,
            reservation_identifier: Option<&NSString>,
            maximum_number_of_results: Option<&NSNumber>,
            earliest_booking_date_for_results: Option<&NSDate>,
        ) -> Retained<Self>;

        #[cfg(feature = "INRestaurant")]
        #[unsafe(method(restaurant))]
        #[unsafe(method_family = none)]
        pub unsafe fn restaurant(&self) -> Option<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: Option<&INRestaurant>);

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

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

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

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

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

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

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "INIntent")]
impl INGetUserCurrentRestaurantReservationBookingsIntent {
    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/ingetusercurrentrestaurantreservationbookingsintenthandling?language=objc)
    pub unsafe trait INGetUserCurrentRestaurantReservationBookingsIntentHandling:
        NSObjectProtocol
    {
        #[cfg(all(
            feature = "INGetUserCurrentRestaurantReservationBookingsIntentResponse",
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "block2"
        ))]
        /// Handling method - Execute the task represented by the INGetUserCurrentRestaurantReservationBookingsIntent 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: INGetUserCurrentRestaurantReservationBookingsIntentResponse
        #[unsafe(method(handleGetUserCurrentRestaurantReservationBookings:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn handleGetUserCurrentRestaurantReservationBookings_completion(
            &self,
            intent: &INGetUserCurrentRestaurantReservationBookingsIntent,
            completion: &block2::DynBlock<
                dyn Fn(NonNull<INGetUserCurrentRestaurantReservationBookingsIntentResponse>),
            >,
        );

        #[cfg(all(
            feature = "INGetUserCurrentRestaurantReservationBookingsIntentResponse",
            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 INGetUserCurrentRestaurantReservationBookingsIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
        ///
        ///
        /// See: INGetUserCurrentRestaurantReservationBookingsIntentResponse
        #[optional]
        #[unsafe(method(confirmGetUserCurrentRestaurantReservationBookings:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn confirmGetUserCurrentRestaurantReservationBookings_completion(
            &self,
            intent: &INGetUserCurrentRestaurantReservationBookingsIntent,
            completion: &block2::DynBlock<
                dyn Fn(NonNull<INGetUserCurrentRestaurantReservationBookingsIntentResponse>),
            >,
        );

        #[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: INGetUserCurrentRestaurantReservationBookingsIntentResponse
        #[optional]
        #[unsafe(method(resolveRestaurantForGetUserCurrentRestaurantReservationBookings:withCompletion:))]
        #[unsafe(method_family = none)]
        unsafe fn resolveRestaurantForGetUserCurrentRestaurantReservationBookings_withCompletion(
            &self,
            intent: &INGetUserCurrentRestaurantReservationBookingsIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INRestaurantResolutionResult>)>,
        );
    }
);