objc2_ui_kit/generated/
UIImageSymbolConfiguration.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct UIImageSymbolScale(pub NSInteger);
16impl UIImageSymbolScale {
17 #[doc(alias = "UIImageSymbolScaleDefault")]
18 pub const Default: Self = Self(-1);
19 #[doc(alias = "UIImageSymbolScaleUnspecified")]
20 pub const Unspecified: Self = Self(0);
21 #[doc(alias = "UIImageSymbolScaleSmall")]
22 pub const Small: Self = Self(1);
23 #[doc(alias = "UIImageSymbolScaleMedium")]
24 pub const Medium: Self = Self(2);
25 #[doc(alias = "UIImageSymbolScaleLarge")]
26 pub const Large: Self = Self(3);
27}
28
29unsafe impl Encode for UIImageSymbolScale {
30 const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for UIImageSymbolScale {
34 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct UIImageSymbolWeight(pub NSInteger);
42impl UIImageSymbolWeight {
43 #[doc(alias = "UIImageSymbolWeightUnspecified")]
44 pub const Unspecified: Self = Self(0);
45 #[doc(alias = "UIImageSymbolWeightUltraLight")]
46 pub const UltraLight: Self = Self(1);
47 #[doc(alias = "UIImageSymbolWeightThin")]
48 pub const Thin: Self = Self(2);
49 #[doc(alias = "UIImageSymbolWeightLight")]
50 pub const Light: Self = Self(3);
51 #[doc(alias = "UIImageSymbolWeightRegular")]
52 pub const Regular: Self = Self(4);
53 #[doc(alias = "UIImageSymbolWeightMedium")]
54 pub const Medium: Self = Self(5);
55 #[doc(alias = "UIImageSymbolWeightSemibold")]
56 pub const Semibold: Self = Self(6);
57 #[doc(alias = "UIImageSymbolWeightBold")]
58 pub const Bold: Self = Self(7);
59 #[doc(alias = "UIImageSymbolWeightHeavy")]
60 pub const Heavy: Self = Self(8);
61 #[doc(alias = "UIImageSymbolWeightBlack")]
62 pub const Black: Self = Self(9);
63}
64
65unsafe impl Encode for UIImageSymbolWeight {
66 const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69unsafe impl RefEncode for UIImageSymbolWeight {
70 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73#[repr(transparent)]
76#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
77pub struct UIImageSymbolVariableValueMode(pub NSInteger);
78impl UIImageSymbolVariableValueMode {
79 #[doc(alias = "UIImageSymbolVariableValueModeAutomatic")]
81 pub const Automatic: Self = Self(0);
82 #[doc(alias = "UIImageSymbolVariableValueModeColor")]
85 pub const Color: Self = Self(1);
86 #[doc(alias = "UIImageSymbolVariableValueModeDraw")]
89 pub const Draw: Self = Self(2);
90}
91
92unsafe impl Encode for UIImageSymbolVariableValueMode {
93 const ENCODING: Encoding = NSInteger::ENCODING;
94}
95
96unsafe impl RefEncode for UIImageSymbolVariableValueMode {
97 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
98}
99
100unsafe impl Send for UIImageSymbolVariableValueMode {}
101
102unsafe impl Sync for UIImageSymbolVariableValueMode {}
103
104#[repr(transparent)]
107#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
108pub struct UIImageSymbolColorRenderingMode(pub NSInteger);
109impl UIImageSymbolColorRenderingMode {
110 #[doc(alias = "UIImageSymbolColorRenderingModeAutomatic")]
112 pub const Automatic: Self = Self(0);
113 #[doc(alias = "UIImageSymbolColorRenderingModeFlat")]
115 pub const Flat: Self = Self(1);
116 #[doc(alias = "UIImageSymbolColorRenderingModeGradient")]
118 pub const Gradient: Self = Self(2);
119}
120
121unsafe impl Encode for UIImageSymbolColorRenderingMode {
122 const ENCODING: Encoding = NSInteger::ENCODING;
123}
124
125unsafe impl RefEncode for UIImageSymbolColorRenderingMode {
126 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
127}
128
129unsafe impl Send for UIImageSymbolColorRenderingMode {}
130
131unsafe impl Sync for UIImageSymbolColorRenderingMode {}
132
133#[cfg(all(feature = "UIFontDescriptor", feature = "objc2-core-foundation"))]
134#[inline]
135pub extern "C-unwind" fn UIFontWeightForImageSymbolWeight(
136 symbol_weight: UIImageSymbolWeight,
137) -> UIFontWeight {
138 extern "C-unwind" {
139 fn UIFontWeightForImageSymbolWeight(symbol_weight: UIImageSymbolWeight) -> UIFontWeight;
140 }
141 unsafe { UIFontWeightForImageSymbolWeight(symbol_weight) }
142}
143
144impl UIImageSymbolWeight {
145 #[doc(alias = "UIImageSymbolWeightForFontWeight")]
146 #[cfg(all(feature = "UIFontDescriptor", feature = "objc2-core-foundation"))]
147 #[inline]
148 pub fn for_font_weight(font_weight: UIFontWeight) -> UIImageSymbolWeight {
149 extern "C-unwind" {
150 fn UIImageSymbolWeightForFontWeight(font_weight: UIFontWeight) -> UIImageSymbolWeight;
151 }
152 unsafe { UIImageSymbolWeightForFontWeight(font_weight) }
153 }
154}
155
156extern_class!(
157 #[unsafe(super(UIImageConfiguration, NSObject))]
159 #[derive(Debug, PartialEq, Eq, Hash)]
160 #[cfg(feature = "UIImageConfiguration")]
161 pub struct UIImageSymbolConfiguration;
162);
163
164#[cfg(feature = "UIImageConfiguration")]
165unsafe impl Send for UIImageSymbolConfiguration {}
166
167#[cfg(feature = "UIImageConfiguration")]
168unsafe impl Sync for UIImageSymbolConfiguration {}
169
170#[cfg(feature = "UIImageConfiguration")]
171extern_conformance!(
172 unsafe impl NSCoding for UIImageSymbolConfiguration {}
173);
174
175#[cfg(feature = "UIImageConfiguration")]
176extern_conformance!(
177 unsafe impl NSCopying for UIImageSymbolConfiguration {}
178);
179
180#[cfg(feature = "UIImageConfiguration")]
181unsafe impl CopyingHelper for UIImageSymbolConfiguration {
182 type Result = Self;
183}
184
185#[cfg(feature = "UIImageConfiguration")]
186extern_conformance!(
187 unsafe impl NSObjectProtocol for UIImageSymbolConfiguration {}
188);
189
190#[cfg(feature = "UIImageConfiguration")]
191extern_conformance!(
192 unsafe impl NSSecureCoding for UIImageSymbolConfiguration {}
193);
194
195#[cfg(feature = "UIImageConfiguration")]
196impl UIImageSymbolConfiguration {
197 extern_methods!(
198 #[unsafe(method(unspecifiedConfiguration))]
199 #[unsafe(method_family = none)]
200 pub fn unspecifiedConfiguration() -> Retained<UIImageSymbolConfiguration>;
201
202 #[unsafe(method(configurationWithScale:))]
203 #[unsafe(method_family = none)]
204 pub fn configurationWithScale(scale: UIImageSymbolScale) -> Retained<Self>;
205
206 #[cfg(feature = "objc2-core-foundation")]
207 #[unsafe(method(configurationWithPointSize:))]
208 #[unsafe(method_family = none)]
209 pub fn configurationWithPointSize(point_size: CGFloat) -> Retained<Self>;
210
211 #[unsafe(method(configurationWithWeight:))]
212 #[unsafe(method_family = none)]
213 pub fn configurationWithWeight(weight: UIImageSymbolWeight) -> Retained<Self>;
214
215 #[cfg(feature = "objc2-core-foundation")]
216 #[unsafe(method(configurationWithPointSize:weight:))]
217 #[unsafe(method_family = none)]
218 pub fn configurationWithPointSize_weight(
219 point_size: CGFloat,
220 weight: UIImageSymbolWeight,
221 ) -> Retained<Self>;
222
223 #[cfg(feature = "objc2-core-foundation")]
224 #[unsafe(method(configurationWithPointSize:weight:scale:))]
225 #[unsafe(method_family = none)]
226 pub fn configurationWithPointSize_weight_scale(
227 point_size: CGFloat,
228 weight: UIImageSymbolWeight,
229 scale: UIImageSymbolScale,
230 ) -> Retained<Self>;
231
232 #[cfg(feature = "UIFontDescriptor")]
233 #[unsafe(method(configurationWithTextStyle:))]
234 #[unsafe(method_family = none)]
235 pub fn configurationWithTextStyle(text_style: &UIFontTextStyle) -> Retained<Self>;
236
237 #[cfg(feature = "UIFontDescriptor")]
238 #[unsafe(method(configurationWithTextStyle:scale:))]
239 #[unsafe(method_family = none)]
240 pub fn configurationWithTextStyle_scale(
241 text_style: &UIFontTextStyle,
242 scale: UIImageSymbolScale,
243 ) -> Retained<Self>;
244
245 #[cfg(feature = "UIFont")]
246 #[unsafe(method(configurationWithFont:))]
247 #[unsafe(method_family = none)]
248 pub fn configurationWithFont(font: &UIFont) -> Retained<Self>;
249
250 #[cfg(feature = "UIFont")]
251 #[unsafe(method(configurationWithFont:scale:))]
252 #[unsafe(method_family = none)]
253 pub fn configurationWithFont_scale(
254 font: &UIFont,
255 scale: UIImageSymbolScale,
256 ) -> Retained<Self>;
257
258 #[cfg(feature = "UIColor")]
259 #[unsafe(method(configurationWithHierarchicalColor:))]
260 #[unsafe(method_family = none)]
261 pub fn configurationWithHierarchicalColor(hierarchical_color: &UIColor) -> Retained<Self>;
262
263 #[cfg(feature = "UIColor")]
264 #[unsafe(method(configurationWithPaletteColors:))]
265 #[unsafe(method_family = none)]
266 pub fn configurationWithPaletteColors(palette_colors: &NSArray<UIColor>) -> Retained<Self>;
267
268 #[unsafe(method(configurationPreferringMulticolor))]
269 #[unsafe(method_family = none)]
270 pub fn configurationPreferringMulticolor() -> Retained<Self>;
271
272 #[unsafe(method(configurationPreferringMonochrome))]
273 #[unsafe(method_family = none)]
274 pub fn configurationPreferringMonochrome() -> Retained<Self>;
275
276 #[unsafe(method(configurationWithVariableValueMode:))]
278 #[unsafe(method_family = none)]
279 pub fn configurationWithVariableValueMode(
280 variable_value_mode: UIImageSymbolVariableValueMode,
281 ) -> Retained<Self>;
282
283 #[unsafe(method(configurationWithColorRenderingMode:))]
285 #[unsafe(method_family = none)]
286 pub fn configurationWithColorRenderingMode(
287 mode: UIImageSymbolColorRenderingMode,
288 ) -> Retained<Self>;
289
290 #[unsafe(method(configurationWithoutTextStyle))]
291 #[unsafe(method_family = none)]
292 pub fn configurationWithoutTextStyle(&self) -> Retained<Self>;
293
294 #[unsafe(method(configurationWithoutScale))]
295 #[unsafe(method_family = none)]
296 pub fn configurationWithoutScale(&self) -> Retained<Self>;
297
298 #[unsafe(method(configurationWithoutWeight))]
299 #[unsafe(method_family = none)]
300 pub fn configurationWithoutWeight(&self) -> Retained<Self>;
301
302 #[unsafe(method(configurationWithoutPointSizeAndWeight))]
303 #[unsafe(method_family = none)]
304 pub fn configurationWithoutPointSizeAndWeight(&self) -> Retained<Self>;
305
306 #[unsafe(method(isEqualToConfiguration:))]
307 #[unsafe(method_family = none)]
308 pub fn isEqualToConfiguration(
309 &self,
310 other_configuration: Option<&UIImageSymbolConfiguration>,
311 ) -> bool;
312 );
313}
314
315#[cfg(feature = "UIImageConfiguration")]
317impl UIImageSymbolConfiguration {
318 extern_methods!(
319 #[unsafe(method(new))]
320 #[unsafe(method_family = new)]
321 pub unsafe fn new() -> Retained<Self>;
322
323 #[unsafe(method(init))]
324 #[unsafe(method_family = init)]
325 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
326
327 #[cfg(feature = "UITraitCollection")]
328 #[unsafe(method(configurationWithTraitCollection:))]
329 #[unsafe(method_family = none)]
330 pub fn configurationWithTraitCollection(
331 trait_collection: Option<&UITraitCollection>,
332 ) -> Retained<Self>;
333
334 #[unsafe(method(configurationWithLocale:))]
335 #[unsafe(method_family = none)]
336 pub fn configurationWithLocale(locale: Option<&NSLocale>) -> Retained<Self>;
337 );
338}
339
340#[cfg(all(feature = "UIFontDescriptor", feature = "objc2-core-foundation"))]
341#[deprecated = "renamed to `UIImageSymbolWeight::for_font_weight`"]
342#[inline]
343pub extern "C-unwind" fn UIImageSymbolWeightForFontWeight(
344 font_weight: UIFontWeight,
345) -> UIImageSymbolWeight {
346 extern "C-unwind" {
347 fn UIImageSymbolWeightForFontWeight(font_weight: UIFontWeight) -> UIImageSymbolWeight;
348 }
349 unsafe { UIImageSymbolWeightForFontWeight(font_weight) }
350}