objc2-core-telephony 0.3.2

Bindings to the CoreTelephony framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctcellularplancapability?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CTCellularPlanCapability(pub NSInteger);
impl CTCellularPlanCapability {
    #[doc(alias = "CTCellularPlanCapabilityDataOnly")]
    pub const DataOnly: Self = Self(0);
    #[doc(alias = "CTCellularPlanCapabilityDataAndVoice")]
    pub const DataAndVoice: Self = Self(1);
}

unsafe impl Encode for CTCellularPlanCapability {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CTCellularPlanCapability {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctcellularplanproperties?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CTCellularPlanProperties;
);

extern_conformance!(
    unsafe impl NSCoding for CTCellularPlanProperties {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for CTCellularPlanProperties {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for CTCellularPlanProperties {}
);

impl CTCellularPlanProperties {
    extern_methods!(
        #[unsafe(method(associatedIccid))]
        #[unsafe(method_family = none)]
        pub unsafe fn associatedIccid(&self) -> Option<Retained<NSString>>;

        /// Setter for [`associatedIccid`][Self::associatedIccid].
        #[unsafe(method(setAssociatedIccid:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAssociatedIccid(&self, associated_iccid: Option<&NSString>);

        #[unsafe(method(simCapability))]
        #[unsafe(method_family = none)]
        pub unsafe fn simCapability(&self) -> CTCellularPlanCapability;

        /// Setter for [`simCapability`][Self::simCapability].
        #[unsafe(method(setSimCapability:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSimCapability(&self, sim_capability: CTCellularPlanCapability);

        #[unsafe(method(supportedRegionCodes))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportedRegionCodes(&self) -> Retained<NSArray<NSString>>;

        /// Setter for [`supportedRegionCodes`][Self::supportedRegionCodes].
        #[unsafe(method(setSupportedRegionCodes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSupportedRegionCodes(&self, supported_region_codes: &NSArray<NSString>);
    );
}

/// Methods declared on superclass `NSObject`.
impl CTCellularPlanProperties {
    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>;
    );
}