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

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

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

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

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

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

#[cfg(feature = "INIntent")]
impl INSendRideFeedbackIntent {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initWithRideIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithRideIdentifier(
            this: Allocated<Self>,
            ride_identifier: &NSString,
        ) -> Retained<Self>;

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

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

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

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

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

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

extern_protocol!(
    /// Protocol to declare support for handling an INSendRideFeedbackIntent. By implementing this protocol, a class can provide logic for confirming and handling the intent.
    ///
    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The handling method is always called last, after confirming the intent.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insendridefeedbackintenthandling?language=objc)
    pub unsafe trait INSendRideFeedbackIntentHandling: NSObjectProtocol {
        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "INSendRideFeedbackIntentResponse",
            feature = "block2"
        ))]
        /// Handling method - Execute the task represented by the INSendRideFeedbackIntent that's passed in
        ///
        /// Called to actually execute the intent. The app must return a response for this intent.
        ///
        ///
        /// Parameter `sendRideFeedbackintent`: The input intent
        ///
        /// Parameter `completion`: The response handling block takes a INSendRideFeedbackIntentResponse containing the details of the result of having executed the intent
        ///
        ///
        /// See: INSendRideFeedbackIntentResponse
        #[unsafe(method(handleSendRideFeedback:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn handleSendRideFeedback_completion(
            &self,
            send_ride_feedbackintent: &INSendRideFeedbackIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSendRideFeedbackIntentResponse>)>,
        );

        #[cfg(all(
            feature = "INIntent",
            feature = "INIntentResponse",
            feature = "INSendRideFeedbackIntentResponse",
            feature = "block2"
        ))]
        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
        ///
        /// 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 not allow calling of the handle method.
        ///
        ///
        /// Parameter `sendRideFeedbackIntent`: The input intent
        ///
        /// Parameter `completion`: The response block contains an INSendRideFeedbackIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
        ///
        ///
        /// See: INSendRideFeedbackIntentResponse
        #[optional]
        #[unsafe(method(confirmSendRideFeedback:completion:))]
        #[unsafe(method_family = none)]
        unsafe fn confirmSendRideFeedback_completion(
            &self,
            send_ride_feedback_intent: &INSendRideFeedbackIntent,
            completion: &block2::DynBlock<dyn Fn(NonNull<INSendRideFeedbackIntentResponse>)>,
        );
    }
);