use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CNLabeledValue<ValueType: ?Sized = AnyObject>;
);
impl<ValueType: ?Sized + Message + NSCopying + NSSecureCoding> CNLabeledValue<ValueType> {
#[inline]
pub unsafe fn cast_unchecked<NewValueType: ?Sized + Message + NSCopying + NSSecureCoding>(
&self,
) -> &CNLabeledValue<NewValueType> {
unsafe { &*((self as *const Self).cast()) }
}
}
extern_conformance!(
unsafe impl<ValueType: ?Sized + NSCoding + NSCopying + NSSecureCoding> NSCoding
for CNLabeledValue<ValueType>
{
}
);
extern_conformance!(
unsafe impl<ValueType: ?Sized + NSCopying + NSSecureCoding> NSCopying
for CNLabeledValue<ValueType>
{
}
);
unsafe impl<ValueType: ?Sized + Message + NSCopying + NSSecureCoding> CopyingHelper
for CNLabeledValue<ValueType>
{
type Result = Self;
}
extern_conformance!(
unsafe impl<ValueType: ?Sized + NSCopying + NSSecureCoding> NSObjectProtocol
for CNLabeledValue<ValueType>
{
}
);
extern_conformance!(
unsafe impl<ValueType: ?Sized + NSSecureCoding + NSCopying + NSSecureCoding> NSSecureCoding
for CNLabeledValue<ValueType>
{
}
);
impl<ValueType: Message + NSCopying + NSSecureCoding> CNLabeledValue<ValueType> {
extern_methods!(
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Retained<NSString>;
#[unsafe(method(label))]
#[unsafe(method_family = none)]
pub unsafe fn label(&self) -> Option<Retained<NSString>>;
#[unsafe(method(value))]
#[unsafe(method_family = none)]
pub unsafe fn value(&self) -> Retained<ValueType>;
#[unsafe(method(labeledValueWithLabel:value:))]
#[unsafe(method_family = none)]
pub unsafe fn labeledValueWithLabel_value(
label: Option<&NSString>,
value: &ValueType,
) -> Retained<Self>;
#[unsafe(method(initWithLabel:value:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLabel_value(
this: Allocated<Self>,
label: Option<&NSString>,
value: &ValueType,
) -> Retained<Self>;
#[unsafe(method(labeledValueBySettingLabel:))]
#[unsafe(method_family = none)]
pub unsafe fn labeledValueBySettingLabel(&self, label: Option<&NSString>)
-> Retained<Self>;
#[unsafe(method(labeledValueBySettingValue:))]
#[unsafe(method_family = none)]
pub unsafe fn labeledValueBySettingValue(&self, value: &ValueType) -> Retained<Self>;
#[unsafe(method(labeledValueBySettingLabel:value:))]
#[unsafe(method_family = none)]
pub unsafe fn labeledValueBySettingLabel_value(
&self,
label: Option<&NSString>,
value: &ValueType,
) -> Retained<Self>;
#[unsafe(method(localizedStringForLabel:))]
#[unsafe(method_family = none)]
pub unsafe fn localizedStringForLabel(label: &NSString) -> Retained<NSString>;
);
}
impl<ValueType: Message + NSCopying + NSSecureCoding> CNLabeledValue<ValueType> {
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>;
);
}
extern "C" {
pub static CNLabelHome: &'static NSString;
}
extern "C" {
pub static CNLabelWork: &'static NSString;
}
extern "C" {
pub static CNLabelSchool: &'static NSString;
}
extern "C" {
pub static CNLabelOther: &'static NSString;
}
extern "C" {
pub static CNLabelEmailiCloud: &'static NSString;
}
extern "C" {
pub static CNLabelURLAddressHomePage: &'static NSString;
}
extern "C" {
pub static CNLabelDateAnniversary: &'static NSString;
}