objc2_ui_kit/generated/
UISearchSuggestion.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait UISearchSuggestion: NSObjectProtocol + MainThreadOnly {
13 #[unsafe(method(localizedSuggestion))]
15 #[unsafe(method_family = none)]
16 fn localizedSuggestion(&self) -> Option<Retained<NSString>>;
17
18 #[optional]
20 #[unsafe(method(localizedDescription))]
21 #[unsafe(method_family = none)]
22 fn localizedDescription(&self) -> Option<Retained<NSString>>;
23
24 #[cfg(feature = "UIImage")]
25 #[optional]
27 #[unsafe(method(iconImage))]
28 #[unsafe(method_family = none)]
29 fn iconImage(&self) -> Option<Retained<UIImage>>;
30
31 #[unsafe(method(localizedAttributedSuggestion))]
33 #[unsafe(method_family = none)]
34 fn localizedAttributedSuggestion(&self) -> Option<Retained<NSAttributedString>>;
35
36 #[unsafe(method(representedObject))]
38 #[unsafe(method_family = none)]
39 fn representedObject(&self) -> Option<Retained<AnyObject>>;
40
41 #[unsafe(method(setRepresentedObject:))]
47 #[unsafe(method_family = none)]
48 unsafe fn setRepresentedObject(&self, represented_object: Option<&AnyObject>);
49 }
50);
51
52extern_class!(
53 #[unsafe(super(NSObject))]
57 #[thread_kind = MainThreadOnly]
58 #[derive(Debug, PartialEq, Eq, Hash)]
59 pub struct UISearchSuggestionItem;
60);
61
62extern_conformance!(
63 unsafe impl NSObjectProtocol for UISearchSuggestionItem {}
64);
65
66extern_conformance!(
67 unsafe impl UISearchSuggestion for UISearchSuggestionItem {}
68);
69
70impl UISearchSuggestionItem {
71 extern_methods!(
72 #[unsafe(method(suggestionWithLocalizedSuggestion:))]
74 #[unsafe(method_family = none)]
75 pub fn suggestionWithLocalizedSuggestion(
76 suggestion: &NSString,
77 mtm: MainThreadMarker,
78 ) -> Retained<Self>;
79
80 #[unsafe(method(suggestionWithLocalizedSuggestion:descriptionString:))]
82 #[unsafe(method_family = none)]
83 pub fn suggestionWithLocalizedSuggestion_descriptionString(
84 suggestion: &NSString,
85 description: Option<&NSString>,
86 mtm: MainThreadMarker,
87 ) -> Retained<Self>;
88
89 #[cfg(feature = "UIImage")]
90 #[unsafe(method(suggestionWithLocalizedSuggestion:descriptionString:iconImage:))]
92 #[unsafe(method_family = none)]
93 pub fn suggestionWithLocalizedSuggestion_descriptionString_iconImage(
94 suggestion: &NSString,
95 description: Option<&NSString>,
96 icon_image: Option<&UIImage>,
97 mtm: MainThreadMarker,
98 ) -> Retained<Self>;
99
100 #[unsafe(method(suggestionWithLocalizedAttributedSuggestion:))]
102 #[unsafe(method_family = none)]
103 pub fn suggestionWithLocalizedAttributedSuggestion(
104 suggestion: &NSAttributedString,
105 mtm: MainThreadMarker,
106 ) -> Retained<Self>;
107
108 #[unsafe(method(suggestionWithLocalizedAttributedSuggestion:descriptionString:))]
109 #[unsafe(method_family = none)]
110 pub fn suggestionWithLocalizedAttributedSuggestion_descriptionString(
111 suggestion: &NSAttributedString,
112 description: Option<&NSString>,
113 mtm: MainThreadMarker,
114 ) -> Retained<Self>;
115
116 #[cfg(feature = "UIImage")]
117 #[unsafe(method(suggestionWithLocalizedAttributedSuggestion:descriptionString:iconImage:))]
118 #[unsafe(method_family = none)]
119 pub fn suggestionWithLocalizedAttributedSuggestion_descriptionString_iconImage(
120 suggestion: &NSAttributedString,
121 description: Option<&NSString>,
122 icon_image: Option<&UIImage>,
123 mtm: MainThreadMarker,
124 ) -> Retained<Self>;
125
126 #[unsafe(method(initWithLocalizedSuggestion:))]
128 #[unsafe(method_family = init)]
129 pub fn initWithLocalizedSuggestion(
130 this: Allocated<Self>,
131 suggestion: &NSString,
132 ) -> Retained<Self>;
133
134 #[unsafe(method(initWithLocalizedSuggestion:localizedDescription:))]
136 #[unsafe(method_family = init)]
137 pub fn initWithLocalizedSuggestion_localizedDescription(
138 this: Allocated<Self>,
139 suggestion: &NSString,
140 description: Option<&NSString>,
141 ) -> Retained<Self>;
142
143 #[cfg(feature = "UIImage")]
144 #[unsafe(method(initWithLocalizedSuggestion:localizedDescription:iconImage:))]
146 #[unsafe(method_family = init)]
147 pub fn initWithLocalizedSuggestion_localizedDescription_iconImage(
148 this: Allocated<Self>,
149 suggestion: &NSString,
150 description: Option<&NSString>,
151 icon_image: Option<&UIImage>,
152 ) -> Retained<Self>;
153
154 #[unsafe(method(initWithLocalizedAttributedSuggestion:))]
156 #[unsafe(method_family = init)]
157 pub fn initWithLocalizedAttributedSuggestion(
158 this: Allocated<Self>,
159 suggestion: &NSAttributedString,
160 ) -> Retained<Self>;
161
162 #[unsafe(method(initWithLocalizedAttributedSuggestion:localizedDescription:))]
163 #[unsafe(method_family = init)]
164 pub fn initWithLocalizedAttributedSuggestion_localizedDescription(
165 this: Allocated<Self>,
166 suggestion: &NSAttributedString,
167 description: Option<&NSString>,
168 ) -> Retained<Self>;
169
170 #[cfg(feature = "UIImage")]
171 #[unsafe(method(initWithLocalizedAttributedSuggestion:localizedDescription:iconImage:))]
172 #[unsafe(method_family = init)]
173 pub fn initWithLocalizedAttributedSuggestion_localizedDescription_iconImage(
174 this: Allocated<Self>,
175 suggestion: &NSAttributedString,
176 description: Option<&NSString>,
177 icon_image: Option<&UIImage>,
178 ) -> Retained<Self>;
179
180 #[unsafe(method(localizedAttributedSuggestion))]
182 #[unsafe(method_family = none)]
183 pub fn localizedAttributedSuggestion(&self) -> Option<Retained<NSAttributedString>>;
184
185 #[unsafe(method(localizedSuggestion))]
187 #[unsafe(method_family = none)]
188 pub fn localizedSuggestion(&self) -> Option<Retained<NSString>>;
189
190 #[unsafe(method(localizedDescription))]
192 #[unsafe(method_family = none)]
193 pub fn localizedDescription(&self) -> Option<Retained<NSString>>;
194
195 #[cfg(feature = "UIImage")]
196 #[unsafe(method(iconImage))]
198 #[unsafe(method_family = none)]
199 pub fn iconImage(&self) -> Option<Retained<UIImage>>;
200
201 #[unsafe(method(representedObject))]
203 #[unsafe(method_family = none)]
204 pub fn representedObject(&self) -> Option<Retained<AnyObject>>;
205
206 #[unsafe(method(setRepresentedObject:))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn setRepresentedObject(&self, represented_object: Option<&AnyObject>);
214 );
215}
216
217impl UISearchSuggestionItem {
219 extern_methods!(
220 #[unsafe(method(init))]
221 #[unsafe(method_family = init)]
222 pub fn init(this: Allocated<Self>) -> Retained<Self>;
223
224 #[unsafe(method(new))]
225 #[unsafe(method_family = new)]
226 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
227 );
228}