//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilabelvibrancy?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UILabelVibrancy(pub NSInteger);
impl UILabelVibrancy {
    #[doc(alias = "UILabelVibrancyNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "UILabelVibrancyAutomatic")]
    pub const Automatic: Self = Self(1);
}

unsafe impl Encode for UILabelVibrancy {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UILabelVibrancy {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilabel?language=objc)
    #[unsafe(super(UIView, UIResponder, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    pub struct UILabel;
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CALayerDelegate for UILabel {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSCoding for UILabel {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UILabel {}
);

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIAppearance for UILabel {}
);

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UILabel {}
);

#[cfg(all(
    feature = "UIContentSizeCategoryAdjusting",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIContentSizeCategoryAdjusting for UILabel {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UICoordinateSpace for UILabel {}
);

#[cfg(all(
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIDynamicItem for UILabel {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UILabel {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItem for UILabel {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItemContainer for UILabel {}
);

#[cfg(all(
    feature = "UILetterformAwareAdjusting",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UILetterformAwareAdjusting for UILabel {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UILabel {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UILabel {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UILabel {
    extern_methods!(
        #[unsafe(method(text))]
        #[unsafe(method_family = none)]
        pub fn text(&self) -> Option<Retained<NSString>>;

        /// Setter for [`text`][Self::text].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setText:))]
        #[unsafe(method_family = none)]
        pub fn setText(&self, text: Option<&NSString>);

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

        #[cfg(feature = "UIFont")]
        /// Setter for [`font`][Self::font].
        ///
        /// # Safety
        ///
        /// `font` might not allow `None`.
        #[unsafe(method(setFont:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setFont(&self, font: Option<&UIFont>);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(textColor))]
        #[unsafe(method_family = none)]
        pub fn textColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`textColor`][Self::textColor].
        ///
        /// # Safety
        ///
        /// `text_color` might not allow `None`.
        #[unsafe(method(setTextColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTextColor(&self, text_color: Option<&UIColor>);

        #[unsafe(method(preferredVibrancy))]
        #[unsafe(method_family = none)]
        pub fn preferredVibrancy(&self) -> UILabelVibrancy;

        /// Setter for [`preferredVibrancy`][Self::preferredVibrancy].
        #[unsafe(method(setPreferredVibrancy:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredVibrancy(&self, preferred_vibrancy: UILabelVibrancy);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(shadowColor))]
        #[unsafe(method_family = none)]
        pub fn shadowColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`shadowColor`][Self::shadowColor].
        #[unsafe(method(setShadowColor:))]
        #[unsafe(method_family = none)]
        pub fn setShadowColor(&self, shadow_color: Option<&UIColor>);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(shadowOffset))]
        #[unsafe(method_family = none)]
        pub fn shadowOffset(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`shadowOffset`][Self::shadowOffset].
        #[unsafe(method(setShadowOffset:))]
        #[unsafe(method_family = none)]
        pub fn setShadowOffset(&self, shadow_offset: CGSize);

        #[cfg(feature = "NSText")]
        #[unsafe(method(textAlignment))]
        #[unsafe(method_family = none)]
        pub fn textAlignment(&self) -> NSTextAlignment;

        #[cfg(feature = "NSText")]
        /// Setter for [`textAlignment`][Self::textAlignment].
        #[unsafe(method(setTextAlignment:))]
        #[unsafe(method_family = none)]
        pub fn setTextAlignment(&self, text_alignment: NSTextAlignment);

        #[cfg(feature = "NSParagraphStyle")]
        #[unsafe(method(lineBreakMode))]
        #[unsafe(method_family = none)]
        pub fn lineBreakMode(&self) -> NSLineBreakMode;

        #[cfg(feature = "NSParagraphStyle")]
        /// Setter for [`lineBreakMode`][Self::lineBreakMode].
        #[unsafe(method(setLineBreakMode:))]
        #[unsafe(method_family = none)]
        pub fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);

        #[unsafe(method(attributedText))]
        #[unsafe(method_family = none)]
        pub fn attributedText(&self) -> Option<Retained<NSAttributedString>>;

        /// Setter for [`attributedText`][Self::attributedText].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedText:))]
        #[unsafe(method_family = none)]
        pub fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);

        #[cfg(feature = "UIColor")]
        #[unsafe(method(highlightedTextColor))]
        #[unsafe(method_family = none)]
        pub fn highlightedTextColor(&self) -> Option<Retained<UIColor>>;

        #[cfg(feature = "UIColor")]
        /// Setter for [`highlightedTextColor`][Self::highlightedTextColor].
        #[unsafe(method(setHighlightedTextColor:))]
        #[unsafe(method_family = none)]
        pub fn setHighlightedTextColor(&self, highlighted_text_color: Option<&UIColor>);

        #[unsafe(method(isHighlighted))]
        #[unsafe(method_family = none)]
        pub fn isHighlighted(&self) -> bool;

        /// Setter for [`isHighlighted`][Self::isHighlighted].
        #[unsafe(method(setHighlighted:))]
        #[unsafe(method_family = none)]
        pub fn setHighlighted(&self, highlighted: bool);

        #[unsafe(method(isUserInteractionEnabled))]
        #[unsafe(method_family = none)]
        pub fn isUserInteractionEnabled(&self) -> bool;

        /// Setter for [`isUserInteractionEnabled`][Self::isUserInteractionEnabled].
        #[unsafe(method(setUserInteractionEnabled:))]
        #[unsafe(method_family = none)]
        pub fn setUserInteractionEnabled(&self, user_interaction_enabled: bool);

        #[unsafe(method(isEnabled))]
        #[unsafe(method_family = none)]
        pub fn isEnabled(&self) -> bool;

        /// Setter for [`isEnabled`][Self::isEnabled].
        #[unsafe(method(setEnabled:))]
        #[unsafe(method_family = none)]
        pub fn setEnabled(&self, enabled: bool);

        #[unsafe(method(numberOfLines))]
        #[unsafe(method_family = none)]
        pub fn numberOfLines(&self) -> NSInteger;

        /// Setter for [`numberOfLines`][Self::numberOfLines].
        #[unsafe(method(setNumberOfLines:))]
        #[unsafe(method_family = none)]
        pub fn setNumberOfLines(&self, number_of_lines: NSInteger);

        #[unsafe(method(adjustsFontSizeToFitWidth))]
        #[unsafe(method_family = none)]
        pub fn adjustsFontSizeToFitWidth(&self) -> bool;

        /// Setter for [`adjustsFontSizeToFitWidth`][Self::adjustsFontSizeToFitWidth].
        #[unsafe(method(setAdjustsFontSizeToFitWidth:))]
        #[unsafe(method_family = none)]
        pub fn setAdjustsFontSizeToFitWidth(&self, adjusts_font_size_to_fit_width: bool);

        #[cfg(feature = "UIStringDrawing")]
        #[unsafe(method(baselineAdjustment))]
        #[unsafe(method_family = none)]
        pub fn baselineAdjustment(&self) -> UIBaselineAdjustment;

        #[cfg(feature = "UIStringDrawing")]
        /// Setter for [`baselineAdjustment`][Self::baselineAdjustment].
        #[unsafe(method(setBaselineAdjustment:))]
        #[unsafe(method_family = none)]
        pub fn setBaselineAdjustment(&self, baseline_adjustment: UIBaselineAdjustment);

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

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumScaleFactor`][Self::minimumScaleFactor].
        #[unsafe(method(setMinimumScaleFactor:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumScaleFactor(&self, minimum_scale_factor: CGFloat);

        #[unsafe(method(allowsDefaultTighteningForTruncation))]
        #[unsafe(method_family = none)]
        pub fn allowsDefaultTighteningForTruncation(&self) -> bool;

        /// Setter for [`allowsDefaultTighteningForTruncation`][Self::allowsDefaultTighteningForTruncation].
        #[unsafe(method(setAllowsDefaultTighteningForTruncation:))]
        #[unsafe(method_family = none)]
        pub fn setAllowsDefaultTighteningForTruncation(
            &self,
            allows_default_tightening_for_truncation: bool,
        );

        #[cfg(feature = "NSParagraphStyle")]
        #[unsafe(method(lineBreakStrategy))]
        #[unsafe(method_family = none)]
        pub fn lineBreakStrategy(&self) -> NSLineBreakStrategy;

        #[cfg(feature = "NSParagraphStyle")]
        /// Setter for [`lineBreakStrategy`][Self::lineBreakStrategy].
        #[unsafe(method(setLineBreakStrategy:))]
        #[unsafe(method_family = none)]
        pub fn setLineBreakStrategy(&self, line_break_strategy: NSLineBreakStrategy);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(textRectForBounds:limitedToNumberOfLines:))]
        #[unsafe(method_family = none)]
        pub fn textRectForBounds_limitedToNumberOfLines(
            &self,
            bounds: CGRect,
            number_of_lines: NSInteger,
        ) -> CGRect;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(drawTextInRect:))]
        #[unsafe(method_family = none)]
        pub fn drawTextInRect(&self, rect: CGRect);

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

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredMaxLayoutWidth`][Self::preferredMaxLayoutWidth].
        #[unsafe(method(setPreferredMaxLayoutWidth:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredMaxLayoutWidth(&self, preferred_max_layout_width: CGFloat);

        #[unsafe(method(enablesMarqueeWhenAncestorFocused))]
        #[unsafe(method_family = none)]
        pub fn enablesMarqueeWhenAncestorFocused(&self) -> bool;

        /// Setter for [`enablesMarqueeWhenAncestorFocused`][Self::enablesMarqueeWhenAncestorFocused].
        #[unsafe(method(setEnablesMarqueeWhenAncestorFocused:))]
        #[unsafe(method_family = none)]
        pub fn setEnablesMarqueeWhenAncestorFocused(
            &self,
            enables_marquee_when_ancestor_focused: bool,
        );

        /// Indicates whether expansion text will be shown when the view is too small to show all the contents. Defaults to NO.
        #[unsafe(method(showsExpansionTextWhenTruncated))]
        #[unsafe(method_family = none)]
        pub fn showsExpansionTextWhenTruncated(&self) -> bool;

        /// Setter for [`showsExpansionTextWhenTruncated`][Self::showsExpansionTextWhenTruncated].
        #[unsafe(method(setShowsExpansionTextWhenTruncated:))]
        #[unsafe(method_family = none)]
        pub fn setShowsExpansionTextWhenTruncated(&self, shows_expansion_text_when_truncated: bool);

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

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumFontSize`][Self::minimumFontSize].
        #[deprecated]
        #[unsafe(method(setMinimumFontSize:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumFontSize(&self, minimum_font_size: CGFloat);

        #[deprecated]
        #[unsafe(method(adjustsLetterSpacingToFitWidth))]
        #[unsafe(method_family = none)]
        pub fn adjustsLetterSpacingToFitWidth(&self) -> bool;

        /// Setter for [`adjustsLetterSpacingToFitWidth`][Self::adjustsLetterSpacingToFitWidth].
        #[deprecated]
        #[unsafe(method(setAdjustsLetterSpacingToFitWidth:))]
        #[unsafe(method_family = none)]
        pub fn setAdjustsLetterSpacingToFitWidth(&self, adjusts_letter_spacing_to_fit_width: bool);
    );
}

/// Methods declared on superclass `UIView`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UILabel {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

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

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UILabel {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
