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        /// This is a [weak property][objc2::topics::weak_property].
86        /// Setter for [`delegate`][Self::delegate].
87        #[unsafe(method(setDelegate:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn setDelegate(
90            &self,
91            delegate: Option<&ProtocolObject<dyn ASWebAuthenticationSessionRequestDelegate>>,
92        );
93
94        /// Additional headers to be sent when loading the initial URL.
95        /// These should _only_ apply to the initial page, and should not overwrite any headers normally sent by the browser.
96        /// Add `AdditionalHeaderFieldsAreSupported: true` to `ASWebAuthenticationSessionWebBrowserSupportCapabilities` in your browser's Info.plist file to indicate support for this.
97        #[unsafe(method(additionalHeaderFields))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn additionalHeaderFields(
100            &self,
101        ) -> Option<Retained<NSDictionary<NSString, NSString>>>;
102
103        #[cfg(feature = "ASWebAuthenticationSessionCallback")]
104        /// The callback to listen for to complete this request.
105        /// 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.
106        /// When a match is found, invoke `-completeWithCallbackURL:` with that URL.
107        /// Add `CallbackURLMatchingIsSupported: true` to `ASWebAuthenticationSessionWebBrowserSupportCapabilities` in your browser's Info.plist file to indicate support for this.
108        #[unsafe(method(callback))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn callback(&self) -> Option<Retained<ASWebAuthenticationSessionCallback>>;
111
112        #[unsafe(method(new))]
113        #[unsafe(method_family = new)]
114        pub unsafe fn new() -> Retained<Self>;
115
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(cancelWithError:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn cancelWithError(&self, error: &NSError);
123
124        #[unsafe(method(completeWithCallbackURL:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn completeWithCallbackURL(&self, url: &NSURL);
127    );
128}