objc2_accounts/generated/
ACAccountStore.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct ACAccountCredentialRenewResult(pub NSInteger);
15impl ACAccountCredentialRenewResult {
16 #[doc(alias = "ACAccountCredentialRenewResultRenewed")]
17 pub const Renewed: Self = Self(0);
18 #[doc(alias = "ACAccountCredentialRenewResultRejected")]
19 pub const Rejected: Self = Self(1);
20 #[doc(alias = "ACAccountCredentialRenewResultFailed")]
21 pub const Failed: Self = Self(2);
22}
23
24unsafe impl Encode for ACAccountCredentialRenewResult {
25 const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for ACAccountCredentialRenewResult {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[cfg(feature = "block2")]
34pub type ACAccountStoreSaveCompletionHandler = *mut block2::DynBlock<dyn Fn(Bool, *mut NSError)>;
35
36#[cfg(feature = "block2")]
38pub type ACAccountStoreRemoveCompletionHandler = *mut block2::DynBlock<dyn Fn(Bool, *mut NSError)>;
39
40#[cfg(feature = "block2")]
42pub type ACAccountStoreRequestAccessCompletionHandler =
43 *mut block2::DynBlock<dyn Fn(Bool, *mut NSError)>;
44
45#[cfg(feature = "block2")]
47pub type ACAccountStoreCredentialRenewalHandler =
48 *mut block2::DynBlock<dyn Fn(ACAccountCredentialRenewResult, *mut NSError)>;
49
50extern_class!(
51 #[unsafe(super(NSObject))]
53 #[derive(Debug, PartialEq, Eq, Hash)]
54 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
55 pub struct ACAccountStore;
56);
57
58extern_conformance!(
59 unsafe impl NSObjectProtocol for ACAccountStore {}
60);
61
62impl ACAccountStore {
63 extern_methods!(
64 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
65 #[unsafe(method(accounts))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn accounts(&self) -> Option<Retained<NSArray>>;
68
69 #[cfg(feature = "ACAccount")]
70 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
74 #[unsafe(method(accountWithIdentifier:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn accountWithIdentifier(
77 &self,
78 identifier: Option<&NSString>,
79 ) -> Option<Retained<ACAccount>>;
80
81 #[cfg(feature = "ACAccountType")]
82 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
86 #[unsafe(method(accountTypeWithAccountTypeIdentifier:))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn accountTypeWithAccountTypeIdentifier(
89 &self,
90 type_identifier: Option<&NSString>,
91 ) -> Option<Retained<ACAccountType>>;
92
93 #[cfg(feature = "ACAccountType")]
94 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
98 #[unsafe(method(accountsWithAccountType:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn accountsWithAccountType(
101 &self,
102 account_type: Option<&ACAccountType>,
103 ) -> Option<Retained<NSArray>>;
104
105 #[cfg(all(feature = "ACAccount", feature = "block2"))]
106 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
111 #[unsafe(method(saveAccount:withCompletionHandler:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn saveAccount_withCompletionHandler(
114 &self,
115 account: Option<&ACAccount>,
116 completion_handler: ACAccountStoreSaveCompletionHandler,
117 );
118
119 #[cfg(all(feature = "ACAccountType", feature = "block2"))]
120 #[deprecated]
125 #[unsafe(method(requestAccessToAccountsWithType:withCompletionHandler:))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn requestAccessToAccountsWithType_withCompletionHandler(
128 &self,
129 account_type: Option<&ACAccountType>,
130 handler: ACAccountStoreRequestAccessCompletionHandler,
131 );
132
133 #[cfg(all(feature = "ACAccountType", feature = "block2"))]
134 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
141 #[unsafe(method(requestAccessToAccountsWithType:options:completion:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn requestAccessToAccountsWithType_options_completion(
144 &self,
145 account_type: Option<&ACAccountType>,
146 options: Option<&NSDictionary>,
147 completion: ACAccountStoreRequestAccessCompletionHandler,
148 );
149
150 #[cfg(all(feature = "ACAccount", feature = "block2"))]
151 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
156 #[unsafe(method(renewCredentialsForAccount:completion:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn renewCredentialsForAccount_completion(
159 &self,
160 account: Option<&ACAccount>,
161 completion_handler: ACAccountStoreCredentialRenewalHandler,
162 );
163
164 #[cfg(all(feature = "ACAccount", feature = "block2"))]
165 #[deprecated = "Use appropriate non-Apple SDK corresponding to the type of account you want to reference instead"]
170 #[unsafe(method(removeAccount:withCompletionHandler:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn removeAccount_withCompletionHandler(
173 &self,
174 account: Option<&ACAccount>,
175 completion_handler: ACAccountStoreRemoveCompletionHandler,
176 );
177 );
178}
179
180impl ACAccountStore {
182 extern_methods!(
183 #[unsafe(method(init))]
184 #[unsafe(method_family = init)]
185 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
186
187 #[unsafe(method(new))]
188 #[unsafe(method_family = new)]
189 pub unsafe fn new() -> Retained<Self>;
190 );
191}
192
193extern "C" {
194 #[deprecated = "Public notification deprecated. Internal clients, see private header for replacement"]
196 pub static ACAccountStoreDidChangeNotification: Option<&'static NSString>;
197}