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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitoolbarappearance?language=objc)
    #[unsafe(super(UIBarAppearance, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "UIBarAppearance")]
    pub struct UIToolbarAppearance;
);

#[cfg(feature = "UIBarAppearance")]
extern_conformance!(
    unsafe impl NSCoding for UIToolbarAppearance {}
);

#[cfg(feature = "UIBarAppearance")]
extern_conformance!(
    unsafe impl NSCopying for UIToolbarAppearance {}
);

#[cfg(feature = "UIBarAppearance")]
unsafe impl CopyingHelper for UIToolbarAppearance {
    type Result = Self;
}

#[cfg(feature = "UIBarAppearance")]
extern_conformance!(
    unsafe impl NSObjectProtocol for UIToolbarAppearance {}
);

#[cfg(feature = "UIBarAppearance")]
extern_conformance!(
    unsafe impl NSSecureCoding for UIToolbarAppearance {}
);

#[cfg(feature = "UIBarAppearance")]
impl UIToolbarAppearance {
    extern_methods!(
        #[cfg(feature = "UIBarButtonItemAppearance")]
        /// The appearance for plain-style bar button items
        #[unsafe(method(buttonAppearance))]
        #[unsafe(method_family = none)]
        pub fn buttonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;

        #[cfg(feature = "UIBarButtonItemAppearance")]
        /// Setter for [`buttonAppearance`][Self::buttonAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setButtonAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setButtonAppearance(&self, button_appearance: &UIBarButtonItemAppearance);

        #[cfg(feature = "UIBarButtonItemAppearance")]
        /// The appearance attributes for Prominent buttons.
        ///
        /// Use this property to configure the appearance of bar button items that use `UIBarButtonItemStyleProminent`.
        /// If the navigation bar doesn't have any buttons using this style, this property has no effect.
        #[unsafe(method(prominentButtonAppearance))]
        #[unsafe(method_family = none)]
        pub fn prominentButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;

        #[cfg(feature = "UIBarButtonItemAppearance")]
        /// Setter for [`prominentButtonAppearance`][Self::prominentButtonAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setProminentButtonAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setProminentButtonAppearance(
            &self,
            prominent_button_appearance: &UIBarButtonItemAppearance,
        );

        #[cfg(feature = "UIBarButtonItemAppearance")]
        /// The appearance for done-style bar button items
        #[deprecated]
        #[unsafe(method(doneButtonAppearance))]
        #[unsafe(method_family = none)]
        pub fn doneButtonAppearance(&self) -> Retained<UIBarButtonItemAppearance>;

        #[cfg(feature = "UIBarButtonItemAppearance")]
        /// Setter for [`doneButtonAppearance`][Self::doneButtonAppearance].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[deprecated]
        #[unsafe(method(setDoneButtonAppearance:))]
        #[unsafe(method_family = none)]
        pub fn setDoneButtonAppearance(&self, done_button_appearance: &UIBarButtonItemAppearance);
    );
}

/// Methods declared on superclass `UIBarAppearance`.
#[cfg(feature = "UIBarAppearance")]
impl UIToolbarAppearance {
    extern_methods!(
        /// Constructs a new bar appearance, configured with default values and targeting the device idiom.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "UIDevice")]
        /// Constructs a new bar appearance, targeting the passed-in idiom as a hint. Not all platforms support all available idioms. See the idiom property to determine the resolved idiom.
        #[unsafe(method(initWithIdiom:))]
        #[unsafe(method_family = init)]
        pub fn initWithIdiom(this: Allocated<Self>, idiom: UIUserInterfaceIdiom) -> Retained<Self>;

        /// Constructs a new bar appearance, copying all relevant properties from the given appearance object. This initializer is useful for migrating configuration between UIBarAppearance subclasses. For example, you can initialize a UINavigationBarAppearance with a UIToolbarAppearance instance, and shared attributes will be identical between the two.
        #[unsafe(method(initWithBarAppearance:))]
        #[unsafe(method_family = init)]
        pub fn initWithBarAppearance(
            this: Allocated<Self>,
            bar_appearance: &UIBarAppearance,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "UIBarAppearance")]
impl UIToolbarAppearance {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}