objc2_core_spotlight/generated/
CSSearchableItemAttributeSet.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#[cfg(feature = "objc2-uniform-type-identifiers")]
8use objc2_uniform_type_identifiers::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/corespotlight/cssearchableitemattributeset?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct CSSearchableItemAttributeSet;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for CSSearchableItemAttributeSet {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for CSSearchableItemAttributeSet {}
25);
26
27unsafe impl CopyingHelper for CSSearchableItemAttributeSet {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for CSSearchableItemAttributeSet {}
33);
34
35extern_conformance!(
36    unsafe impl NSSecureCoding for CSSearchableItemAttributeSet {}
37);
38
39impl CSSearchableItemAttributeSet {
40    extern_methods!(
41        #[deprecated = "Use initWithContentType instead"]
42        #[unsafe(method(initWithItemContentType:))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn initWithItemContentType(
45            this: Allocated<Self>,
46            item_content_type: &NSString,
47        ) -> Retained<Self>;
48
49        #[cfg(feature = "objc2-uniform-type-identifiers")]
50        #[unsafe(method(initWithContentType:))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn initWithContentType(
53            this: Allocated<Self>,
54            content_type: &UTType,
55        ) -> Retained<Self>;
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60impl CSSearchableItemAttributeSet {
61    extern_methods!(
62        #[unsafe(method(init))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
65
66        #[unsafe(method(new))]
67        #[unsafe(method_family = new)]
68        pub unsafe fn new() -> Retained<Self>;
69    );
70}
71
72extern_class!(
73    /// [Apple's documentation](https://developer.apple.com/documentation/corespotlight/cslocalizedstring?language=objc)
74    #[unsafe(super(NSString, NSObject))]
75    #[derive(Debug, PartialEq, Eq, Hash)]
76    pub struct CSLocalizedString;
77);
78
79extern_conformance!(
80    unsafe impl NSCoding for CSLocalizedString {}
81);
82
83extern_conformance!(
84    unsafe impl NSCopying for CSLocalizedString {}
85);
86
87unsafe impl CopyingHelper for CSLocalizedString {
88    type Result = Self;
89}
90
91extern_conformance!(
92    unsafe impl NSMutableCopying for CSLocalizedString {}
93);
94
95unsafe impl MutableCopyingHelper for CSLocalizedString {
96    type Result = NSMutableString;
97}
98
99extern_conformance!(
100    unsafe impl NSObjectProtocol for CSLocalizedString {}
101);
102
103extern_conformance!(
104    unsafe impl NSSecureCoding for CSLocalizedString {}
105);
106
107impl CSLocalizedString {
108    extern_methods!(
109        /// # Safety
110        ///
111        /// `localized_strings` generic should be of the correct type.
112        #[unsafe(method(initWithLocalizedStrings:))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn initWithLocalizedStrings(
115            this: Allocated<Self>,
116            localized_strings: &NSDictionary,
117        ) -> Retained<Self>;
118
119        #[unsafe(method(localizedString))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn localizedString(&self) -> Retained<NSString>;
122    );
123}
124
125/// Methods declared on superclass `NSString`.
126impl CSLocalizedString {
127    extern_methods!(
128        #[unsafe(method(init))]
129        #[unsafe(method_family = init)]
130        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
131
132        /// # Safety
133        ///
134        /// `coder` possibly has further requirements.
135        #[unsafe(method(initWithCoder:))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn initWithCoder(
138            this: Allocated<Self>,
139            coder: &NSCoder,
140        ) -> Option<Retained<Self>>;
141    );
142}
143
144/// Methods declared on superclass `NSObject`.
145impl CSLocalizedString {
146    extern_methods!(
147        #[unsafe(method(new))]
148        #[unsafe(method_family = new)]
149        pub unsafe fn new() -> Retained<Self>;
150    );
151}
152
153extern_class!(
154    /// [Apple's documentation](https://developer.apple.com/documentation/corespotlight/cscustomattributekey?language=objc)
155    #[unsafe(super(NSObject))]
156    #[derive(Debug, PartialEq, Eq, Hash)]
157    pub struct CSCustomAttributeKey;
158);
159
160extern_conformance!(
161    unsafe impl NSCoding for CSCustomAttributeKey {}
162);
163
164extern_conformance!(
165    unsafe impl NSCopying for CSCustomAttributeKey {}
166);
167
168unsafe impl CopyingHelper for CSCustomAttributeKey {
169    type Result = Self;
170}
171
172extern_conformance!(
173    unsafe impl NSObjectProtocol for CSCustomAttributeKey {}
174);
175
176extern_conformance!(
177    unsafe impl NSSecureCoding for CSCustomAttributeKey {}
178);
179
180impl CSCustomAttributeKey {
181    extern_methods!(
182        #[unsafe(method(init))]
183        #[unsafe(method_family = init)]
184        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
185
186        #[unsafe(method(initWithKeyName:))]
187        #[unsafe(method_family = init)]
188        pub unsafe fn initWithKeyName(
189            this: Allocated<Self>,
190            key_name: &NSString,
191        ) -> Option<Retained<Self>>;
192
193        #[unsafe(method(initWithKeyName:searchable:searchableByDefault:unique:multiValued:))]
194        #[unsafe(method_family = init)]
195        pub unsafe fn initWithKeyName_searchable_searchableByDefault_unique_multiValued(
196            this: Allocated<Self>,
197            key_name: &NSString,
198            searchable: bool,
199            searchable_by_default: bool,
200            unique: bool,
201            multi_valued: bool,
202        ) -> Option<Retained<Self>>;
203
204        #[unsafe(method(keyName))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn keyName(&self) -> Retained<NSString>;
207
208        #[unsafe(method(isSearchable))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn isSearchable(&self) -> bool;
211
212        #[unsafe(method(isSearchableByDefault))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn isSearchableByDefault(&self) -> bool;
215
216        #[unsafe(method(isUnique))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn isUnique(&self) -> bool;
219
220        #[unsafe(method(isMultiValued))]
221        #[unsafe(method_family = none)]
222        pub unsafe fn isMultiValued(&self) -> bool;
223    );
224}
225
226/// Methods declared on superclass `NSObject`.
227impl CSCustomAttributeKey {
228    extern_methods!(
229        #[unsafe(method(new))]
230        #[unsafe(method_family = new)]
231        pub unsafe fn new() -> Retained<Self>;
232    );
233}
234
235/// CSCustomAttributes.
236impl CSSearchableItemAttributeSet {
237    extern_methods!(
238        /// # Safety
239        ///
240        /// `value` should be of the correct type.
241        #[unsafe(method(setValue:forCustomKey:))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn setValue_forCustomKey(
244            &self,
245            value: Option<&ProtocolObject<dyn NSSecureCoding>>,
246            key: &CSCustomAttributeKey,
247        );
248
249        #[unsafe(method(valueForCustomKey:))]
250        #[unsafe(method_family = none)]
251        pub unsafe fn valueForCustomKey(
252            &self,
253            key: &CSCustomAttributeKey,
254        ) -> Option<Retained<ProtocolObject<dyn NSSecureCoding>>>;
255    );
256}
257
258mod private_NSUserActivityCSSearchableItemAttributeSet {
259    pub trait Sealed {}
260}
261
262/// Category "CSSearchableItemAttributeSet" on [`NSUserActivity`].
263#[doc(alias = "CSSearchableItemAttributeSet")]
264pub unsafe trait NSUserActivityCSSearchableItemAttributeSet:
265    ClassType + Sized + private_NSUserActivityCSSearchableItemAttributeSet::Sealed
266{
267    extern_methods!(
268        #[unsafe(method(contentAttributeSet))]
269        #[unsafe(method_family = none)]
270        unsafe fn contentAttributeSet(&self) -> Option<Retained<CSSearchableItemAttributeSet>>;
271
272        /// Setter for [`contentAttributeSet`][Self::contentAttributeSet].
273        ///
274        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
275        #[unsafe(method(setContentAttributeSet:))]
276        #[unsafe(method_family = none)]
277        unsafe fn setContentAttributeSet(
278            &self,
279            content_attribute_set: Option<&CSSearchableItemAttributeSet>,
280        );
281    );
282}
283
284impl private_NSUserActivityCSSearchableItemAttributeSet::Sealed for NSUserActivity {}
285unsafe impl NSUserActivityCSSearchableItemAttributeSet for NSUserActivity {}