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        ///
106        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
107        #[unsafe(method(setRegionCode:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setRegionCode(&self, region_code: Option<&NSString>);
110    );
111}
112
113/// Methods declared on superclass `NSObject`.
114impl PKIdentityNationalIDCardDescriptor {
115    extern_methods!(
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(new))]
121        #[unsafe(method_family = new)]
122        pub unsafe fn new() -> Retained<Self>;
123    );
124}
125
126extern_class!(
127    /// Used to request information from a user's photo ID (or equivalent document).
128    ///
129    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentityphotoiddescriptor?language=objc)
130    #[unsafe(super(NSObject))]
131    #[derive(Debug, PartialEq, Eq, Hash)]
132    pub struct PKIdentityPhotoIDDescriptor;
133);
134
135extern_conformance!(
136    unsafe impl NSObjectProtocol for PKIdentityPhotoIDDescriptor {}
137);
138
139extern_conformance!(
140    unsafe impl PKIdentityDocumentDescriptor for PKIdentityPhotoIDDescriptor {}
141);
142
143impl PKIdentityPhotoIDDescriptor {
144    extern_methods!();
145}
146
147/// Methods declared on superclass `NSObject`.
148impl PKIdentityPhotoIDDescriptor {
149    extern_methods!(
150        #[unsafe(method(init))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
153
154        #[unsafe(method(new))]
155        #[unsafe(method_family = new)]
156        pub unsafe fn new() -> Retained<Self>;
157    );
158}
159
160extern_class!(
161    /// Used to request information from multiple identity documents.
162    ///
163    /// See also [Apple's documentation](https://developer.apple.com/documentation/passkit/pkidentityanyofdescriptor?language=objc)
164    #[unsafe(super(NSObject))]
165    #[derive(Debug, PartialEq, Eq, Hash)]
166    pub struct PKIdentityAnyOfDescriptor;
167);
168
169extern_conformance!(
170    unsafe impl NSObjectProtocol for PKIdentityAnyOfDescriptor {}
171);
172
173extern_conformance!(
174    unsafe impl PKIdentityDocumentDescriptor for PKIdentityAnyOfDescriptor {}
175);
176
177impl PKIdentityAnyOfDescriptor {
178    extern_methods!(
179        /// Set of requested descriptors for the composite document descriptor.
180        #[unsafe(method(descriptors))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn descriptors(
183            &self,
184        ) -> Retained<NSArray<ProtocolObject<dyn PKIdentityDocumentDescriptor>>>;
185
186        /// Returns a composite document descriptor with specified descriptors.
187        #[unsafe(method(initWithDescriptors:))]
188        #[unsafe(method_family = init)]
189        pub unsafe fn initWithDescriptors(
190            this: Allocated<Self>,
191            descriptors: &NSArray<ProtocolObject<dyn PKIdentityDocumentDescriptor>>,
192        ) -> Retained<Self>;
193
194        #[unsafe(method(init))]
195        #[unsafe(method_family = init)]
196        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
197
198        #[unsafe(method(new))]
199        #[unsafe(method_family = new)]
200        pub unsafe fn new() -> Retained<Self>;
201    );
202}