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::*;
#[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!(
#[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>>;
#[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")]
#[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")]
#[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;
#[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")]
#[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")]
#[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")]
#[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")]
#[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>>;
#[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")]
#[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;
#[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;
#[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;
#[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;
#[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;
#[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")]
#[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")]
#[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;
#[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")]
#[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")]
#[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;
#[unsafe(method(setEnablesMarqueeWhenAncestorFocused:))]
#[unsafe(method_family = none)]
pub fn setEnablesMarqueeWhenAncestorFocused(
&self,
enables_marquee_when_ancestor_focused: bool,
);
#[unsafe(method(showsExpansionTextWhenTruncated))]
#[unsafe(method_family = none)]
pub fn showsExpansionTextWhenTruncated(&self) -> bool;
#[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")]
#[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;
#[deprecated]
#[unsafe(method(setAdjustsLetterSpacingToFitWidth:))]
#[unsafe(method_family = none)]
pub fn setAdjustsLetterSpacingToFitWidth(&self, adjusts_letter_spacing_to_fit_width: bool);
);
}
#[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>;
#[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>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UILabel {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}