objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uifontmetrics?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIFontMetrics;
);

unsafe impl Send for UIFontMetrics {}

unsafe impl Sync for UIFontMetrics {}

extern_conformance!(
    unsafe impl NSObjectProtocol for UIFontMetrics {}
);

impl UIFontMetrics {
    extern_methods!(
        #[unsafe(method(defaultMetrics))]
        #[unsafe(method_family = none)]
        pub fn defaultMetrics() -> Retained<UIFontMetrics>;

        #[cfg(feature = "UIFontDescriptor")]
        #[unsafe(method(metricsForTextStyle:))]
        #[unsafe(method_family = none)]
        pub fn metricsForTextStyle(text_style: &UIFontTextStyle) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "UIFontDescriptor")]
        #[unsafe(method(initForTextStyle:))]
        #[unsafe(method_family = init)]
        pub fn initForTextStyle(
            this: Allocated<Self>,
            text_style: &UIFontTextStyle,
        ) -> Retained<Self>;

        #[cfg(feature = "UIFont")]
        #[unsafe(method(scaledFontForFont:))]
        #[unsafe(method_family = none)]
        pub fn scaledFontForFont(&self, font: &UIFont) -> Retained<UIFont>;

        #[cfg(all(feature = "UIFont", feature = "objc2-core-foundation"))]
        #[unsafe(method(scaledFontForFont:maximumPointSize:))]
        #[unsafe(method_family = none)]
        pub fn scaledFontForFont_maximumPointSize(
            &self,
            font: &UIFont,
            maximum_point_size: CGFloat,
        ) -> Retained<UIFont>;

        #[cfg(all(feature = "UIFont", feature = "UITraitCollection"))]
        #[unsafe(method(scaledFontForFont:compatibleWithTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn scaledFontForFont_compatibleWithTraitCollection(
            &self,
            font: &UIFont,
            trait_collection: Option<&UITraitCollection>,
        ) -> Retained<UIFont>;

        #[cfg(all(
            feature = "UIFont",
            feature = "UITraitCollection",
            feature = "objc2-core-foundation"
        ))]
        #[unsafe(method(scaledFontForFont:maximumPointSize:compatibleWithTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn scaledFontForFont_maximumPointSize_compatibleWithTraitCollection(
            &self,
            font: &UIFont,
            maximum_point_size: CGFloat,
            trait_collection: Option<&UITraitCollection>,
        ) -> Retained<UIFont>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(scaledValueForValue:))]
        #[unsafe(method_family = none)]
        pub fn scaledValueForValue(&self, value: CGFloat) -> CGFloat;

        #[cfg(all(feature = "UITraitCollection", feature = "objc2-core-foundation"))]
        #[unsafe(method(scaledValueForValue:compatibleWithTraitCollection:))]
        #[unsafe(method_family = none)]
        pub fn scaledValueForValue_compatibleWithTraitCollection(
            &self,
            value: CGFloat,
            trait_collection: Option<&UITraitCollection>,
        ) -> CGFloat;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIFontMetrics {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}