objc2_core_data/generated/
NSPropertyDescription.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/coredata/nspropertydescription?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSPropertyDescription;
15);
16
17extern_conformance!(
18    unsafe impl NSCoding for NSPropertyDescription {}
19);
20
21extern_conformance!(
22    unsafe impl NSCopying for NSPropertyDescription {}
23);
24
25unsafe impl CopyingHelper for NSPropertyDescription {
26    type Result = Self;
27}
28
29extern_conformance!(
30    unsafe impl NSObjectProtocol for NSPropertyDescription {}
31);
32
33impl NSPropertyDescription {
34    extern_methods!(
35        #[cfg(feature = "NSEntityDescription")]
36        /// # Safety
37        ///
38        /// This is not retained internally, you must ensure the object is still alive.
39        #[unsafe(method(entity))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn entity(&self) -> Retained<NSEntityDescription>;
42
43        #[unsafe(method(name))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn name(&self) -> Retained<NSString>;
46
47        /// Setter for [`name`][Self::name].
48        ///
49        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
50        #[unsafe(method(setName:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setName(&self, name: &NSString);
53
54        #[unsafe(method(isOptional))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn isOptional(&self) -> bool;
57
58        /// Setter for [`isOptional`][Self::isOptional].
59        #[unsafe(method(setOptional:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setOptional(&self, optional: bool);
62
63        #[unsafe(method(isTransient))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn isTransient(&self) -> bool;
66
67        /// Setter for [`isTransient`][Self::isTransient].
68        #[unsafe(method(setTransient:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setTransient(&self, transient: bool);
71
72        #[unsafe(method(validationPredicates))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn validationPredicates(&self) -> Retained<NSArray<NSPredicate>>;
75
76        #[unsafe(method(validationWarnings))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn validationWarnings(&self) -> Retained<NSArray>;
79
80        #[unsafe(method(setValidationPredicates:withValidationWarnings:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn setValidationPredicates_withValidationWarnings(
83            &self,
84            validation_predicates: Option<&NSArray<NSPredicate>>,
85            validation_warnings: Option<&NSArray<NSString>>,
86        );
87
88        #[unsafe(method(userInfo))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;
91
92        /// Setter for [`userInfo`][Self::userInfo].
93        ///
94        /// # Safety
95        ///
96        /// `user_info` generic should be of the correct type.
97        #[unsafe(method(setUserInfo:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);
100
101        #[deprecated = "Use NSEntityDescription.indexes instead"]
102        #[unsafe(method(isIndexed))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn isIndexed(&self) -> bool;
105
106        /// Setter for [`isIndexed`][Self::isIndexed].
107        #[deprecated = "Use NSEntityDescription.indexes instead"]
108        #[unsafe(method(setIndexed:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setIndexed(&self, indexed: bool);
111
112        #[unsafe(method(versionHash))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn versionHash(&self) -> Retained<NSData>;
115
116        #[unsafe(method(versionHashModifier))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn versionHashModifier(&self) -> Option<Retained<NSString>>;
119
120        /// Setter for [`versionHashModifier`][Self::versionHashModifier].
121        ///
122        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
123        #[unsafe(method(setVersionHashModifier:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setVersionHashModifier(&self, version_hash_modifier: Option<&NSString>);
126
127        #[unsafe(method(isIndexedBySpotlight))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn isIndexedBySpotlight(&self) -> bool;
130
131        /// Setter for [`isIndexedBySpotlight`][Self::isIndexedBySpotlight].
132        #[unsafe(method(setIndexedBySpotlight:))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn setIndexedBySpotlight(&self, indexed_by_spotlight: bool);
135
136        #[deprecated = "Spotlight integration is deprecated. Use CoreSpotlight integration instead."]
137        #[unsafe(method(isStoredInExternalRecord))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn isStoredInExternalRecord(&self) -> bool;
140
141        /// Setter for [`isStoredInExternalRecord`][Self::isStoredInExternalRecord].
142        #[deprecated = "Spotlight integration is deprecated. Use CoreSpotlight integration instead."]
143        #[unsafe(method(setStoredInExternalRecord:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn setStoredInExternalRecord(&self, stored_in_external_record: bool);
146
147        #[unsafe(method(renamingIdentifier))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn renamingIdentifier(&self) -> Option<Retained<NSString>>;
150
151        /// Setter for [`renamingIdentifier`][Self::renamingIdentifier].
152        ///
153        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
154        #[unsafe(method(setRenamingIdentifier:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn setRenamingIdentifier(&self, renaming_identifier: Option<&NSString>);
157    );
158}
159
160/// Methods declared on superclass `NSObject`.
161impl NSPropertyDescription {
162    extern_methods!(
163        #[unsafe(method(init))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167        #[unsafe(method(new))]
168        #[unsafe(method_family = new)]
169        pub unsafe fn new() -> Retained<Self>;
170    );
171}