objc2_intents/generated/
INRelevanceProvider.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-location")]
6use objc2_core_location::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11/// A relevant daily routine situation.
12///
13/// See also: INDailyRoutineRelevanceProvider
14///
15/// See also [Apple's documentation](https://developer.apple.com/documentation/intents/indailyroutinesituation?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct INDailyRoutineSituation(pub NSInteger);
20impl INDailyRoutineSituation {
21    /// A situation that occurs in the morning, around the time the user wakes up.
22    #[doc(alias = "INDailyRoutineSituationMorning")]
23    pub const Morning: Self = Self(0);
24    /// A situation that occurs in the evening, around the time the user goes to bed.
25    #[doc(alias = "INDailyRoutineSituationEvening")]
26    pub const Evening: Self = Self(1);
27    /// A situation that occurs when the user is at home.
28    ///
29    /// Note: Your app needs Always location authorization to use this situation.
30    ///
31    /// See also: CLLocationManager
32    #[doc(alias = "INDailyRoutineSituationHome")]
33    pub const Home: Self = Self(2);
34    /// A situation that occurs when the user is at work.
35    ///
36    /// Note: Your app needs Always location authorization to use this situation.
37    ///
38    /// See also: CLLocationManager
39    #[doc(alias = "INDailyRoutineSituationWork")]
40    pub const Work: Self = Self(3);
41    /// A situation that occurs when the user is at school.
42    ///
43    /// Note: Your app needs Always location authorization to use this situation.
44    ///
45    /// See also: CLLocationManager
46    #[doc(alias = "INDailyRoutineSituationSchool")]
47    pub const School: Self = Self(4);
48    /// A situation that occurs when the user is at the gym.
49    ///
50    /// Note: Your app needs Always location authorization to use this situation.
51    ///
52    /// See also: CLLocationManager
53    #[doc(alias = "INDailyRoutineSituationGym")]
54    pub const Gym: Self = Self(5);
55    /// A situation that occurs when the user is commuting, for example driving into work.
56    #[doc(alias = "INDailyRoutineSituationCommute")]
57    pub const Commute: Self = Self(6);
58    /// A situation that occurs when the user connects headphones.
59    #[doc(alias = "INDailyRoutineSituationHeadphonesConnected")]
60    pub const HeadphonesConnected: Self = Self(7);
61    /// A situation that occurs when the user is currently in a workout.
62    #[doc(alias = "INDailyRoutineSituationActiveWorkout")]
63    pub const ActiveWorkout: Self = Self(8);
64    /// A situation that occurs when the user is expected to perform more physical activity during the day.
65    #[doc(alias = "INDailyRoutineSituationPhysicalActivityIncomplete")]
66    pub const PhysicalActivityIncomplete: Self = Self(9);
67}
68
69unsafe impl Encode for INDailyRoutineSituation {
70    const ENCODING: Encoding = NSInteger::ENCODING;
71}
72
73unsafe impl RefEncode for INDailyRoutineSituation {
74    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
75}
76
77extern_class!(
78    /// A relevance provider represents a piece of relevance information that can be used by Siri when predicting relevant shortcuts.
79    ///
80    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inrelevanceprovider?language=objc)
81    #[unsafe(super(NSObject))]
82    #[derive(Debug, PartialEq, Eq, Hash)]
83    pub struct INRelevanceProvider;
84);
85
86extern_conformance!(
87    unsafe impl NSCoding for INRelevanceProvider {}
88);
89
90extern_conformance!(
91    unsafe impl NSCopying for INRelevanceProvider {}
92);
93
94unsafe impl CopyingHelper for INRelevanceProvider {
95    type Result = Self;
96}
97
98extern_conformance!(
99    unsafe impl NSObjectProtocol for INRelevanceProvider {}
100);
101
102extern_conformance!(
103    unsafe impl NSSecureCoding for INRelevanceProvider {}
104);
105
106impl INRelevanceProvider {
107    extern_methods!(
108        /// Note: `INRelevanceProvider`should not be initilaized directly. Use one of the subclasses instead.
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112    );
113}
114
115/// Methods declared on superclass `NSObject`.
116impl INRelevanceProvider {
117    extern_methods!(
118        #[unsafe(method(new))]
119        #[unsafe(method_family = new)]
120        pub unsafe fn new() -> Retained<Self>;
121    );
122}
123
124extern_class!(
125    /// A relevance provider to indicate relevance at a date or date interval.
126    ///
127    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/indaterelevanceprovider?language=objc)
128    #[unsafe(super(INRelevanceProvider, NSObject))]
129    #[derive(Debug, PartialEq, Eq, Hash)]
130    pub struct INDateRelevanceProvider;
131);
132
133extern_conformance!(
134    unsafe impl NSCoding for INDateRelevanceProvider {}
135);
136
137extern_conformance!(
138    unsafe impl NSCopying for INDateRelevanceProvider {}
139);
140
141unsafe impl CopyingHelper for INDateRelevanceProvider {
142    type Result = Self;
143}
144
145extern_conformance!(
146    unsafe impl NSObjectProtocol for INDateRelevanceProvider {}
147);
148
149extern_conformance!(
150    unsafe impl NSSecureCoding for INDateRelevanceProvider {}
151);
152
153impl INDateRelevanceProvider {
154    extern_methods!(
155        /// The start date of the relevant time interval.
156        #[unsafe(method(startDate))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn startDate(&self) -> Retained<NSDate>;
159
160        /// The end date of the relevant time interval.
161        ///
162        /// Note: If
163        /// `endDate`is
164        /// `nil,`the relevant time interval will be assumed to represent a single point in time instead of a time interval.
165        #[unsafe(method(endDate))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
168
169        /// Initializes a date relevance provider with the specified relevant date interval.
170        #[unsafe(method(initWithStartDate:endDate:))]
171        #[unsafe(method_family = init)]
172        pub unsafe fn initWithStartDate_endDate(
173            this: Allocated<Self>,
174            start_date: &NSDate,
175            end_date: Option<&NSDate>,
176        ) -> Retained<Self>;
177    );
178}
179
180/// Methods declared on superclass `INRelevanceProvider`.
181impl INDateRelevanceProvider {
182    extern_methods!(
183        /// Note: `INRelevanceProvider`should not be initilaized directly. Use one of the subclasses instead.
184        #[unsafe(method(init))]
185        #[unsafe(method_family = init)]
186        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
187    );
188}
189
190/// Methods declared on superclass `NSObject`.
191impl INDateRelevanceProvider {
192    extern_methods!(
193        #[unsafe(method(new))]
194        #[unsafe(method_family = new)]
195        pub unsafe fn new() -> Retained<Self>;
196    );
197}
198
199extern_class!(
200    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inlocationrelevanceprovider?language=objc)
201    #[unsafe(super(INRelevanceProvider, NSObject))]
202    #[derive(Debug, PartialEq, Eq, Hash)]
203    pub struct INLocationRelevanceProvider;
204);
205
206extern_conformance!(
207    unsafe impl NSCoding for INLocationRelevanceProvider {}
208);
209
210extern_conformance!(
211    unsafe impl NSCopying for INLocationRelevanceProvider {}
212);
213
214unsafe impl CopyingHelper for INLocationRelevanceProvider {
215    type Result = Self;
216}
217
218extern_conformance!(
219    unsafe impl NSObjectProtocol for INLocationRelevanceProvider {}
220);
221
222extern_conformance!(
223    unsafe impl NSSecureCoding for INLocationRelevanceProvider {}
224);
225
226impl INLocationRelevanceProvider {
227    extern_methods!(
228        #[cfg(feature = "objc2-core-location")]
229        /// The region representing the relevant location.
230        ///
231        /// See also: CLCircularRegion
232        #[unsafe(method(region))]
233        #[unsafe(method_family = none)]
234        pub unsafe fn region(&self) -> Retained<CLRegion>;
235
236        #[cfg(feature = "objc2-core-location")]
237        /// Initializes a location relevance provider with the specified region.
238        #[unsafe(method(initWithRegion:))]
239        #[unsafe(method_family = init)]
240        pub unsafe fn initWithRegion(this: Allocated<Self>, region: &CLRegion) -> Retained<Self>;
241    );
242}
243
244/// Methods declared on superclass `INRelevanceProvider`.
245impl INLocationRelevanceProvider {
246    extern_methods!(
247        /// Note: `INRelevanceProvider`should not be initilaized directly. Use one of the subclasses instead.
248        #[unsafe(method(init))]
249        #[unsafe(method_family = init)]
250        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
251    );
252}
253
254/// Methods declared on superclass `NSObject`.
255impl INLocationRelevanceProvider {
256    extern_methods!(
257        #[unsafe(method(new))]
258        #[unsafe(method_family = new)]
259        pub unsafe fn new() -> Retained<Self>;
260    );
261}
262
263extern_class!(
264    /// A relevance provider that specifies relevance during a specific situation.
265    ///
266    /// See also: INDailyRoutineSituation
267    ///
268    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/indailyroutinerelevanceprovider?language=objc)
269    #[unsafe(super(INRelevanceProvider, NSObject))]
270    #[derive(Debug, PartialEq, Eq, Hash)]
271    pub struct INDailyRoutineRelevanceProvider;
272);
273
274extern_conformance!(
275    unsafe impl NSCoding for INDailyRoutineRelevanceProvider {}
276);
277
278extern_conformance!(
279    unsafe impl NSCopying for INDailyRoutineRelevanceProvider {}
280);
281
282unsafe impl CopyingHelper for INDailyRoutineRelevanceProvider {
283    type Result = Self;
284}
285
286extern_conformance!(
287    unsafe impl NSObjectProtocol for INDailyRoutineRelevanceProvider {}
288);
289
290extern_conformance!(
291    unsafe impl NSSecureCoding for INDailyRoutineRelevanceProvider {}
292);
293
294impl INDailyRoutineRelevanceProvider {
295    extern_methods!(
296        /// The relevant daily routine situation of the provider.
297        #[unsafe(method(situation))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn situation(&self) -> INDailyRoutineSituation;
300
301        /// Initializes a daily routine relevance provider with the specified situation.
302        #[unsafe(method(initWithSituation:))]
303        #[unsafe(method_family = init)]
304        pub unsafe fn initWithSituation(
305            this: Allocated<Self>,
306            situation: INDailyRoutineSituation,
307        ) -> Retained<Self>;
308    );
309}
310
311/// Methods declared on superclass `INRelevanceProvider`.
312impl INDailyRoutineRelevanceProvider {
313    extern_methods!(
314        /// Note: `INRelevanceProvider`should not be initilaized directly. Use one of the subclasses instead.
315        #[unsafe(method(init))]
316        #[unsafe(method_family = init)]
317        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
318    );
319}
320
321/// Methods declared on superclass `NSObject`.
322impl INDailyRoutineRelevanceProvider {
323    extern_methods!(
324        #[unsafe(method(new))]
325        #[unsafe(method_family = new)]
326        pub unsafe fn new() -> Retained<Self>;
327    );
328}