objc2_ui_kit/generated/
UIFontMetrics.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct UIFontMetrics;
15);
16
17unsafe impl Send for UIFontMetrics {}
18
19unsafe impl Sync for UIFontMetrics {}
20
21unsafe impl NSObjectProtocol for UIFontMetrics {}
22
23impl UIFontMetrics {
24 extern_methods!(
25 #[unsafe(method(defaultMetrics))]
26 #[unsafe(method_family = none)]
27 pub unsafe fn defaultMetrics() -> Retained<UIFontMetrics>;
28
29 #[cfg(feature = "UIFontDescriptor")]
30 #[unsafe(method(metricsForTextStyle:))]
31 #[unsafe(method_family = none)]
32 pub unsafe fn metricsForTextStyle(text_style: &UIFontTextStyle) -> Retained<Self>;
33
34 #[unsafe(method(init))]
35 #[unsafe(method_family = init)]
36 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
37
38 #[cfg(feature = "UIFontDescriptor")]
39 #[unsafe(method(initForTextStyle:))]
40 #[unsafe(method_family = init)]
41 pub unsafe fn initForTextStyle(
42 this: Allocated<Self>,
43 text_style: &UIFontTextStyle,
44 ) -> Retained<Self>;
45
46 #[cfg(feature = "UIFont")]
47 #[unsafe(method(scaledFontForFont:))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn scaledFontForFont(&self, font: &UIFont) -> Retained<UIFont>;
50
51 #[cfg(all(feature = "UIFont", feature = "objc2-core-foundation"))]
52 #[unsafe(method(scaledFontForFont:maximumPointSize:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn scaledFontForFont_maximumPointSize(
55 &self,
56 font: &UIFont,
57 maximum_point_size: CGFloat,
58 ) -> Retained<UIFont>;
59
60 #[cfg(all(feature = "UIFont", feature = "UITraitCollection"))]
61 #[unsafe(method(scaledFontForFont:compatibleWithTraitCollection:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn scaledFontForFont_compatibleWithTraitCollection(
64 &self,
65 font: &UIFont,
66 trait_collection: Option<&UITraitCollection>,
67 ) -> Retained<UIFont>;
68
69 #[cfg(all(
70 feature = "UIFont",
71 feature = "UITraitCollection",
72 feature = "objc2-core-foundation"
73 ))]
74 #[unsafe(method(scaledFontForFont:maximumPointSize:compatibleWithTraitCollection:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn scaledFontForFont_maximumPointSize_compatibleWithTraitCollection(
77 &self,
78 font: &UIFont,
79 maximum_point_size: CGFloat,
80 trait_collection: Option<&UITraitCollection>,
81 ) -> Retained<UIFont>;
82
83 #[cfg(feature = "objc2-core-foundation")]
84 #[unsafe(method(scaledValueForValue:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn scaledValueForValue(&self, value: CGFloat) -> CGFloat;
87
88 #[cfg(all(feature = "UITraitCollection", feature = "objc2-core-foundation"))]
89 #[unsafe(method(scaledValueForValue:compatibleWithTraitCollection:))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn scaledValueForValue_compatibleWithTraitCollection(
92 &self,
93 value: CGFloat,
94 trait_collection: Option<&UITraitCollection>,
95 ) -> CGFloat;
96 );
97}
98
99impl UIFontMetrics {
101 extern_methods!(
102 #[unsafe(method(new))]
103 #[unsafe(method_family = new)]
104 pub unsafe fn new() -> Retained<Self>;
105 );
106}