objc2_intents/generated/
INCancelRideIntentResponse.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
10/// [Apple's documentation](https://developer.apple.com/documentation/intents/incancelrideintentresponsecode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INCancelRideIntentResponseCode(pub NSInteger);
15impl INCancelRideIntentResponseCode {
16    #[doc(alias = "INCancelRideIntentResponseCodeUnspecified")]
17    pub const Unspecified: Self = Self(0);
18    #[doc(alias = "INCancelRideIntentResponseCodeReady")]
19    pub const Ready: Self = Self(1);
20    #[doc(alias = "INCancelRideIntentResponseCodeSuccess")]
21    pub const Success: Self = Self(2);
22    #[doc(alias = "INCancelRideIntentResponseCodeFailure")]
23    pub const Failure: Self = Self(3);
24}
25
26unsafe impl Encode for INCancelRideIntentResponseCode {
27    const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for INCancelRideIntentResponseCode {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35    /// [Apple's documentation](https://developer.apple.com/documentation/intents/incancelrideintentresponse?language=objc)
36    #[unsafe(super(INIntentResponse, NSObject))]
37    #[derive(Debug, PartialEq, Eq, Hash)]
38    #[cfg(feature = "INIntentResponse")]
39    pub struct INCancelRideIntentResponse;
40);
41
42#[cfg(feature = "INIntentResponse")]
43extern_conformance!(
44    unsafe impl NSCoding for INCancelRideIntentResponse {}
45);
46
47#[cfg(feature = "INIntentResponse")]
48extern_conformance!(
49    unsafe impl NSCopying for INCancelRideIntentResponse {}
50);
51
52#[cfg(feature = "INIntentResponse")]
53unsafe impl CopyingHelper for INCancelRideIntentResponse {
54    type Result = Self;
55}
56
57#[cfg(feature = "INIntentResponse")]
58extern_conformance!(
59    unsafe impl NSObjectProtocol for INCancelRideIntentResponse {}
60);
61
62#[cfg(feature = "INIntentResponse")]
63extern_conformance!(
64    unsafe impl NSSecureCoding for INCancelRideIntentResponse {}
65);
66
67#[cfg(feature = "INIntentResponse")]
68impl INCancelRideIntentResponse {
69    extern_methods!(
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74        #[unsafe(method(initWithCode:userActivity:))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn initWithCode_userActivity(
77            this: Allocated<Self>,
78            code: INCancelRideIntentResponseCode,
79            user_activity: Option<&NSUserActivity>,
80        ) -> Retained<Self>;
81
82        #[unsafe(method(code))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn code(&self) -> INCancelRideIntentResponseCode;
85
86        #[cfg(feature = "INCurrencyAmount")]
87        #[unsafe(method(cancellationFee))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn cancellationFee(&self) -> Option<Retained<INCurrencyAmount>>;
90
91        #[cfg(feature = "INCurrencyAmount")]
92        /// Setter for [`cancellationFee`][Self::cancellationFee].
93        ///
94        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
95        #[unsafe(method(setCancellationFee:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setCancellationFee(&self, cancellation_fee: Option<&INCurrencyAmount>);
98
99        #[unsafe(method(cancellationFeeThreshold))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn cancellationFeeThreshold(&self) -> Option<Retained<NSDateComponents>>;
102
103        /// Setter for [`cancellationFeeThreshold`][Self::cancellationFeeThreshold].
104        ///
105        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
106        #[unsafe(method(setCancellationFeeThreshold:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setCancellationFeeThreshold(
109            &self,
110            cancellation_fee_threshold: Option<&NSDateComponents>,
111        );
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116#[cfg(feature = "INIntentResponse")]
117impl INCancelRideIntentResponse {
118    extern_methods!(
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}