objc2_pass_kit/generated/
PKIdentityDocumentDescriptor.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    /// "Descriptor" objects describe types of documents that can be requested. Different document
12    /// types may have different sets of supported elements, functionality, or response formats.
13    /// Clients should not define their own implementations of this protocol or subclass existing implementations.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentitydocumentdescriptor?language=objc)
16    pub unsafe trait PKIdentityDocumentDescriptor: NSObjectProtocol {
17        #[cfg(feature = "PKIdentityElement")]
18        /// Set of elements that will be requested from the document.
19        #[unsafe(method(elements))]
20        #[unsafe(method_family = none)]
21        unsafe fn elements(&self) -> Retained<NSArray<PKIdentityElement>>;
22
23        #[cfg(all(feature = "PKIdentityElement", feature = "PKIdentityIntentToStore"))]
24        /// Intent to store for the given element, or nil if the element has not been added to this descriptor.
25        #[unsafe(method(intentToStoreForElement:))]
26        #[unsafe(method_family = none)]
27        unsafe fn intentToStoreForElement(
28            &self,
29            element: &PKIdentityElement,
30        ) -> Option<Retained<PKIdentityIntentToStore>>;
31
32        #[cfg(all(feature = "PKIdentityElement", feature = "PKIdentityIntentToStore"))]
33        /// Adds the set of elements and associates them with the intent to store. This method can be
34        /// called multple times with the same intent to store to append additional elements. If the same
35        /// element is specified multiple times with different intents to store, the most recent one wins.
36        #[unsafe(method(addElements:withIntentToStore:))]
37        #[unsafe(method_family = none)]
38        unsafe fn addElements_withIntentToStore(
39            &self,
40            elements: &NSArray<PKIdentityElement>,
41            intent_to_store: &PKIdentityIntentToStore,
42        );
43    }
44);
45
46extern_class!(
47    /// Used to request information from a user's driver's license (or equivalent document).
48    ///
49    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentitydriverslicensedescriptor?language=objc)
50    #[unsafe(super(NSObject))]
51    #[derive(Debug, PartialEq, Eq, Hash)]
52    pub struct PKIdentityDriversLicenseDescriptor;
53);
54
55extern_conformance!(
56    unsafe impl NSObjectProtocol for PKIdentityDriversLicenseDescriptor {}
57);
58
59extern_conformance!(
60    unsafe impl PKIdentityDocumentDescriptor for PKIdentityDriversLicenseDescriptor {}
61);
62
63impl PKIdentityDriversLicenseDescriptor {
64    extern_methods!();
65}
66
67/// Methods declared on superclass `NSObject`.
68impl PKIdentityDriversLicenseDescriptor {
69    extern_methods!(
70        #[unsafe(method(init))]
71        #[unsafe(method_family = init)]
72        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub unsafe fn new() -> Retained<Self>;
77    );
78}
79
80extern_class!(
81    /// Used to request information from a user's national id card (or equivalent document).
82    ///
83    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentitynationalidcarddescriptor?language=objc)
84    #[unsafe(super(NSObject))]
85    #[derive(Debug, PartialEq, Eq, Hash)]
86    pub struct PKIdentityNationalIDCardDescriptor;
87);
88
89extern_conformance!(
90    unsafe impl NSObjectProtocol for PKIdentityNationalIDCardDescriptor {}
91);
92
93extern_conformance!(
94    unsafe impl PKIdentityDocumentDescriptor for PKIdentityNationalIDCardDescriptor {}
95);
96
97impl PKIdentityNationalIDCardDescriptor {
98    extern_methods!(
99        /// Alpha-2 country code, as defined in ISO 3166-1, of the issuing authority’s country or territory
100        #[unsafe(method(regionCode))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn regionCode(&self) -> Option<Retained<NSString>>;
103
104        /// Setter for [`regionCode`][Self::regionCode].
105        #[unsafe(method(setRegionCode:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn setRegionCode(&self, region_code: Option<&NSString>);
108    );
109}
110
111/// Methods declared on superclass `NSObject`.
112impl PKIdentityNationalIDCardDescriptor {
113    extern_methods!(
114        #[unsafe(method(init))]
115        #[unsafe(method_family = init)]
116        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
117
118        #[unsafe(method(new))]
119        #[unsafe(method_family = new)]
120        pub unsafe fn new() -> Retained<Self>;
121    );
122}