objc2-authentication-services 0.3.2

Bindings to the AuthenticationServices framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// A helper class to provide static utility methods for quick access to settings related to credential providers.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/authenticationservices/assettingshelper?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct ASSettingsHelper;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for ASSettingsHelper {}
);

impl ASSettingsHelper {
    extern_methods!(
        #[cfg(feature = "block2")]
        /// Calling this method will open the Settings app and navigate directly to the AutoFill provider settings.
        #[unsafe(method(openCredentialProviderAppSettingsWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openCredentialProviderAppSettingsWithCompletionHandler(
            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "block2")]
        /// Calling this method will open the Settings app and navigate directly to the Verification Code provider settings.
        #[unsafe(method(openVerificationCodeAppSettingsWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openVerificationCodeAppSettingsWithCompletionHandler(
            completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "block2")]
        /// Call this method from your containing app to request to turn on a contained Credential Provider Extension.
        /// If the extension is not currently enabled, a prompt will be shown to allow it to be turned on.
        /// The completion handler is called with YES or NO depending on whether the credential provider is enabled.
        /// You need to wait 10 seconds in order to make additional request to this API.
        #[unsafe(method(requestToTurnOnCredentialProviderExtensionWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestToTurnOnCredentialProviderExtensionWithCompletionHandler(
            completion_handler: &block2::DynBlock<dyn Fn(Bool)>,
        );

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}