objc2_intents/generated/
INShareFocusStatusIntent.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/insharefocusstatusintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INShareFocusStatusIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INShareFocusStatusIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INShareFocusStatusIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INShareFocusStatusIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INShareFocusStatusIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INShareFocusStatusIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INShareFocusStatusIntent {
45    extern_methods!(
46        #[cfg(feature = "INFocusStatus")]
47        #[unsafe(method(initWithFocusStatus:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithFocusStatus(
50            this: Allocated<Self>,
51            focus_status: Option<&INFocusStatus>,
52        ) -> Retained<Self>;
53
54        #[cfg(feature = "INFocusStatus")]
55        #[unsafe(method(focusStatus))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn focusStatus(&self) -> Option<Retained<INFocusStatus>>;
58    );
59}
60
61/// Methods declared on superclass `NSObject`.
62#[cfg(feature = "INIntent")]
63impl INShareFocusStatusIntent {
64    extern_methods!(
65        #[unsafe(method(init))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
68
69        #[unsafe(method(new))]
70        #[unsafe(method_family = new)]
71        pub unsafe fn new() -> Retained<Self>;
72    );
73}
74
75extern_protocol!(
76    /// Protocol to declare support for handling an INShareFocusStatusIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
77    ///
78    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The resolution and confirmation methods are optional. The handling method is always called last, after resolving and confirming the intent.
79    ///
80    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insharefocusstatusintenthandling?language=objc)
81    pub unsafe trait INShareFocusStatusIntentHandling: NSObjectProtocol {
82        #[cfg(all(
83            feature = "INIntent",
84            feature = "INIntentResponse",
85            feature = "INShareFocusStatusIntentResponse",
86            feature = "block2"
87        ))]
88        /// Handling method - Execute the task represented by the INShareFocusStatusIntent that's passed in
89        ///
90        /// Called to actually execute the intent. The app must return a response for this intent.
91        ///
92        ///
93        /// Parameter `intent`: The input intent
94        ///
95        /// Parameter `completion`: The response handling block takes a INShareFocusStatusIntentResponse containing the details of the result of having executed the intent
96        ///
97        ///
98        /// See: INShareFocusStatusIntentResponse
99        #[unsafe(method(handleShareFocusStatus:completion:))]
100        #[unsafe(method_family = none)]
101        unsafe fn handleShareFocusStatus_completion(
102            &self,
103            intent: &INShareFocusStatusIntent,
104            completion: &block2::DynBlock<dyn Fn(NonNull<INShareFocusStatusIntentResponse>)>,
105        );
106
107        #[cfg(all(
108            feature = "INIntent",
109            feature = "INIntentResponse",
110            feature = "INShareFocusStatusIntentResponse",
111            feature = "block2"
112        ))]
113        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
114        ///
115        /// 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 assume the intent is valid following resolution, and will assume there is no additional information relevant to this intent.
116        ///
117        ///
118        /// Parameter `intent`: The input intent
119        ///
120        /// Parameter `completion`: The response block contains an INShareFocusStatusIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
121        ///
122        ///
123        /// See: INShareFocusStatusIntentResponse
124        #[optional]
125        #[unsafe(method(confirmShareFocusStatus:completion:))]
126        #[unsafe(method_family = none)]
127        unsafe fn confirmShareFocusStatus_completion(
128            &self,
129            intent: &INShareFocusStatusIntent,
130            completion: &block2::DynBlock<dyn Fn(NonNull<INShareFocusStatusIntentResponse>)>,
131        );
132    }
133);