objc2-call-kit 0.3.2

Bindings to the CallKit 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/callkit/cxcalldirectoryenabledstatus?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CXCallDirectoryEnabledStatus(pub NSInteger);
impl CXCallDirectoryEnabledStatus {
    #[doc(alias = "CXCallDirectoryEnabledStatusUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "CXCallDirectoryEnabledStatusDisabled")]
    pub const Disabled: Self = Self(1);
    #[doc(alias = "CXCallDirectoryEnabledStatusEnabled")]
    pub const Enabled: Self = Self(2);
}

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

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

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

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

impl CXCallDirectoryManager {
    extern_methods!(
        #[unsafe(method(sharedInstance))]
        #[unsafe(method_family = none)]
        pub unsafe fn sharedInstance() -> Retained<CXCallDirectoryManager>;

        #[cfg(feature = "block2")]
        #[unsafe(method(reloadExtensionWithIdentifier:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadExtensionWithIdentifier_completionHandler(
            &self,
            identifier: &NSString,
            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(getEnabledStatusForExtensionWithIdentifier:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getEnabledStatusForExtensionWithIdentifier_completionHandler(
            &self,
            identifier: &NSString,
            completion: &block2::DynBlock<dyn Fn(CXCallDirectoryEnabledStatus, *mut NSError)>,
        );

        #[cfg(feature = "block2")]
        #[unsafe(method(openSettingsWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openSettingsWithCompletionHandler(
            &self,
            completion: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
        );
    );
}

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