use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait UITextFormattingViewControllerDelegate:
NSObjectProtocol + MainThreadOnly
{
#[cfg(all(
feature = "UIResponder",
feature = "UITextFormattingViewControllerChangeValue",
feature = "UIViewController"
))]
#[unsafe(method(textFormattingViewController:didChangeValue:))]
#[unsafe(method_family = none)]
fn textFormattingViewController_didChangeValue(
&self,
view_controller: &UITextFormattingViewController,
change_value: &UITextFormattingViewControllerChangeValue,
);
#[cfg(all(
feature = "UIFontPickerViewController",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(textFormattingViewController:shouldPresentFontPicker:))]
#[unsafe(method_family = none)]
fn textFormattingViewController_shouldPresentFontPicker(
&self,
view_controller: &UITextFormattingViewController,
font_picker: &UIFontPickerViewController,
) -> bool;
#[cfg(all(
feature = "UIColorPickerViewController",
feature = "UIResponder",
feature = "UIViewController"
))]
#[optional]
#[unsafe(method(textFormattingViewController:shouldPresentColorPicker:))]
#[unsafe(method_family = none)]
fn textFormattingViewController_shouldPresentColorPicker(
&self,
view_controller: &UITextFormattingViewController,
color_picker: &UIColorPickerViewController,
) -> bool;
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
#[optional]
#[unsafe(method(textFormattingDidFinish:))]
#[unsafe(method_family = none)]
fn textFormattingDidFinish(&self, view_controller: &UITextFormattingViewController);
}
);
extern_class!(
#[unsafe(super(UIViewController, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
pub struct UITextFormattingViewController;
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSCoding for UITextFormattingViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UITextFormattingViewController {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UITextFormattingViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIContentContainer for UITextFormattingViewController {}
);
#[cfg(all(
feature = "UIFocus",
feature = "UIResponder",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UITextFormattingViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UITextFormattingViewController {}
);
#[cfg(all(
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIViewController"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UITextFormattingViewController {}
);
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITextFormattingViewController {
extern_methods!(
#[cfg(feature = "UITextFormattingViewControllerConfiguration")]
#[unsafe(method(configuration))]
#[unsafe(method_family = none)]
pub fn configuration(&self) -> Retained<UITextFormattingViewControllerConfiguration>;
#[cfg(feature = "UITextFormattingViewControllerFormattingDescriptor")]
#[unsafe(method(formattingDescriptor))]
#[unsafe(method_family = none)]
pub fn formattingDescriptor(
&self,
) -> Option<Retained<UITextFormattingViewControllerFormattingDescriptor>>;
#[cfg(feature = "UITextFormattingViewControllerFormattingDescriptor")]
#[unsafe(method(setFormattingDescriptor:))]
#[unsafe(method_family = none)]
pub fn setFormattingDescriptor(
&self,
formatting_descriptor: Option<&UITextFormattingViewControllerFormattingDescriptor>,
);
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UITextFormattingViewControllerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn UITextFormattingViewControllerDelegate>>,
);
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSString>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[cfg(feature = "UITextFormattingViewControllerConfiguration")]
#[unsafe(method(initWithConfiguration:))]
#[unsafe(method_family = init)]
pub fn initWithConfiguration(
this: Allocated<Self>,
configuration: &UITextFormattingViewControllerConfiguration,
) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITextFormattingViewController {
extern_methods!(
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UITextFormattingViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}