objc2_local_authentication_embedded_ui/generated/
LARight_UI.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::*;
7use objc2_local_authentication::*;
8
9use crate::*;
10
11mod private_LARightUI {
12    pub trait Sealed {}
13}
14
15/// Category "UI" on [`LARight`].
16///
17/// Groups methods that control aspects of the UI used for authorizing a right
18#[doc(alias = "UI")]
19pub unsafe trait LARightUI: ClassType + Sized + private_LARightUI::Sealed {
20    extern_methods!(
21        #[cfg(all(
22            feature = "LAPresentationContext",
23            feature = "block2",
24            feature = "objc2-app-kit"
25        ))]
26        #[cfg(target_os = "macos")]
27        /// Tries to authorize the right.
28        ///
29        /// Parameter `localizedReason`: Localized explanation for the authorization. Appears in the UI presented to the user.
30        ///
31        /// Parameter `presentationContext`: Container where the authorization UI will be presented.
32        ///
33        /// Parameter `handler`: Completion handler called after the authorization finishses. Returns an error when the authorization fails.
34        #[unsafe(method(authorizeWithLocalizedReason:inPresentationContext:completion:))]
35        #[unsafe(method_family = none)]
36        unsafe fn authorizeWithLocalizedReason_inPresentationContext_completion(
37            &self,
38            localized_reason: &NSString,
39            presentation_context: &LAPresentationContext,
40            handler: &block2::DynBlock<dyn Fn(*mut NSError)>,
41        );
42    );
43}
44
45impl private_LARightUI::Sealed for LARight {}
46unsafe impl LARightUI for LARight {}