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::*;
use objc2_foundation::*;

use crate::*;

/// Predefined text formatting view controller components.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentkey?language=objc)
// NS_TYPED_ENUM
pub type UITextFormattingViewControllerComponentKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerformattingstylescomponentkey?language=objc)
    pub static UITextFormattingViewControllerFormattingStylesComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontattributescomponentkey?language=objc)
    pub static UITextFormattingViewControllerFontAttributesComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontpickercomponentkey?language=objc)
    pub static UITextFormattingViewControllerFontPickerComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontsizecomponentkey?language=objc)
    pub static UITextFormattingViewControllerFontSizeComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerfontpointsizecomponentkey?language=objc)
    pub static UITextFormattingViewControllerFontPointSizeComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentcomponentkey?language=objc)
    pub static UITextFormattingViewControllerTextAlignmentComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextalignmentandjustificationcomponentkey?language=objc)
    pub static UITextFormattingViewControllerTextAlignmentAndJustificationComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextindentationcomponentkey?language=objc)
    pub static UITextFormattingViewControllerTextIndentationComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerlineheightcomponentkey?language=objc)
    pub static UITextFormattingViewControllerLineHeightComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerliststylescomponentkey?language=objc)
    pub static UITextFormattingViewControllerListStylesComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollertextcolorcomponentkey?language=objc)
    pub static UITextFormattingViewControllerTextColorComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightcomponentkey?language=objc)
    pub static UITextFormattingViewControllerHighlightComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerhighlightpickercomponentkey?language=objc)
    pub static UITextFormattingViewControllerHighlightPickerComponentKey:
        &'static UITextFormattingViewControllerComponentKey;
}

/// Sizes of text formatting view controller components.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentsize?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextFormattingViewControllerComponentSize(pub NSInteger);
impl UITextFormattingViewControllerComponentSize {
    #[doc(alias = "UITextFormattingViewControllerComponentSizeAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "UITextFormattingViewControllerComponentSizeMini")]
    pub const Mini: Self = Self(1);
    #[doc(alias = "UITextFormattingViewControllerComponentSizeSmall")]
    pub const Small: Self = Self(2);
    #[doc(alias = "UITextFormattingViewControllerComponentSizeRegular")]
    pub const Regular: Self = Self(3);
    #[doc(alias = "UITextFormattingViewControllerComponentSizeLarge")]
    pub const Large: Self = Self(4);
    #[doc(alias = "UITextFormattingViewControllerComponentSizeExtraLarge")]
    pub const ExtraLarge: Self = Self(5);
}

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

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

extern_class!(
    /// Defines text formatting view component.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponent?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UITextFormattingViewControllerComponent;
);

extern_conformance!(
    unsafe impl NSCoding for UITextFormattingViewControllerComponent {}
);

extern_conformance!(
    unsafe impl NSCopying for UITextFormattingViewControllerComponent {}
);

unsafe impl CopyingHelper for UITextFormattingViewControllerComponent {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for UITextFormattingViewControllerComponent {}
);

impl UITextFormattingViewControllerComponent {
    extern_methods!(
        /// Unique key that identifies text formatting view component.
        #[unsafe(method(componentKey))]
        #[unsafe(method_family = none)]
        pub fn componentKey(&self) -> Retained<UITextFormattingViewControllerComponentKey>;

        /// Specifies preferred size of the component in text formatting view.
        #[unsafe(method(preferredSize))]
        #[unsafe(method_family = none)]
        pub fn preferredSize(&self) -> UITextFormattingViewControllerComponentSize;

        /// Creates a text formatting view component configuration with component key and preferred size.
        ///
        /// - Parameters:
        /// - componentKey: Component key.
        /// - preferredSize: Preferred size of component in text formatting view.
        #[unsafe(method(initWithComponentKey:preferredSize:))]
        #[unsafe(method_family = init)]
        pub fn initWithComponentKey_preferredSize(
            this: Allocated<Self>,
            component_key: &UITextFormattingViewControllerComponentKey,
            preferred_size: UITextFormattingViewControllerComponentSize,
        ) -> Retained<Self>;

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

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Defines grouping of text formatting components in view.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollercomponentgroup?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UITextFormattingViewControllerComponentGroup;
);

extern_conformance!(
    unsafe impl NSCoding for UITextFormattingViewControllerComponentGroup {}
);

extern_conformance!(
    unsafe impl NSCopying for UITextFormattingViewControllerComponentGroup {}
);

unsafe impl CopyingHelper for UITextFormattingViewControllerComponentGroup {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for UITextFormattingViewControllerComponentGroup {}
);

impl UITextFormattingViewControllerComponentGroup {
    extern_methods!(
        /// Components in group.
        #[unsafe(method(components))]
        #[unsafe(method_family = none)]
        pub fn components(&self) -> Retained<NSArray<UITextFormattingViewControllerComponent>>;

        /// Creates a group of components.
        /// - Parameter components: Components to be included in the group.
        #[unsafe(method(initWithComponents:))]
        #[unsafe(method_family = init)]
        pub fn initWithComponents(
            this: Allocated<Self>,
            components: &NSArray<UITextFormattingViewControllerComponent>,
        ) -> Retained<Self>;

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

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}