1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! 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!(
/// Used to request information from an identity document stored as a Wallet pass.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentityauthorizationcontroller?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct PKIdentityAuthorizationController;
);
extern_conformance!(
unsafe impl NSObjectProtocol for PKIdentityAuthorizationController {}
);
impl PKIdentityAuthorizationController {
extern_methods!(
#[cfg(all(feature = "PKIdentityDocumentDescriptor", feature = "block2"))]
/// Determines if a document can be requested, taking into account the entitlement of the
/// calling process as well as the state of this device.
#[unsafe(method(checkCanRequestDocument:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn checkCanRequestDocument_completion(
&self,
descriptor: &ProtocolObject<dyn PKIdentityDocumentDescriptor>,
completion: &block2::DynBlock<dyn Fn(Bool)>,
);
#[cfg(all(
feature = "PKIdentityDocument",
feature = "PKIdentityRequest",
feature = "block2"
))]
/// Requests identity document information from the user. The user will be prompted to approve
/// the request before any data is released.
/// If the user approves, the document will be returned through the completion handler.
/// If the user does not approve, PKIdentityErrorUserCancelled will be returned through
/// the completion handler.
/// If the request is cancelled by the calling app through cancelRequest, PKIdentityErrorAppCancelled
/// will be returned.
/// Only one request can be in progress at a time, otherwise PKIdentityErrorRequestAlreadyInProgress
/// will be returned.
#[unsafe(method(requestDocument:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn requestDocument_completion(
&self,
request: &PKIdentityRequest,
completion: &block2::DynBlock<dyn Fn(*mut PKIdentityDocument, *mut NSError)>,
);
/// If there is a request in progress through requestDocument, this will cancel that request
/// if possible. If the request is cancelled, PKIdentityErrorAppCancelled will be returned in the
/// requestDocument:completion: completion handler. Cancellation is not guaranteed; even if
/// this method is called, it is possible that requestDocument:completion: will return a document
/// response if a response was already in flight.
#[unsafe(method(cancelRequest))]
#[unsafe(method_family = none)]
pub unsafe fn cancelRequest(&self);
);
}
/// Methods declared on superclass `NSObject`.
impl PKIdentityAuthorizationController {
extern_methods!(
#[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>;
);
}