use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[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!(
#[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;
);
}
impl CXHandle {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}