use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type UITextFormattingViewControllerComponentKey = NSString;
extern "C" {
pub static UITextFormattingViewControllerFormattingStylesComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerFontAttributesComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerFontPickerComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerFontSizeComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerFontPointSizeComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerTextAlignmentComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerTextAlignmentAndJustificationComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerTextIndentationComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerLineHeightComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerListStylesComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerTextColorComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerHighlightComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
extern "C" {
pub static UITextFormattingViewControllerHighlightPickerComponentKey:
&'static UITextFormattingViewControllerComponentKey;
}
#[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!(
#[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!(
#[unsafe(method(componentKey))]
#[unsafe(method_family = none)]
pub fn componentKey(&self) -> Retained<UITextFormattingViewControllerComponentKey>;
#[unsafe(method(preferredSize))]
#[unsafe(method_family = none)]
pub fn preferredSize(&self) -> UITextFormattingViewControllerComponentSize;
#[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!(
#[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!(
#[unsafe(method(components))]
#[unsafe(method_family = none)]
pub fn components(&self) -> Retained<NSArray<UITextFormattingViewControllerComponent>>;
#[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>;
);
}