icrate 0.0.1

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AuthenticationServices::*;
use crate::Foundation::*;

extern_protocol!(
    pub struct ASWebAuthenticationSessionRequestDelegate;

    unsafe impl ProtocolType for ASWebAuthenticationSessionRequestDelegate {
        #[optional]
        #[method(authenticationSessionRequest:didCompleteWithCallbackURL:)]
        pub unsafe fn authenticationSessionRequest_didCompleteWithCallbackURL(
            &self,
            authenticationSessionRequest: &ASWebAuthenticationSessionRequest,
            callbackURL: &NSURL,
        );

        #[optional]
        #[method(authenticationSessionRequest:didCancelWithError:)]
        pub unsafe fn authenticationSessionRequest_didCancelWithError(
            &self,
            authenticationSessionRequest: &ASWebAuthenticationSessionRequest,
            error: &NSError,
        );
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ASWebAuthenticationSessionRequest;

    unsafe impl ClassType for ASWebAuthenticationSessionRequest {
        type Super = NSObject;
    }
);

extern_methods!(
    unsafe impl ASWebAuthenticationSessionRequest {
        #[method_id(@__retain_semantics Other UUID)]
        pub unsafe fn UUID(&self) -> Id<NSUUID, Shared>;

        #[method_id(@__retain_semantics Other URL)]
        pub unsafe fn URL(&self) -> Id<NSURL, Shared>;

        #[method_id(@__retain_semantics Other callbackURLScheme)]
        pub unsafe fn callbackURLScheme(&self) -> Option<Id<NSString, Shared>>;

        #[method(shouldUseEphemeralSession)]
        pub unsafe fn shouldUseEphemeralSession(&self) -> bool;

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Id<ASWebAuthenticationSessionRequestDelegate, Shared>>;

        #[method(setDelegate:)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ASWebAuthenticationSessionRequestDelegate>,
        );

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self, Shared>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;

        #[method(cancelWithError:)]
        pub unsafe fn cancelWithError(&self, error: &NSError);

        #[method(completeWithCallbackURL:)]
        pub unsafe fn completeWithCallbackURL(&self, url: &NSURL);
    }
);