objc2_crypto_token_kit/generated/
TKSmartCardATR.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct TKSmartCardProtocol(pub NSUInteger);
17bitflags::bitflags! {
18 impl TKSmartCardProtocol: NSUInteger {
19 #[doc(alias = "TKSmartCardProtocolNone")]
20 const None = 0;
21 #[doc(alias = "TKSmartCardProtocolT0")]
22 const T0 = 1<<0;
23 #[doc(alias = "TKSmartCardProtocolT1")]
24 const T1 = 1<<1;
25 #[doc(alias = "TKSmartCardProtocolT15")]
26 const T15 = 1<<15;
27 #[doc(alias = "TKSmartCardProtocolAny")]
28 const Any = (1<<16)-1;
29 }
30}
31
32unsafe impl Encode for TKSmartCardProtocol {
33 const ENCODING: Encoding = NSUInteger::ENCODING;
34}
35
36unsafe impl RefEncode for TKSmartCardProtocol {
37 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40extern_class!(
41 #[unsafe(super(NSObject))]
45 #[derive(Debug, PartialEq, Eq, Hash)]
46 pub struct TKSmartCardATRInterfaceGroup;
47);
48
49extern_conformance!(
50 unsafe impl NSObjectProtocol for TKSmartCardATRInterfaceGroup {}
51);
52
53impl TKSmartCardATRInterfaceGroup {
54 extern_methods!(
55 #[unsafe(method(TA))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn TA(&self) -> Option<Retained<NSNumber>>;
59
60 #[unsafe(method(TB))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn TB(&self) -> Option<Retained<NSNumber>>;
64
65 #[unsafe(method(TC))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn TC(&self) -> Option<Retained<NSNumber>>;
69
70 #[unsafe(method(protocol))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn protocol(&self) -> Option<Retained<NSNumber>>;
74 );
75}
76
77impl TKSmartCardATRInterfaceGroup {
79 extern_methods!(
80 #[unsafe(method(init))]
81 #[unsafe(method_family = init)]
82 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84 #[unsafe(method(new))]
85 #[unsafe(method_family = new)]
86 pub unsafe fn new() -> Retained<Self>;
87 );
88}
89
90extern_class!(
91 #[unsafe(super(NSObject))]
95 #[derive(Debug, PartialEq, Eq, Hash)]
96 pub struct TKSmartCardATR;
97);
98
99extern_conformance!(
100 unsafe impl NSObjectProtocol for TKSmartCardATR {}
101);
102
103impl TKSmartCardATR {
104 extern_methods!(
105 #[unsafe(method(initWithBytes:))]
111 #[unsafe(method_family = init)]
112 pub unsafe fn initWithBytes(
113 this: Allocated<Self>,
114 bytes: &NSData,
115 ) -> Option<Retained<Self>>;
116
117 #[cfg(feature = "block2")]
118 #[unsafe(method(initWithSource:))]
124 #[unsafe(method_family = init)]
125 pub unsafe fn initWithSource(
126 this: Allocated<Self>,
127 source: &block2::DynBlock<dyn Fn() -> c_int>,
128 ) -> Option<Retained<Self>>;
129
130 #[unsafe(method(bytes))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn bytes(&self) -> Retained<NSData>;
134
135 #[unsafe(method(protocols))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn protocols(&self) -> Retained<NSArray<NSNumber>>;
139
140 #[unsafe(method(interfaceGroupAtIndex:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn interfaceGroupAtIndex(
148 &self,
149 index: NSInteger,
150 ) -> Option<Retained<TKSmartCardATRInterfaceGroup>>;
151
152 #[unsafe(method(interfaceGroupForProtocol:))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn interfaceGroupForProtocol(
156 &self,
157 protocol: TKSmartCardProtocol,
158 ) -> Option<Retained<TKSmartCardATRInterfaceGroup>>;
159
160 #[unsafe(method(historicalBytes))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn historicalBytes(&self) -> Retained<NSData>;
164
165 #[cfg(feature = "TKTLVRecord")]
166 #[unsafe(method(historicalRecords))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn historicalRecords(&self) -> Option<Retained<NSArray<TKCompactTLVRecord>>>;
175 );
176}
177
178impl TKSmartCardATR {
180 extern_methods!(
181 #[unsafe(method(init))]
182 #[unsafe(method_family = init)]
183 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
184
185 #[unsafe(method(new))]
186 #[unsafe(method_family = new)]
187 pub unsafe fn new() -> Retained<Self>;
188 );
189}