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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Text formatting view controller configuration object.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextformattingviewcontrollerconfiguration?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UITextFormattingViewControllerConfiguration;
);

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

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

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

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

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

impl UITextFormattingViewControllerConfiguration {
    extern_methods!(
        #[cfg(feature = "UITextFormattingViewControllerComponent")]
        /// Component groups displayed by text formatting view.
        #[unsafe(method(groups))]
        #[unsafe(method_family = none)]
        pub fn groups(&self) -> Retained<NSArray<UITextFormattingViewControllerComponentGroup>>;

        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
        /// Configurations of formatting styles available in text formatting view.
        #[unsafe(method(formattingStyles))]
        #[unsafe(method_family = none)]
        pub fn formattingStyles(
            &self,
        ) -> Option<Retained<NSArray<UITextFormattingViewControllerFormattingStyle>>>;

        #[cfg(feature = "UITextFormattingViewControllerFormattingStyle")]
        /// Setter for [`formattingStyles`][Self::formattingStyles].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFormattingStyles:))]
        #[unsafe(method_family = none)]
        pub fn setFormattingStyles(
            &self,
            formatting_styles: Option<&NSArray<UITextFormattingViewControllerFormattingStyle>>,
        );

        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
        /// Configuration object that will be used to customize `UIFontPickerViewController` if presented by `UITextFormattingViewController`.
        #[unsafe(method(fontPickerConfiguration))]
        #[unsafe(method_family = none)]
        pub fn fontPickerConfiguration(
            &self,
            mtm: MainThreadMarker,
        ) -> Option<Retained<UIFontPickerViewControllerConfiguration>>;

        #[cfg(feature = "UIFontPickerViewControllerConfiguration")]
        /// Setter for [`fontPickerConfiguration`][Self::fontPickerConfiguration].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFontPickerConfiguration:))]
        #[unsafe(method_family = none)]
        pub fn setFontPickerConfiguration(
            &self,
            font_picker_configuration: Option<&UIFontPickerViewControllerConfiguration>,
        );

        /// Creates a default configuration with most common text formatting options.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "UITextFormattingViewControllerComponent")]
        /// Creates a configuration object with provided component groups.
        /// - Parameter groups: Component groups displayed in text formatting view.
        #[unsafe(method(initWithGroups:))]
        #[unsafe(method_family = init)]
        pub fn initWithGroups(
            this: Allocated<Self>,
            groups: &NSArray<UITextFormattingViewControllerComponentGroup>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl UITextFormattingViewControllerConfiguration {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for UITextFormattingViewControllerConfiguration {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}