objc2_authentication_services/generated/
ASWebAuthenticationSessionRequest.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/aswebauthenticationsessionrequestdelegate?language=objc)
12    pub unsafe trait ASWebAuthenticationSessionRequestDelegate: NSObjectProtocol {
13        #[optional]
14        #[unsafe(method(authenticationSessionRequest:didCompleteWithCallbackURL:))]
15        #[unsafe(method_family = none)]
16        unsafe fn authenticationSessionRequest_didCompleteWithCallbackURL(
17            &self,
18            authentication_session_request: &ASWebAuthenticationSessionRequest,
19            callback_url: &NSURL,
20        );
21
22        #[optional]
23        #[unsafe(method(authenticationSessionRequest:didCancelWithError:))]
24        #[unsafe(method_family = none)]
25        unsafe fn authenticationSessionRequest_didCancelWithError(
26            &self,
27            authentication_session_request: &ASWebAuthenticationSessionRequest,
28            error: &NSError,
29        );
30    }
31);
32
33extern_class!(
34    /// [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsessionrequest?language=objc)
35    #[unsafe(super(NSObject))]
36    #[derive(Debug, PartialEq, Eq, Hash)]
37    pub struct ASWebAuthenticationSessionRequest;
38);
39
40extern_conformance!(
41    unsafe impl NSCoding for ASWebAuthenticationSessionRequest {}
42);
43
44extern_conformance!(
45    unsafe impl NSCopying for ASWebAuthenticationSessionRequest {}
46);
47
48unsafe impl CopyingHelper for ASWebAuthenticationSessionRequest {
49    type Result = Self;
50}
51
52extern_conformance!(
53    unsafe impl NSObjectProtocol for ASWebAuthenticationSessionRequest {}
54);
55
56extern_conformance!(
57    unsafe impl NSSecureCoding for ASWebAuthenticationSessionRequest {}
58);
59
60impl ASWebAuthenticationSessionRequest {
61    extern_methods!(
62        #[unsafe(method(UUID))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn UUID(&self) -> Retained<NSUUID>;
65
66        #[unsafe(method(URL))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn URL(&self) -> Retained<NSURL>;
69
70        #[deprecated = "Use `callback` to match all callback types."]
71        #[unsafe(method(callbackURLScheme))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn callbackURLScheme(&self) -> Option<Retained<NSString>>;
74
75        #[unsafe(method(shouldUseEphemeralSession))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn shouldUseEphemeralSession(&self) -> bool;
78
79        #[unsafe(method(delegate))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn delegate(
82            &self,
83        ) -> Option<Retained<ProtocolObject<dyn ASWebAuthenticationSessionRequestDelegate>>>;
84
85        /// Setter for [`delegate`][Self::delegate].
86        ///
87        /// This is a [weak property][objc2::topics::weak_property].
88        #[unsafe(method(setDelegate:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setDelegate(
91            &self,
92            delegate: Option<&ProtocolObject<dyn ASWebAuthenticationSessionRequestDelegate>>,
93        );
94
95        /// Additional headers to be sent when loading the initial URL.
96        /// These should _only_ apply to the initial page, and should not overwrite any headers normally sent by the browser.
97        /// Add `AdditionalHeaderFieldsAreSupported: true` to `ASWebAuthenticationSessionWebBrowserSupportCapabilities` in your browser's Info.plist file to indicate support for this.
98        #[unsafe(method(additionalHeaderFields))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn additionalHeaderFields(
101            &self,
102        ) -> Option<Retained<NSDictionary<NSString, NSString>>>;
103
104        #[cfg(feature = "ASWebAuthenticationSessionCallback")]
105        /// The callback to listen for to complete this request.
106        /// Check all main-frame navigations loaded during the request with this callback. It is used to handle all callback types, including custom schemes and HTTPS navigations.
107        /// When a match is found, invoke `-completeWithCallbackURL:` with that URL.
108        /// Add `CallbackURLMatchingIsSupported: true` to `ASWebAuthenticationSessionWebBrowserSupportCapabilities` in your browser's Info.plist file to indicate support for this.
109        #[unsafe(method(callback))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn callback(&self) -> Option<Retained<ASWebAuthenticationSessionCallback>>;
112
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116
117        #[unsafe(method(init))]
118        #[unsafe(method_family = init)]
119        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
120
121        #[unsafe(method(cancelWithError:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn cancelWithError(&self, error: &NSError);
124
125        #[unsafe(method(completeWithCallbackURL:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn completeWithCallbackURL(&self, url: &NSURL);
128    );
129}