objc2_core_spotlight/generated/
CSSearchableItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static CSSearchableItemActionType: &'static NSString;
13}
14
15extern "C" {
16 pub static CSSearchableItemActivityIdentifier: &'static NSString;
18}
19
20extern "C" {
21 pub static CSActionIdentifier: &'static NSString;
23}
24
25extern "C" {
26 pub static CSQueryContinuationActionType: &'static NSString;
28}
29
30extern "C" {
31 pub static CSSearchQueryString: &'static NSString;
33}
34
35#[repr(transparent)]
38#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
39pub struct CSSearchableItemUpdateListenerOptions(pub NSUInteger);
40bitflags::bitflags! {
41 impl CSSearchableItemUpdateListenerOptions: NSUInteger {
42 #[doc(alias = "CSSearchableItemUpdateListenerOptionDefault")]
43 const Default = 0;
44 #[doc(alias = "CSSearchableItemUpdateListenerOptionSummarization")]
45 const Summarization = 1<<1;
46 #[doc(alias = "CSSearchableItemUpdateListenerOptionPriority")]
47 const Priority = 1<<2;
48 }
49}
50
51unsafe impl Encode for CSSearchableItemUpdateListenerOptions {
52 const ENCODING: Encoding = NSUInteger::ENCODING;
53}
54
55unsafe impl RefEncode for CSSearchableItemUpdateListenerOptions {
56 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
57}
58
59extern_class!(
60 #[unsafe(super(NSObject))]
62 #[derive(Debug, PartialEq, Eq, Hash)]
63 pub struct CSSearchableItem;
64);
65
66extern_conformance!(
67 unsafe impl NSCoding for CSSearchableItem {}
68);
69
70extern_conformance!(
71 unsafe impl NSCopying for CSSearchableItem {}
72);
73
74unsafe impl CopyingHelper for CSSearchableItem {
75 type Result = Self;
76}
77
78extern_conformance!(
79 unsafe impl NSObjectProtocol for CSSearchableItem {}
80);
81
82extern_conformance!(
83 unsafe impl NSSecureCoding for CSSearchableItem {}
84);
85
86impl CSSearchableItem {
87 extern_methods!(
88 #[cfg(feature = "CSSearchableItemAttributeSet")]
89 #[unsafe(method(initWithUniqueIdentifier:domainIdentifier:attributeSet:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithUniqueIdentifier_domainIdentifier_attributeSet(
92 this: Allocated<Self>,
93 unique_identifier: Option<&NSString>,
94 domain_identifier: Option<&NSString>,
95 attribute_set: &CSSearchableItemAttributeSet,
96 ) -> Retained<Self>;
97
98 #[unsafe(method(compareByRank:))]
99 #[unsafe(method_family = none)]
100 pub unsafe fn compareByRank(&self, other: &CSSearchableItem) -> NSComparisonResult;
101
102 #[unsafe(method(uniqueIdentifier))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn uniqueIdentifier(&self) -> Retained<NSString>;
105
106 #[unsafe(method(setUniqueIdentifier:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setUniqueIdentifier(&self, unique_identifier: &NSString);
112
113 #[unsafe(method(domainIdentifier))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn domainIdentifier(&self) -> Option<Retained<NSString>>;
116
117 #[unsafe(method(setDomainIdentifier:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn setDomainIdentifier(&self, domain_identifier: Option<&NSString>);
123
124 #[unsafe(method(expirationDate))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn expirationDate(&self) -> Retained<NSDate>;
127
128 #[unsafe(method(setExpirationDate:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn setExpirationDate(&self, expiration_date: Option<&NSDate>);
134
135 #[cfg(feature = "CSSearchableItemAttributeSet")]
136 #[unsafe(method(attributeSet))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn attributeSet(&self) -> Retained<CSSearchableItemAttributeSet>;
139
140 #[cfg(feature = "CSSearchableItemAttributeSet")]
141 #[unsafe(method(setAttributeSet:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn setAttributeSet(&self, attribute_set: &CSSearchableItemAttributeSet);
145
146 #[unsafe(method(isUpdate))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn isUpdate(&self) -> bool;
149
150 #[unsafe(method(setIsUpdate:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setIsUpdate(&self, is_update: bool);
154
155 #[unsafe(method(updateListenerOptions))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn updateListenerOptions(&self) -> CSSearchableItemUpdateListenerOptions;
158
159 #[unsafe(method(setUpdateListenerOptions:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn setUpdateListenerOptions(
163 &self,
164 update_listener_options: CSSearchableItemUpdateListenerOptions,
165 );
166 );
167}
168
169impl CSSearchableItem {
171 extern_methods!(
172 #[unsafe(method(init))]
173 #[unsafe(method_family = init)]
174 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
175
176 #[unsafe(method(new))]
177 #[unsafe(method_family = new)]
178 pub unsafe fn new() -> Retained<Self>;
179 );
180}