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
73extern "C-unwind" {
74 #[cfg(all(feature = "UIFontDescriptor", feature = "objc2-core-foundation"))]
75 pub fn UIFontWeightForImageSymbolWeight(symbol_weight: UIImageSymbolWeight) -> UIFontWeight;
76}
77
78impl UIImageSymbolWeight {
79 #[doc(alias = "UIImageSymbolWeightForFontWeight")]
80 #[cfg(all(feature = "UIFontDescriptor", feature = "objc2-core-foundation"))]
81 #[inline]
82 pub unsafe fn for_font_weight(font_weight: UIFontWeight) -> UIImageSymbolWeight {
83 extern "C-unwind" {
84 fn UIImageSymbolWeightForFontWeight(font_weight: UIFontWeight) -> UIImageSymbolWeight;
85 }
86 unsafe { UIImageSymbolWeightForFontWeight(font_weight) }
87 }
88}
89
90extern_class!(
91 #[unsafe(super(UIImageConfiguration, NSObject))]
93 #[derive(Debug, PartialEq, Eq, Hash)]
94 #[cfg(feature = "UIImageConfiguration")]
95 pub struct UIImageSymbolConfiguration;
96);
97
98#[cfg(feature = "UIImageConfiguration")]
99unsafe impl Send for UIImageSymbolConfiguration {}
100
101#[cfg(feature = "UIImageConfiguration")]
102unsafe impl Sync for UIImageSymbolConfiguration {}
103
104#[cfg(feature = "UIImageConfiguration")]
105extern_conformance!(
106 unsafe impl NSCoding for UIImageSymbolConfiguration {}
107);
108
109#[cfg(feature = "UIImageConfiguration")]
110extern_conformance!(
111 unsafe impl NSCopying for UIImageSymbolConfiguration {}
112);
113
114#[cfg(feature = "UIImageConfiguration")]
115unsafe impl CopyingHelper for UIImageSymbolConfiguration {
116 type Result = Self;
117}
118
119#[cfg(feature = "UIImageConfiguration")]
120extern_conformance!(
121 unsafe impl NSObjectProtocol for UIImageSymbolConfiguration {}
122);
123
124#[cfg(feature = "UIImageConfiguration")]
125extern_conformance!(
126 unsafe impl NSSecureCoding for UIImageSymbolConfiguration {}
127);
128
129#[cfg(feature = "UIImageConfiguration")]
130impl UIImageSymbolConfiguration {
131 extern_methods!(
132 #[unsafe(method(unspecifiedConfiguration))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn unspecifiedConfiguration() -> Retained<UIImageSymbolConfiguration>;
135
136 #[unsafe(method(configurationWithScale:))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn configurationWithScale(scale: UIImageSymbolScale) -> Retained<Self>;
139
140 #[cfg(feature = "objc2-core-foundation")]
141 #[unsafe(method(configurationWithPointSize:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn configurationWithPointSize(point_size: CGFloat) -> Retained<Self>;
144
145 #[unsafe(method(configurationWithWeight:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn configurationWithWeight(weight: UIImageSymbolWeight) -> Retained<Self>;
148
149 #[cfg(feature = "objc2-core-foundation")]
150 #[unsafe(method(configurationWithPointSize:weight:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn configurationWithPointSize_weight(
153 point_size: CGFloat,
154 weight: UIImageSymbolWeight,
155 ) -> Retained<Self>;
156
157 #[cfg(feature = "objc2-core-foundation")]
158 #[unsafe(method(configurationWithPointSize:weight:scale:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn configurationWithPointSize_weight_scale(
161 point_size: CGFloat,
162 weight: UIImageSymbolWeight,
163 scale: UIImageSymbolScale,
164 ) -> Retained<Self>;
165
166 #[cfg(feature = "UIFontDescriptor")]
167 #[unsafe(method(configurationWithTextStyle:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn configurationWithTextStyle(text_style: &UIFontTextStyle) -> Retained<Self>;
170
171 #[cfg(feature = "UIFontDescriptor")]
172 #[unsafe(method(configurationWithTextStyle:scale:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn configurationWithTextStyle_scale(
175 text_style: &UIFontTextStyle,
176 scale: UIImageSymbolScale,
177 ) -> Retained<Self>;
178
179 #[cfg(feature = "UIFont")]
180 #[unsafe(method(configurationWithFont:))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn configurationWithFont(font: &UIFont) -> Retained<Self>;
183
184 #[cfg(feature = "UIFont")]
185 #[unsafe(method(configurationWithFont:scale:))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn configurationWithFont_scale(
188 font: &UIFont,
189 scale: UIImageSymbolScale,
190 ) -> Retained<Self>;
191
192 #[cfg(feature = "UIColor")]
193 #[unsafe(method(configurationWithHierarchicalColor:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn configurationWithHierarchicalColor(
196 hierarchical_color: &UIColor,
197 ) -> Retained<Self>;
198
199 #[cfg(feature = "UIColor")]
200 #[unsafe(method(configurationWithPaletteColors:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn configurationWithPaletteColors(
203 palette_colors: &NSArray<UIColor>,
204 ) -> Retained<Self>;
205
206 #[unsafe(method(configurationPreferringMulticolor))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn configurationPreferringMulticolor() -> Retained<Self>;
209
210 #[unsafe(method(configurationPreferringMonochrome))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn configurationPreferringMonochrome() -> Retained<Self>;
213
214 #[unsafe(method(configurationWithoutTextStyle))]
215 #[unsafe(method_family = none)]
216 pub unsafe fn configurationWithoutTextStyle(&self) -> Retained<Self>;
217
218 #[unsafe(method(configurationWithoutScale))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn configurationWithoutScale(&self) -> Retained<Self>;
221
222 #[unsafe(method(configurationWithoutWeight))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn configurationWithoutWeight(&self) -> Retained<Self>;
225
226 #[unsafe(method(configurationWithoutPointSizeAndWeight))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn configurationWithoutPointSizeAndWeight(&self) -> Retained<Self>;
229
230 #[unsafe(method(isEqualToConfiguration:))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn isEqualToConfiguration(
233 &self,
234 other_configuration: Option<&UIImageSymbolConfiguration>,
235 ) -> bool;
236 );
237}
238
239#[cfg(feature = "UIImageConfiguration")]
241impl UIImageSymbolConfiguration {
242 extern_methods!(
243 #[unsafe(method(new))]
244 #[unsafe(method_family = new)]
245 pub unsafe fn new() -> Retained<Self>;
246
247 #[unsafe(method(init))]
248 #[unsafe(method_family = init)]
249 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
250
251 #[cfg(feature = "UITraitCollection")]
252 #[unsafe(method(configurationWithTraitCollection:))]
253 #[unsafe(method_family = none)]
254 pub unsafe fn configurationWithTraitCollection(
255 trait_collection: Option<&UITraitCollection>,
256 ) -> Retained<Self>;
257
258 #[unsafe(method(configurationWithLocale:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn configurationWithLocale(locale: Option<&NSLocale>) -> Retained<Self>;
261 );
262}
263
264extern "C-unwind" {
265 #[cfg(all(feature = "UIFontDescriptor", feature = "objc2-core-foundation"))]
266 #[deprecated = "renamed to `UIImageSymbolWeight::for_font_weight`"]
267 pub fn UIImageSymbolWeightForFontWeight(font_weight: UIFontWeight) -> UIImageSymbolWeight;
268}