objc2_intents/generated/
INStartWorkoutIntentResponse.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::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/intents/instartworkoutintentresponsecode?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct INStartWorkoutIntentResponseCode(pub NSInteger);
14impl INStartWorkoutIntentResponseCode {
15    #[doc(alias = "INStartWorkoutIntentResponseCodeUnspecified")]
16    pub const Unspecified: Self = Self(0);
17    #[doc(alias = "INStartWorkoutIntentResponseCodeReady")]
18    pub const Ready: Self = Self(1);
19    #[doc(alias = "INStartWorkoutIntentResponseCodeContinueInApp")]
20    pub const ContinueInApp: Self = Self(2);
21    #[doc(alias = "INStartWorkoutIntentResponseCodeFailure")]
22    pub const Failure: Self = Self(3);
23    #[doc(alias = "INStartWorkoutIntentResponseCodeFailureRequiringAppLaunch")]
24    pub const FailureRequiringAppLaunch: Self = Self(4);
25    #[doc(alias = "INStartWorkoutIntentResponseCodeFailureOngoingWorkout")]
26    pub const FailureOngoingWorkout: Self = Self(5);
27    #[doc(alias = "INStartWorkoutIntentResponseCodeFailureNoMatchingWorkout")]
28    pub const FailureNoMatchingWorkout: Self = Self(6);
29    #[doc(alias = "INStartWorkoutIntentResponseCodeHandleInApp")]
30    pub const HandleInApp: Self = Self(7);
31    #[doc(alias = "INStartWorkoutIntentResponseCodeSuccess")]
32    pub const Success: Self = Self(8);
33}
34
35unsafe impl Encode for INStartWorkoutIntentResponseCode {
36    const ENCODING: Encoding = NSInteger::ENCODING;
37}
38
39unsafe impl RefEncode for INStartWorkoutIntentResponseCode {
40    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
41}
42
43extern_class!(
44    /// [Apple's documentation](https://developer.apple.com/documentation/intents/instartworkoutintentresponse?language=objc)
45    #[unsafe(super(INIntentResponse, NSObject))]
46    #[derive(Debug, PartialEq, Eq, Hash)]
47    #[cfg(feature = "INIntentResponse")]
48    pub struct INStartWorkoutIntentResponse;
49);
50
51#[cfg(feature = "INIntentResponse")]
52extern_conformance!(
53    unsafe impl NSCoding for INStartWorkoutIntentResponse {}
54);
55
56#[cfg(feature = "INIntentResponse")]
57extern_conformance!(
58    unsafe impl NSCopying for INStartWorkoutIntentResponse {}
59);
60
61#[cfg(feature = "INIntentResponse")]
62unsafe impl CopyingHelper for INStartWorkoutIntentResponse {
63    type Result = Self;
64}
65
66#[cfg(feature = "INIntentResponse")]
67extern_conformance!(
68    unsafe impl NSObjectProtocol for INStartWorkoutIntentResponse {}
69);
70
71#[cfg(feature = "INIntentResponse")]
72extern_conformance!(
73    unsafe impl NSSecureCoding for INStartWorkoutIntentResponse {}
74);
75
76#[cfg(feature = "INIntentResponse")]
77impl INStartWorkoutIntentResponse {
78    extern_methods!(
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[unsafe(method(initWithCode:userActivity:))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn initWithCode_userActivity(
86            this: Allocated<Self>,
87            code: INStartWorkoutIntentResponseCode,
88            user_activity: Option<&NSUserActivity>,
89        ) -> Retained<Self>;
90
91        #[unsafe(method(code))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn code(&self) -> INStartWorkoutIntentResponseCode;
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98#[cfg(feature = "INIntentResponse")]
99impl INStartWorkoutIntentResponse {
100    extern_methods!(
101        #[unsafe(method(new))]
102        #[unsafe(method_family = new)]
103        pub unsafe fn new() -> Retained<Self>;
104    );
105}