objc2_intents/generated/
INSearchForAccountsIntent.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/insearchforaccountsintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INSearchForAccountsIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INSearchForAccountsIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INSearchForAccountsIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INSearchForAccountsIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INSearchForAccountsIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INSearchForAccountsIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INSearchForAccountsIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INAccountType",
48            feature = "INBalanceType",
49            feature = "INSpeakableString"
50        ))]
51        #[unsafe(method(initWithAccountNickname:accountType:organizationName:requestedBalanceType:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithAccountNickname_accountType_organizationName_requestedBalanceType(
54            this: Allocated<Self>,
55            account_nickname: Option<&INSpeakableString>,
56            account_type: INAccountType,
57            organization_name: Option<&INSpeakableString>,
58            requested_balance_type: INBalanceType,
59        ) -> Retained<Self>;
60
61        #[cfg(feature = "INSpeakableString")]
62        #[unsafe(method(accountNickname))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn accountNickname(&self) -> Option<Retained<INSpeakableString>>;
65
66        #[cfg(feature = "INAccountType")]
67        #[unsafe(method(accountType))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn accountType(&self) -> INAccountType;
70
71        #[cfg(feature = "INSpeakableString")]
72        #[unsafe(method(organizationName))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn organizationName(&self) -> Option<Retained<INSpeakableString>>;
75
76        #[cfg(feature = "INBalanceType")]
77        #[unsafe(method(requestedBalanceType))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn requestedBalanceType(&self) -> INBalanceType;
80    );
81}
82
83/// Methods declared on superclass `NSObject`.
84#[cfg(feature = "INIntent")]
85impl INSearchForAccountsIntent {
86    extern_methods!(
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
90
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}
96
97extern_protocol!(
98    /// Protocol to declare support for handling an INSearchForAccountsIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
99    ///
100    /// 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.
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/insearchforaccountsintenthandling?language=objc)
103    pub unsafe trait INSearchForAccountsIntentHandling: NSObjectProtocol {
104        #[cfg(all(
105            feature = "INIntent",
106            feature = "INIntentResponse",
107            feature = "INSearchForAccountsIntentResponse",
108            feature = "block2"
109        ))]
110        /// Handling method - Execute the task represented by the INSearchForAccountsIntent that's passed in
111        ///
112        /// Called to actually execute the intent. The app must return a response for this intent.
113        ///
114        ///
115        /// Parameter `intent`: The input intent
116        ///
117        /// Parameter `completion`: The response handling block takes a INSearchForAccountsIntentResponse containing the details of the result of having executed the intent
118        ///
119        ///
120        /// See: INSearchForAccountsIntentResponse
121        #[unsafe(method(handleSearchForAccounts:completion:))]
122        #[unsafe(method_family = none)]
123        unsafe fn handleSearchForAccounts_completion(
124            &self,
125            intent: &INSearchForAccountsIntent,
126            completion: &block2::DynBlock<dyn Fn(NonNull<INSearchForAccountsIntentResponse>)>,
127        );
128
129        #[cfg(all(
130            feature = "INIntent",
131            feature = "INIntentResponse",
132            feature = "INSearchForAccountsIntentResponse",
133            feature = "block2"
134        ))]
135        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
136        ///
137        /// 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.
138        ///
139        ///
140        /// Parameter `intent`: The input intent
141        ///
142        /// Parameter `completion`: The response block contains an INSearchForAccountsIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
143        ///
144        ///
145        /// See: INSearchForAccountsIntentResponse
146        #[optional]
147        #[unsafe(method(confirmSearchForAccounts:completion:))]
148        #[unsafe(method_family = none)]
149        unsafe fn confirmSearchForAccounts_completion(
150            &self,
151            intent: &INSearchForAccountsIntent,
152            completion: &block2::DynBlock<dyn Fn(NonNull<INSearchForAccountsIntentResponse>)>,
153        );
154
155        #[cfg(all(
156            feature = "INIntent",
157            feature = "INIntentResolutionResult",
158            feature = "INSpeakableStringResolutionResult",
159            feature = "block2"
160        ))]
161        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
162        ///
163        /// Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out.
164        ///
165        ///
166        /// Parameter `intent`: The input intent
167        ///
168        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
169        ///
170        ///
171        /// See: INIntentResolutionResult
172        #[optional]
173        #[unsafe(method(resolveAccountNicknameForSearchForAccounts:withCompletion:))]
174        #[unsafe(method_family = none)]
175        unsafe fn resolveAccountNicknameForSearchForAccounts_withCompletion(
176            &self,
177            intent: &INSearchForAccountsIntent,
178            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
179        );
180
181        #[cfg(all(
182            feature = "INAccountTypeResolutionResult",
183            feature = "INIntent",
184            feature = "INIntentResolutionResult",
185            feature = "block2"
186        ))]
187        #[optional]
188        #[unsafe(method(resolveAccountTypeForSearchForAccounts:withCompletion:))]
189        #[unsafe(method_family = none)]
190        unsafe fn resolveAccountTypeForSearchForAccounts_withCompletion(
191            &self,
192            intent: &INSearchForAccountsIntent,
193            completion: &block2::DynBlock<dyn Fn(NonNull<INAccountTypeResolutionResult>)>,
194        );
195
196        #[cfg(all(
197            feature = "INIntent",
198            feature = "INIntentResolutionResult",
199            feature = "INSpeakableStringResolutionResult",
200            feature = "block2"
201        ))]
202        #[optional]
203        #[unsafe(method(resolveOrganizationNameForSearchForAccounts:withCompletion:))]
204        #[unsafe(method_family = none)]
205        unsafe fn resolveOrganizationNameForSearchForAccounts_withCompletion(
206            &self,
207            intent: &INSearchForAccountsIntent,
208            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
209        );
210
211        #[cfg(all(
212            feature = "INBalanceTypeResolutionResult",
213            feature = "INIntent",
214            feature = "INIntentResolutionResult",
215            feature = "block2"
216        ))]
217        #[optional]
218        #[unsafe(method(resolveRequestedBalanceTypeForSearchForAccounts:withCompletion:))]
219        #[unsafe(method_family = none)]
220        unsafe fn resolveRequestedBalanceTypeForSearchForAccounts_withCompletion(
221            &self,
222            intent: &INSearchForAccountsIntent,
223            completion: &block2::DynBlock<dyn Fn(NonNull<INBalanceTypeResolutionResult>)>,
224        );
225    }
226);