objc2_intents/generated/
INSendRideFeedbackIntent.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/insendridefeedbackintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INSendRideFeedbackIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INSendRideFeedbackIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INSendRideFeedbackIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INSendRideFeedbackIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INSendRideFeedbackIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INSendRideFeedbackIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INSendRideFeedbackIntent {
45    extern_methods!(
46        #[unsafe(method(init))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
49
50        #[unsafe(method(initWithRideIdentifier:))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn initWithRideIdentifier(
53            this: Allocated<Self>,
54            ride_identifier: &NSString,
55        ) -> Retained<Self>;
56
57        #[unsafe(method(rideIdentifier))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn rideIdentifier(&self) -> Retained<NSString>;
60
61        #[unsafe(method(rating))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn rating(&self) -> Option<Retained<NSNumber>>;
64
65        /// Setter for [`rating`][Self::rating].
66        ///
67        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
68        #[unsafe(method(setRating:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setRating(&self, rating: Option<&NSNumber>);
71
72        #[cfg(feature = "INCurrencyAmount")]
73        #[unsafe(method(tip))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn tip(&self) -> Option<Retained<INCurrencyAmount>>;
76
77        #[cfg(feature = "INCurrencyAmount")]
78        /// Setter for [`tip`][Self::tip].
79        ///
80        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
81        #[unsafe(method(setTip:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setTip(&self, tip: Option<&INCurrencyAmount>);
84    );
85}
86
87/// Methods declared on superclass `NSObject`.
88#[cfg(feature = "INIntent")]
89impl INSendRideFeedbackIntent {
90    extern_methods!(
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}
96
97extern_protocol!(
98    /// Protocol to declare support for handling an INSendRideFeedbackIntent. By implementing this protocol, a class can provide logic for confirming and handling the intent.
99    ///
100    /// 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.
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insendridefeedbackintenthandling?language=objc)
103    pub unsafe trait INSendRideFeedbackIntentHandling: NSObjectProtocol {
104        #[cfg(all(
105            feature = "INIntent",
106            feature = "INIntentResponse",
107            feature = "INSendRideFeedbackIntentResponse",
108            feature = "block2"
109        ))]
110        /// Handling method - Execute the task represented by the INSendRideFeedbackIntent that's passed in
111        ///
112        /// Called to actually execute the intent. The app must return a response for this intent.
113        ///
114        ///
115        /// Parameter `sendRideFeedbackintent`: The input intent
116        ///
117        /// Parameter `completion`: The response handling block takes a INSendRideFeedbackIntentResponse containing the details of the result of having executed the intent
118        ///
119        ///
120        /// See: INSendRideFeedbackIntentResponse
121        #[unsafe(method(handleSendRideFeedback:completion:))]
122        #[unsafe(method_family = none)]
123        unsafe fn handleSendRideFeedback_completion(
124            &self,
125            send_ride_feedbackintent: &INSendRideFeedbackIntent,
126            completion: &block2::DynBlock<dyn Fn(NonNull<INSendRideFeedbackIntentResponse>)>,
127        );
128
129        #[cfg(all(
130            feature = "INIntent",
131            feature = "INIntentResponse",
132            feature = "INSendRideFeedbackIntentResponse",
133            feature = "block2"
134        ))]
135        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
136        ///
137        /// 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.
138        ///
139        ///
140        /// Parameter `sendRideFeedbackIntent`: The input intent
141        ///
142        /// 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.
143        ///
144        ///
145        /// See: INSendRideFeedbackIntentResponse
146        #[optional]
147        #[unsafe(method(confirmSendRideFeedback:completion:))]
148        #[unsafe(method_family = none)]
149        unsafe fn confirmSendRideFeedback_completion(
150            &self,
151            send_ride_feedback_intent: &INSendRideFeedbackIntent,
152            completion: &block2::DynBlock<dyn Fn(NonNull<INSendRideFeedbackIntentResponse>)>,
153        );
154    }
155);