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/inrestaurantreservationbooking?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct INRestaurantReservationBooking;
);

extern_conformance!(
    unsafe impl NSCoding for INRestaurantReservationBooking {}
);

extern_conformance!(
    unsafe impl NSCopying for INRestaurantReservationBooking {}
);

unsafe impl CopyingHelper for INRestaurantReservationBooking {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for INRestaurantReservationBooking {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for INRestaurantReservationBooking {}
);

impl INRestaurantReservationBooking {
    extern_methods!(
        #[cfg(feature = "INRestaurant")]
        #[unsafe(method(initWithRestaurant:bookingDate:partySize:bookingIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRestaurant_bookingDate_partySize_bookingIdentifier(
            this: Allocated<Self>,
            restaurant: &INRestaurant,
            booking_date: &NSDate,
            party_size: NSUInteger,
            booking_identifier: &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(bookingDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn bookingDescription(&self) -> Option<Retained<NSString>>;

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

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

        /// Setter for [`bookingDate`][Self::bookingDate].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBookingDate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBookingDate(&self, booking_date: &NSDate);

        #[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) -> 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: &NSString);

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

        /// Setter for [`isBookingAvailable`][Self::isBookingAvailable].
        #[unsafe(method(setBookingAvailable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBookingAvailable(&self, booking_available: bool);

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

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

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

        /// Setter for [`requiresManualRequest`][Self::requiresManualRequest].
        #[unsafe(method(setRequiresManualRequest:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRequiresManualRequest(&self, requires_manual_request: bool);

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

        /// Setter for [`requiresEmailAddress`][Self::requiresEmailAddress].
        #[unsafe(method(setRequiresEmailAddress:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRequiresEmailAddress(&self, requires_email_address: bool);

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

        /// Setter for [`requiresName`][Self::requiresName].
        #[unsafe(method(setRequiresName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRequiresName(&self, requires_name: bool);

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

        /// Setter for [`requiresPhoneNumber`][Self::requiresPhoneNumber].
        #[unsafe(method(setRequiresPhoneNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRequiresPhoneNumber(&self, requires_phone_number: bool);
    );
}

/// Methods declared on superclass `NSObject`.
impl INRestaurantReservationBooking {
    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>;
    );
}