use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CTCellularDataRestrictedState(pub NSUInteger);
impl CTCellularDataRestrictedState {
#[doc(alias = "kCTCellularDataRestrictedStateUnknown")]
pub const RestrictedStateUnknown: Self = Self(0);
#[doc(alias = "kCTCellularDataRestricted")]
pub const Restricted: Self = Self(1);
#[doc(alias = "kCTCellularDataNotRestricted")]
pub const NotRestricted: Self = Self(2);
}
unsafe impl Encode for CTCellularDataRestrictedState {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for CTCellularDataRestrictedState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "block2")]
pub type CellularDataRestrictionDidUpdateNotifier =
*mut block2::DynBlock<dyn Fn(CTCellularDataRestrictedState)>;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CTCellularData;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CTCellularData {}
);
impl CTCellularData {
extern_methods!(
#[cfg(feature = "block2")]
#[unsafe(method(cellularDataRestrictionDidUpdateNotifier))]
#[unsafe(method_family = none)]
pub unsafe fn cellularDataRestrictionDidUpdateNotifier(
&self,
) -> CellularDataRestrictionDidUpdateNotifier;
#[cfg(feature = "block2")]
#[unsafe(method(setCellularDataRestrictionDidUpdateNotifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setCellularDataRestrictionDidUpdateNotifier(
&self,
cellular_data_restriction_did_update_notifier: CellularDataRestrictionDidUpdateNotifier,
);
#[unsafe(method(restrictedState))]
#[unsafe(method_family = none)]
pub unsafe fn restrictedState(&self) -> CTCellularDataRestrictedState;
);
}
impl CTCellularData {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}