objc2_core_telephony/generated/
CTSubscriber.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 "C" {
11    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctsubscribertokenrefreshed?language=objc)
12    #[deprecated]
13    pub static CTSubscriberTokenRefreshed: &'static NSString;
14}
15
16extern_protocol!(
17    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctsubscriberdelegate?language=objc)
18    pub unsafe trait CTSubscriberDelegate {
19        #[unsafe(method(subscriberTokenRefreshed:))]
20        #[unsafe(method_family = none)]
21        unsafe fn subscriberTokenRefreshed(&self, subscriber: &CTSubscriber);
22    }
23);
24
25extern_class!(
26    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctsubscriber?language=objc)
27    #[unsafe(super(NSObject))]
28    #[derive(Debug, PartialEq, Eq, Hash)]
29    pub struct CTSubscriber;
30);
31
32extern_conformance!(
33    unsafe impl NSObjectProtocol for CTSubscriber {}
34);
35
36impl CTSubscriber {
37    extern_methods!(
38        #[unsafe(method(carrierToken))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn carrierToken(&self) -> Option<Retained<NSData>>;
41
42        #[unsafe(method(refreshCarrierToken))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn refreshCarrierToken(&self) -> bool;
45
46        #[unsafe(method(identifier))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn identifier(&self) -> Retained<NSString>;
49
50        #[unsafe(method(isSIMInserted))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn isSIMInserted(&self) -> bool;
53
54        #[unsafe(method(delegate))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn delegate(&self)
57            -> Option<Retained<ProtocolObject<dyn CTSubscriberDelegate>>>;
58
59        /// Setter for [`delegate`][Self::delegate].
60        ///
61        /// This is a [weak property][objc2::topics::weak_property].
62        #[unsafe(method(setDelegate:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setDelegate(
65            &self,
66            delegate: Option<&ProtocolObject<dyn CTSubscriberDelegate>>,
67        );
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72impl CTSubscriber {
73    extern_methods!(
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub unsafe fn new() -> Retained<Self>;
81    );
82}