objc2_core_telephony/generated/
CTCellularData.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct CTCellularDataRestrictedState(pub NSUInteger);
14impl CTCellularDataRestrictedState {
15 #[doc(alias = "kCTCellularDataRestrictedStateUnknown")]
16 pub const RestrictedStateUnknown: Self = Self(0);
17 #[doc(alias = "kCTCellularDataRestricted")]
18 pub const Restricted: Self = Self(1);
19 #[doc(alias = "kCTCellularDataNotRestricted")]
20 pub const NotRestricted: Self = Self(2);
21}
22
23unsafe impl Encode for CTCellularDataRestrictedState {
24 const ENCODING: Encoding = NSUInteger::ENCODING;
25}
26
27unsafe impl RefEncode for CTCellularDataRestrictedState {
28 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31#[cfg(feature = "block2")]
33pub type CellularDataRestrictionDidUpdateNotifier =
34 *mut block2::DynBlock<dyn Fn(CTCellularDataRestrictedState)>;
35
36extern_class!(
37 #[unsafe(super(NSObject))]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 pub struct CTCellularData;
41);
42
43extern_conformance!(
44 unsafe impl NSObjectProtocol for CTCellularData {}
45);
46
47impl CTCellularData {
48 extern_methods!(
49 #[cfg(feature = "block2")]
50 #[unsafe(method(cellularDataRestrictionDidUpdateNotifier))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn cellularDataRestrictionDidUpdateNotifier(
53 &self,
54 ) -> CellularDataRestrictionDidUpdateNotifier;
55
56 #[cfg(feature = "block2")]
57 #[unsafe(method(setCellularDataRestrictionDidUpdateNotifier:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setCellularDataRestrictionDidUpdateNotifier(
61 &self,
62 cellular_data_restriction_did_update_notifier: CellularDataRestrictionDidUpdateNotifier,
63 );
64
65 #[unsafe(method(restrictedState))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn restrictedState(&self) -> CTCellularDataRestrictedState;
68 );
69}
70
71impl CTCellularData {
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}