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::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxhandletype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CXHandleType(pub NSInteger);
impl CXHandleType {
    #[doc(alias = "CXHandleTypeGeneric")]
    pub const Generic: Self = Self(1);
    #[doc(alias = "CXHandleTypePhoneNumber")]
    pub const PhoneNumber: Self = Self(2);
    #[doc(alias = "CXHandleTypeEmailAddress")]
    pub const EmailAddress: Self = Self(3);
}

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

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

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

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

extern_conformance!(
    unsafe impl NSCopying for CXHandle {}
);

unsafe impl CopyingHelper for CXHandle {
    type Result = Self;
}

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

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

impl CXHandle {
    extern_methods!(
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        pub unsafe fn r#type(&self) -> CXHandleType;

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

        #[unsafe(method(initWithType:value:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithType_value(
            this: Allocated<Self>,
            r#type: CXHandleType,
            value: &NSString,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(isEqualToHandle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn isEqualToHandle(&self, handle: &CXHandle) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl CXHandle {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}