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

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uifontpickerviewcontrollerdelegate?language=objc)
    pub unsafe trait UIFontPickerViewControllerDelegate:
        NSObjectProtocol + MainThreadOnly
    {
        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(fontPickerViewControllerDidCancel:))]
        #[unsafe(method_family = none)]
        fn fontPickerViewControllerDidCancel(&self, view_controller: &UIFontPickerViewController);

        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
        #[optional]
        #[unsafe(method(fontPickerViewControllerDidPickFont:))]
        #[unsafe(method_family = none)]
        fn fontPickerViewControllerDidPickFont(&self, view_controller: &UIFontPickerViewController);
    }
);

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

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

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

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

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
extern_conformance!(
    unsafe impl UIContentContainer for UIFontPickerViewController {}
);

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

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

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

#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIFontPickerViewController {
    extern_methods!(
        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
        #[unsafe(method(initWithConfiguration:))]
        #[unsafe(method_family = init)]
        pub fn initWithConfiguration(
            this: Allocated<Self>,
            configuration: &UIFontPickerViewControllerConfiguration,
        ) -> Retained<Self>;

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

        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIFontPickerViewControllerDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn UIFontPickerViewControllerDelegate>>,
        );

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

        #[cfg(feature = "UIFontDescriptor")]
        /// Setter for [`selectedFontDescriptor`][Self::selectedFontDescriptor].
        #[unsafe(method(setSelectedFontDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn setSelectedFontDescriptor(
            &self,
            selected_font_descriptor: Option<&UIFontDescriptor>,
        );

        #[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>;
    );
}

/// Methods declared on superclass `UIViewController`.
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIFontPickerViewController {
    extern_methods!(
        /// # 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>>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
impl UIFontPickerViewController {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

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