objc2_intents/generated/
INInteraction.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/inintenthandlingstatus?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INIntentHandlingStatus(pub NSInteger);
15impl INIntentHandlingStatus {
16    #[doc(alias = "INIntentHandlingStatusUnspecified")]
17    pub const Unspecified: Self = Self(0);
18    #[doc(alias = "INIntentHandlingStatusReady")]
19    pub const Ready: Self = Self(1);
20    #[doc(alias = "INIntentHandlingStatusInProgress")]
21    pub const InProgress: Self = Self(2);
22    #[doc(alias = "INIntentHandlingStatusSuccess")]
23    pub const Success: Self = Self(3);
24    #[doc(alias = "INIntentHandlingStatusFailure")]
25    pub const Failure: Self = Self(4);
26    #[doc(alias = "INIntentHandlingStatusDeferredToApplication")]
27    pub const DeferredToApplication: Self = Self(5);
28    #[doc(alias = "INIntentHandlingStatusUserConfirmationRequired")]
29    pub const UserConfirmationRequired: Self = Self(6);
30}
31
32unsafe impl Encode for INIntentHandlingStatus {
33    const ENCODING: Encoding = NSInteger::ENCODING;
34}
35
36unsafe impl RefEncode for INIntentHandlingStatus {
37    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40/// [Apple's documentation](https://developer.apple.com/documentation/intents/ininteractiondirection?language=objc)
41// NS_ENUM
42#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct INInteractionDirection(pub NSInteger);
45impl INInteractionDirection {
46    #[doc(alias = "INInteractionDirectionUnspecified")]
47    pub const Unspecified: Self = Self(0);
48    #[doc(alias = "INInteractionDirectionOutgoing")]
49    pub const Outgoing: Self = Self(1);
50    #[doc(alias = "INInteractionDirectionIncoming")]
51    pub const Incoming: Self = Self(2);
52}
53
54unsafe impl Encode for INInteractionDirection {
55    const ENCODING: Encoding = NSInteger::ENCODING;
56}
57
58unsafe impl RefEncode for INInteractionDirection {
59    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62extern_class!(
63    /// [Apple's documentation](https://developer.apple.com/documentation/intents/ininteraction?language=objc)
64    #[unsafe(super(NSObject))]
65    #[derive(Debug, PartialEq, Eq, Hash)]
66    pub struct INInteraction;
67);
68
69extern_conformance!(
70    unsafe impl NSCoding for INInteraction {}
71);
72
73extern_conformance!(
74    unsafe impl NSCopying for INInteraction {}
75);
76
77unsafe impl CopyingHelper for INInteraction {
78    type Result = Self;
79}
80
81extern_conformance!(
82    unsafe impl NSObjectProtocol for INInteraction {}
83);
84
85extern_conformance!(
86    unsafe impl NSSecureCoding for INInteraction {}
87);
88
89impl INInteraction {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[cfg(all(feature = "INIntent", feature = "INIntentResponse"))]
96        #[unsafe(method(initWithIntent:response:))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithIntent_response(
99            this: Allocated<Self>,
100            intent: &INIntent,
101            response: Option<&INIntentResponse>,
102        ) -> Retained<Self>;
103
104        #[cfg(feature = "block2")]
105        #[unsafe(method(donateInteractionWithCompletion:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn donateInteractionWithCompletion(
108            &self,
109            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
110        );
111
112        #[cfg(feature = "block2")]
113        #[unsafe(method(deleteAllInteractionsWithCompletion:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn deleteAllInteractionsWithCompletion(
116            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
117        );
118
119        #[cfg(feature = "block2")]
120        #[unsafe(method(deleteInteractionsWithIdentifiers:completion:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn deleteInteractionsWithIdentifiers_completion(
123            identifiers: &NSArray<NSString>,
124            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
125        );
126
127        #[cfg(feature = "block2")]
128        #[unsafe(method(deleteInteractionsWithGroupIdentifier:completion:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn deleteInteractionsWithGroupIdentifier_completion(
131            group_identifier: &NSString,
132            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
133        );
134
135        #[cfg(feature = "INIntent")]
136        #[unsafe(method(intent))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn intent(&self) -> Retained<INIntent>;
139
140        #[cfg(feature = "INIntentResponse")]
141        #[unsafe(method(intentResponse))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn intentResponse(&self) -> Option<Retained<INIntentResponse>>;
144
145        #[unsafe(method(intentHandlingStatus))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn intentHandlingStatus(&self) -> INIntentHandlingStatus;
148
149        #[unsafe(method(direction))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn direction(&self) -> INInteractionDirection;
152
153        /// Setter for [`direction`][Self::direction].
154        #[unsafe(method(setDirection:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn setDirection(&self, direction: INInteractionDirection);
157
158        #[unsafe(method(dateInterval))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn dateInterval(&self) -> Option<Retained<NSDateInterval>>;
161
162        /// Setter for [`dateInterval`][Self::dateInterval].
163        ///
164        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
165        #[unsafe(method(setDateInterval:))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn setDateInterval(&self, date_interval: Option<&NSDateInterval>);
168
169        #[unsafe(method(identifier))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn identifier(&self) -> Retained<NSString>;
172
173        /// Setter for [`identifier`][Self::identifier].
174        ///
175        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
176        #[unsafe(method(setIdentifier:))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn setIdentifier(&self, identifier: &NSString);
179
180        #[unsafe(method(groupIdentifier))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn groupIdentifier(&self) -> Option<Retained<NSString>>;
183
184        /// Setter for [`groupIdentifier`][Self::groupIdentifier].
185        ///
186        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
187        #[unsafe(method(setGroupIdentifier:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn setGroupIdentifier(&self, group_identifier: Option<&NSString>);
190    );
191}
192
193/// Methods declared on superclass `NSObject`.
194impl INInteraction {
195    extern_methods!(
196        #[unsafe(method(new))]
197        #[unsafe(method_family = new)]
198        pub unsafe fn new() -> Retained<Self>;
199    );
200}