objc2_authentication_services/generated/
ASAccountAuthenticationModificationController.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asaccountauthenticationmodificationcontrollerdelegate?language=objc)
12    pub unsafe trait ASAccountAuthenticationModificationControllerDelegate:
13        NSObjectProtocol
14    {
15        #[cfg(feature = "ASAccountAuthenticationModificationRequest")]
16        /// # Safety
17        ///
18        /// `user_info` generic should be of the correct type.
19        #[optional]
20        #[unsafe(method(accountAuthenticationModificationController:didSuccessfullyCompleteRequest:withUserInfo:))]
21        #[unsafe(method_family = none)]
22        unsafe fn accountAuthenticationModificationController_didSuccessfullyCompleteRequest_withUserInfo(
23            &self,
24            controller: &ASAccountAuthenticationModificationController,
25            request: &ASAccountAuthenticationModificationRequest,
26            user_info: Option<&NSDictionary>,
27        );
28
29        #[cfg(feature = "ASAccountAuthenticationModificationRequest")]
30        #[optional]
31        #[unsafe(method(accountAuthenticationModificationController:didFailRequest:withError:))]
32        #[unsafe(method_family = none)]
33        unsafe fn accountAuthenticationModificationController_didFailRequest_withError(
34            &self,
35            controller: &ASAccountAuthenticationModificationController,
36            request: &ASAccountAuthenticationModificationRequest,
37            error: &NSError,
38        );
39    }
40);
41
42extern_protocol!(
43    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asaccountauthenticationmodificationcontrollerpresentationcontextproviding?language=objc)
44    pub unsafe trait ASAccountAuthenticationModificationControllerPresentationContextProviding:
45        NSObjectProtocol + MainThreadOnly
46    {
47        #[cfg(feature = "ASFoundation")]
48        #[cfg(target_os = "macos")]
49        /// Return a view anchor that is most appropriate for authorization UI to be presented over.
50        #[unsafe(method(presentationAnchorForAccountAuthenticationModificationController:))]
51        #[unsafe(method_family = none)]
52        unsafe fn presentationAnchorForAccountAuthenticationModificationController(
53            &self,
54            controller: &ASAccountAuthenticationModificationController,
55        ) -> Retained<ASPresentationAnchor>;
56    }
57);
58
59extern_class!(
60    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/asaccountauthenticationmodificationcontroller?language=objc)
61    #[unsafe(super(NSObject))]
62    #[derive(Debug, PartialEq, Eq, Hash)]
63    pub struct ASAccountAuthenticationModificationController;
64);
65
66extern_conformance!(
67    unsafe impl NSObjectProtocol for ASAccountAuthenticationModificationController {}
68);
69
70impl ASAccountAuthenticationModificationController {
71    extern_methods!(
72        /// This delegate will be notified upon completion of the upgrade to report success or failure.
73        #[unsafe(method(delegate))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn delegate(
76            &self,
77        ) -> Option<
78            Retained<ProtocolObject<dyn ASAccountAuthenticationModificationControllerDelegate>>,
79        >;
80
81        /// Setter for [`delegate`][Self::delegate].
82        ///
83        /// This is a [weak property][objc2::topics::weak_property].
84        #[unsafe(method(setDelegate:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setDelegate(
87            &self,
88            delegate: Option<
89                &ProtocolObject<dyn ASAccountAuthenticationModificationControllerDelegate>,
90            >,
91        );
92
93        /// This will be used to provide a presentation context to display authorization UI.
94        #[unsafe(method(presentationContextProvider))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn presentationContextProvider(
97            &self,
98            mtm: MainThreadMarker,
99        ) -> Option<
100            Retained<
101                ProtocolObject<
102                    dyn ASAccountAuthenticationModificationControllerPresentationContextProviding,
103                >,
104            >,
105        >;
106
107        /// Setter for [`presentationContextProvider`][Self::presentationContextProvider].
108        ///
109        /// This is a [weak property][objc2::topics::weak_property].
110        #[unsafe(method(setPresentationContextProvider:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setPresentationContextProvider(
113            &self,
114            presentation_context_provider: Option<
115                &ProtocolObject<
116                    dyn ASAccountAuthenticationModificationControllerPresentationContextProviding,
117                >,
118            >,
119        );
120
121        #[cfg(feature = "ASAccountAuthenticationModificationRequest")]
122        /// Perform an upgrade request, one at a time. Any requests initiated with a request already in progress will fail immediately.
123        #[unsafe(method(performRequest:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn performRequest(&self, request: &ASAccountAuthenticationModificationRequest);
126    );
127}
128
129/// Methods declared on superclass `NSObject`.
130impl ASAccountAuthenticationModificationController {
131    extern_methods!(
132        #[unsafe(method(init))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136        #[unsafe(method(new))]
137        #[unsafe(method_family = new)]
138        pub unsafe fn new() -> Retained<Self>;
139    );
140}