objc2_core_data/generated/
NSAttributeDescription.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSAttributeType(pub NSUInteger);
15impl NSAttributeType {
16 #[doc(alias = "NSUndefinedAttributeType")]
17 pub const UndefinedAttributeType: Self = Self(0);
18 #[doc(alias = "NSInteger16AttributeType")]
19 pub const Integer16AttributeType: Self = Self(100);
20 #[doc(alias = "NSInteger32AttributeType")]
21 pub const Integer32AttributeType: Self = Self(200);
22 #[doc(alias = "NSInteger64AttributeType")]
23 pub const Integer64AttributeType: Self = Self(300);
24 #[doc(alias = "NSDecimalAttributeType")]
25 pub const DecimalAttributeType: Self = Self(400);
26 #[doc(alias = "NSDoubleAttributeType")]
27 pub const DoubleAttributeType: Self = Self(500);
28 #[doc(alias = "NSFloatAttributeType")]
29 pub const FloatAttributeType: Self = Self(600);
30 #[doc(alias = "NSStringAttributeType")]
31 pub const StringAttributeType: Self = Self(700);
32 #[doc(alias = "NSBooleanAttributeType")]
33 pub const BooleanAttributeType: Self = Self(800);
34 #[doc(alias = "NSDateAttributeType")]
35 pub const DateAttributeType: Self = Self(900);
36 #[doc(alias = "NSBinaryDataAttributeType")]
37 pub const BinaryDataAttributeType: Self = Self(1000);
38 #[doc(alias = "NSUUIDAttributeType")]
39 pub const UUIDAttributeType: Self = Self(1100);
40 #[doc(alias = "NSURIAttributeType")]
41 pub const URIAttributeType: Self = Self(1200);
42 #[doc(alias = "NSTransformableAttributeType")]
43 pub const TransformableAttributeType: Self = Self(1800);
44 #[doc(alias = "NSObjectIDAttributeType")]
45 pub const ObjectIDAttributeType: Self = Self(2000);
46 #[doc(alias = "NSCompositeAttributeType")]
47 pub const CompositeAttributeType: Self = Self(2100);
48}
49
50unsafe impl Encode for NSAttributeType {
51 const ENCODING: Encoding = NSUInteger::ENCODING;
52}
53
54unsafe impl RefEncode for NSAttributeType {
55 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58extern_class!(
59 #[unsafe(super(NSPropertyDescription, NSObject))]
61 #[derive(Debug, PartialEq, Eq, Hash)]
62 #[cfg(feature = "NSPropertyDescription")]
63 pub struct NSAttributeDescription;
64);
65
66#[cfg(feature = "NSPropertyDescription")]
67extern_conformance!(
68 unsafe impl NSCoding for NSAttributeDescription {}
69);
70
71#[cfg(feature = "NSPropertyDescription")]
72extern_conformance!(
73 unsafe impl NSCopying for NSAttributeDescription {}
74);
75
76#[cfg(feature = "NSPropertyDescription")]
77unsafe impl CopyingHelper for NSAttributeDescription {
78 type Result = Self;
79}
80
81#[cfg(feature = "NSPropertyDescription")]
82extern_conformance!(
83 unsafe impl NSObjectProtocol for NSAttributeDescription {}
84);
85
86#[cfg(feature = "NSPropertyDescription")]
87impl NSAttributeDescription {
88 extern_methods!(
89 #[unsafe(method(attributeType))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn attributeType(&self) -> NSAttributeType;
92
93 #[unsafe(method(setAttributeType:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn setAttributeType(&self, attribute_type: NSAttributeType);
97
98 #[unsafe(method(attributeValueClassName))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn attributeValueClassName(&self) -> Option<Retained<NSString>>;
101
102 #[unsafe(method(setAttributeValueClassName:))]
104 #[unsafe(method_family = none)]
105 pub unsafe fn setAttributeValueClassName(
106 &self,
107 attribute_value_class_name: Option<&NSString>,
108 );
109
110 #[unsafe(method(defaultValue))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn defaultValue(&self) -> Option<Retained<AnyObject>>;
113
114 #[unsafe(method(setDefaultValue:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn setDefaultValue(&self, default_value: Option<&AnyObject>);
118
119 #[unsafe(method(versionHash))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn versionHash(&self) -> Retained<NSData>;
122
123 #[unsafe(method(valueTransformerName))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn valueTransformerName(&self) -> Option<Retained<NSString>>;
126
127 #[unsafe(method(setValueTransformerName:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setValueTransformerName(&self, value_transformer_name: Option<&NSString>);
131
132 #[unsafe(method(allowsExternalBinaryDataStorage))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn allowsExternalBinaryDataStorage(&self) -> bool;
135
136 #[unsafe(method(setAllowsExternalBinaryDataStorage:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn setAllowsExternalBinaryDataStorage(
140 &self,
141 allows_external_binary_data_storage: bool,
142 );
143
144 #[unsafe(method(preservesValueInHistoryOnDeletion))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn preservesValueInHistoryOnDeletion(&self) -> bool;
147
148 #[unsafe(method(setPreservesValueInHistoryOnDeletion:))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn setPreservesValueInHistoryOnDeletion(
152 &self,
153 preserves_value_in_history_on_deletion: bool,
154 );
155
156 #[unsafe(method(allowsCloudEncryption))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn allowsCloudEncryption(&self) -> bool;
159
160 #[unsafe(method(setAllowsCloudEncryption:))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn setAllowsCloudEncryption(&self, allows_cloud_encryption: bool);
164 );
165}
166
167#[cfg(feature = "NSPropertyDescription")]
169impl NSAttributeDescription {
170 extern_methods!(
171 #[unsafe(method(init))]
172 #[unsafe(method_family = init)]
173 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
174
175 #[unsafe(method(new))]
176 #[unsafe(method_family = new)]
177 pub unsafe fn new() -> Retained<Self>;
178 );
179}