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
21extern_conformance!(
22 unsafe impl NSObjectProtocol for UIFontMetrics {}
23);
24
25impl UIFontMetrics {
26 extern_methods!(
27 #[unsafe(method(defaultMetrics))]
28 #[unsafe(method_family = none)]
29 pub fn defaultMetrics() -> Retained<UIFontMetrics>;
30
31 #[cfg(feature = "UIFontDescriptor")]
32 #[unsafe(method(metricsForTextStyle:))]
33 #[unsafe(method_family = none)]
34 pub fn metricsForTextStyle(text_style: &UIFontTextStyle) -> Retained<Self>;
35
36 #[unsafe(method(init))]
37 #[unsafe(method_family = init)]
38 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
39
40 #[cfg(feature = "UIFontDescriptor")]
41 #[unsafe(method(initForTextStyle:))]
42 #[unsafe(method_family = init)]
43 pub fn initForTextStyle(
44 this: Allocated<Self>,
45 text_style: &UIFontTextStyle,
46 ) -> Retained<Self>;
47
48 #[cfg(feature = "UIFont")]
49 #[unsafe(method(scaledFontForFont:))]
50 #[unsafe(method_family = none)]
51 pub fn scaledFontForFont(&self, font: &UIFont) -> Retained<UIFont>;
52
53 #[cfg(all(feature = "UIFont", feature = "objc2-core-foundation"))]
54 #[unsafe(method(scaledFontForFont:maximumPointSize:))]
55 #[unsafe(method_family = none)]
56 pub fn scaledFontForFont_maximumPointSize(
57 &self,
58 font: &UIFont,
59 maximum_point_size: CGFloat,
60 ) -> Retained<UIFont>;
61
62 #[cfg(all(feature = "UIFont", feature = "UITraitCollection"))]
63 #[unsafe(method(scaledFontForFont:compatibleWithTraitCollection:))]
64 #[unsafe(method_family = none)]
65 pub fn scaledFontForFont_compatibleWithTraitCollection(
66 &self,
67 font: &UIFont,
68 trait_collection: Option<&UITraitCollection>,
69 ) -> Retained<UIFont>;
70
71 #[cfg(all(
72 feature = "UIFont",
73 feature = "UITraitCollection",
74 feature = "objc2-core-foundation"
75 ))]
76 #[unsafe(method(scaledFontForFont:maximumPointSize:compatibleWithTraitCollection:))]
77 #[unsafe(method_family = none)]
78 pub fn scaledFontForFont_maximumPointSize_compatibleWithTraitCollection(
79 &self,
80 font: &UIFont,
81 maximum_point_size: CGFloat,
82 trait_collection: Option<&UITraitCollection>,
83 ) -> Retained<UIFont>;
84
85 #[cfg(feature = "objc2-core-foundation")]
86 #[unsafe(method(scaledValueForValue:))]
87 #[unsafe(method_family = none)]
88 pub fn scaledValueForValue(&self, value: CGFloat) -> CGFloat;
89
90 #[cfg(all(feature = "UITraitCollection", feature = "objc2-core-foundation"))]
91 #[unsafe(method(scaledValueForValue:compatibleWithTraitCollection:))]
92 #[unsafe(method_family = none)]
93 pub fn scaledValueForValue_compatibleWithTraitCollection(
94 &self,
95 value: CGFloat,
96 trait_collection: Option<&UITraitCollection>,
97 ) -> CGFloat;
98 );
99}
100
101impl UIFontMetrics {
103 extern_methods!(
104 #[unsafe(method(new))]
105 #[unsafe(method_family = new)]
106 pub unsafe fn new() -> Retained<Self>;
107 );
108}