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::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctserviceradioaccesstechnologydidchangenotification?language=objc)
    pub static CTServiceRadioAccessTechnologyDidChangeNotification: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologydidchangenotification?language=objc)
    #[deprecated]
    pub static CTRadioAccessTechnologyDidChangeNotification: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologygprs?language=objc)
    pub static CTRadioAccessTechnologyGPRS: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologyedge?language=objc)
    pub static CTRadioAccessTechnologyEdge: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologywcdma?language=objc)
    pub static CTRadioAccessTechnologyWCDMA: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologyhsdpa?language=objc)
    pub static CTRadioAccessTechnologyHSDPA: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologyhsupa?language=objc)
    pub static CTRadioAccessTechnologyHSUPA: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologycdma1x?language=objc)
    pub static CTRadioAccessTechnologyCDMA1x: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologycdmaevdorev0?language=objc)
    pub static CTRadioAccessTechnologyCDMAEVDORev0: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologycdmaevdoreva?language=objc)
    pub static CTRadioAccessTechnologyCDMAEVDORevA: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologycdmaevdorevb?language=objc)
    pub static CTRadioAccessTechnologyCDMAEVDORevB: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologyehrpd?language=objc)
    pub static CTRadioAccessTechnologyeHRPD: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologylte?language=objc)
    pub static CTRadioAccessTechnologyLTE: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologynrnsa?language=objc)
    pub static CTRadioAccessTechnologyNRNSA: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/ctradioaccesstechnologynr?language=objc)
    pub static CTRadioAccessTechnologyNR: &'static NSString;
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coretelephony/cttelephonynetworkinfodelegate?language=objc)
    pub unsafe trait CTTelephonyNetworkInfoDelegate: NSObjectProtocol {
        #[optional]
        #[unsafe(method(dataServiceIdentifierDidChange:))]
        #[unsafe(method_family = none)]
        unsafe fn dataServiceIdentifierDidChange(&self, identifier: &NSString);
    }
);

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

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

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

        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn CTTelephonyNetworkInfoDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn CTTelephonyNetworkInfoDelegate>>,
        );

        #[cfg(feature = "CTCarrier")]
        #[deprecated = "Deprecated with no replacement"]
        #[unsafe(method(serviceSubscriberCellularProviders))]
        #[unsafe(method_family = none)]
        pub unsafe fn serviceSubscriberCellularProviders(
            &self,
        ) -> Option<Retained<NSDictionary<NSString, CTCarrier>>>;

        #[cfg(feature = "CTCarrier")]
        #[deprecated]
        #[unsafe(method(subscriberCellularProvider))]
        #[unsafe(method_family = none)]
        pub unsafe fn subscriberCellularProvider(&self) -> Option<Retained<CTCarrier>>;

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// The returned block's argument must be a valid pointer.
        #[deprecated = "Deprecated with no replacement"]
        #[unsafe(method(serviceSubscriberCellularProvidersDidUpdateNotifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn serviceSubscriberCellularProvidersDidUpdateNotifier(
            &self,
        ) -> *mut block2::DynBlock<dyn Fn(NonNull<NSString>)>;

        #[cfg(feature = "block2")]
        /// Setter for [`serviceSubscriberCellularProvidersDidUpdateNotifier`][Self::serviceSubscriberCellularProvidersDidUpdateNotifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated = "Deprecated with no replacement"]
        #[unsafe(method(setServiceSubscriberCellularProvidersDidUpdateNotifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setServiceSubscriberCellularProvidersDidUpdateNotifier(
            &self,
            service_subscriber_cellular_providers_did_update_notifier: Option<
                &block2::DynBlock<dyn Fn(NonNull<NSString>)>,
            >,
        );

        #[cfg(all(feature = "CTCarrier", feature = "block2"))]
        /// # Safety
        ///
        /// The returned block's argument must be a valid pointer.
        #[deprecated]
        #[unsafe(method(subscriberCellularProviderDidUpdateNotifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn subscriberCellularProviderDidUpdateNotifier(
            &self,
        ) -> *mut block2::DynBlock<dyn Fn(NonNull<CTCarrier>)>;

        #[cfg(all(feature = "CTCarrier", feature = "block2"))]
        /// Setter for [`subscriberCellularProviderDidUpdateNotifier`][Self::subscriberCellularProviderDidUpdateNotifier].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated]
        #[unsafe(method(setSubscriberCellularProviderDidUpdateNotifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSubscriberCellularProviderDidUpdateNotifier(
            &self,
            subscriber_cellular_provider_did_update_notifier: Option<
                &block2::DynBlock<dyn Fn(NonNull<CTCarrier>)>,
            >,
        );

        #[unsafe(method(serviceCurrentRadioAccessTechnology))]
        #[unsafe(method_family = none)]
        pub unsafe fn serviceCurrentRadioAccessTechnology(
            &self,
        ) -> Option<Retained<NSDictionary<NSString, NSString>>>;

        #[deprecated]
        #[unsafe(method(currentRadioAccessTechnology))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentRadioAccessTechnology(&self) -> Option<Retained<NSString>>;
    );
}

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