objc2_contacts/generated/
CNLabeledValue.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 pub struct CNLabeledValue<ValueType: ?Sized = AnyObject>;
16);
17
18impl<ValueType: ?Sized + Message + NSCopying + NSSecureCoding> CNLabeledValue<ValueType> {
19 #[inline]
25 pub unsafe fn cast_unchecked<NewValueType: ?Sized + Message + NSCopying + NSSecureCoding>(
26 &self,
27 ) -> &CNLabeledValue<NewValueType> {
28 unsafe { &*((self as *const Self).cast()) }
29 }
30}
31
32extern_conformance!(
33 unsafe impl<ValueType: ?Sized + NSCoding + NSCopying + NSSecureCoding> NSCoding
34 for CNLabeledValue<ValueType>
35 {
36 }
37);
38
39extern_conformance!(
40 unsafe impl<ValueType: ?Sized + NSCopying + NSSecureCoding> NSCopying
41 for CNLabeledValue<ValueType>
42 {
43 }
44);
45
46unsafe impl<ValueType: ?Sized + Message + NSCopying + NSSecureCoding> CopyingHelper
47 for CNLabeledValue<ValueType>
48{
49 type Result = Self;
50}
51
52extern_conformance!(
53 unsafe impl<ValueType: ?Sized + NSCopying + NSSecureCoding> NSObjectProtocol
54 for CNLabeledValue<ValueType>
55 {
56 }
57);
58
59extern_conformance!(
60 unsafe impl<ValueType: ?Sized + NSSecureCoding + NSCopying + NSSecureCoding> NSSecureCoding
61 for CNLabeledValue<ValueType>
62 {
63 }
64);
65
66impl<ValueType: Message + NSCopying + NSSecureCoding> CNLabeledValue<ValueType> {
67 extern_methods!(
68 #[unsafe(method(identifier))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn identifier(&self) -> Retained<NSString>;
72
73 #[unsafe(method(label))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn label(&self) -> Option<Retained<NSString>>;
76
77 #[unsafe(method(value))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn value(&self) -> Retained<ValueType>;
80
81 #[unsafe(method(labeledValueWithLabel:value:))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn labeledValueWithLabel_value(
85 label: Option<&NSString>,
86 value: &ValueType,
87 ) -> Retained<Self>;
88
89 #[unsafe(method(initWithLabel:value:))]
91 #[unsafe(method_family = init)]
92 pub unsafe fn initWithLabel_value(
93 this: Allocated<Self>,
94 label: Option<&NSString>,
95 value: &ValueType,
96 ) -> Retained<Self>;
97
98 #[unsafe(method(labeledValueBySettingLabel:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn labeledValueBySettingLabel(&self, label: Option<&NSString>)
102 -> Retained<Self>;
103
104 #[unsafe(method(labeledValueBySettingValue:))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn labeledValueBySettingValue(&self, value: &ValueType) -> Retained<Self>;
108
109 #[unsafe(method(labeledValueBySettingLabel:value:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn labeledValueBySettingLabel_value(
113 &self,
114 label: Option<&NSString>,
115 value: &ValueType,
116 ) -> Retained<Self>;
117
118 #[unsafe(method(localizedStringForLabel:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn localizedStringForLabel(label: &NSString) -> Retained<NSString>;
130 );
131}
132
133impl<ValueType: Message + NSCopying + NSSecureCoding> CNLabeledValue<ValueType> {
135 extern_methods!(
136 #[unsafe(method(init))]
137 #[unsafe(method_family = init)]
138 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
139
140 #[unsafe(method(new))]
141 #[unsafe(method_family = new)]
142 pub unsafe fn new() -> Retained<Self>;
143 );
144}
145
146extern "C" {
147 pub static CNLabelHome: &'static NSString;
149}
150
151extern "C" {
152 pub static CNLabelWork: &'static NSString;
154}
155
156extern "C" {
157 pub static CNLabelSchool: &'static NSString;
159}
160
161extern "C" {
162 pub static CNLabelOther: &'static NSString;
164}
165
166extern "C" {
167 pub static CNLabelEmailiCloud: &'static NSString;
169}
170
171extern "C" {
172 pub static CNLabelURLAddressHomePage: &'static NSString;
174}
175
176extern "C" {
177 pub static CNLabelDateAnniversary: &'static NSString;
179}