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