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/uitabsidebaritem?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UITabSidebarItem;
);

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

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

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

impl UITabSidebarItem {
    extern_methods!(
        #[cfg(feature = "UITab")]
        /// The tab that the receiver represents. Only one of `tab` or `action` will be valid for an item.
        #[unsafe(method(tab))]
        #[unsafe(method_family = none)]
        pub fn tab(&self) -> Option<Retained<UITab>>;

        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
        /// The action that the receiver represents. Only one of `tab` or `action` will be valid for an item.
        #[unsafe(method(action))]
        #[unsafe(method_family = none)]
        pub fn action(&self) -> Option<Retained<UIAction>>;

        #[cfg(all(
            feature = "UICellConfigurationState",
            feature = "UIViewConfigurationState"
        ))]
        /// The current configuration state of the sidebar item.
        #[unsafe(method(configurationState))]
        #[unsafe(method_family = none)]
        pub fn configurationState(&self) -> Retained<UICellConfigurationState>;

        #[cfg(feature = "UIContentConfiguration")]
        /// The content configuration to use when displaying this item.
        #[unsafe(method(contentConfiguration))]
        #[unsafe(method_family = none)]
        pub fn contentConfiguration(&self) -> Retained<ProtocolObject<dyn UIContentConfiguration>>;

        #[cfg(feature = "UIContentConfiguration")]
        /// Setter for [`contentConfiguration`][Self::contentConfiguration].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setContentConfiguration:))]
        #[unsafe(method_family = none)]
        pub fn setContentConfiguration(
            &self,
            content_configuration: &ProtocolObject<dyn UIContentConfiguration>,
        );

        #[cfg(feature = "UIBackgroundConfiguration")]
        /// The background configuration to use when displaying this item.
        #[unsafe(method(backgroundConfiguration))]
        #[unsafe(method_family = none)]
        pub fn backgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;

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

        #[cfg(feature = "UICellAccessory")]
        /// Cell accessories to use when displaying this item. Some accessories may not be shown if it conflicts with system default accessories.
        #[unsafe(method(accessories))]
        #[unsafe(method_family = none)]
        pub fn accessories(&self) -> Retained<NSArray<UICellAccessory>>;

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

        #[cfg(feature = "UIListContentConfiguration")]
        /// Returns the default content configuration for this item and the configuration state.
        #[unsafe(method(defaultContentConfiguration))]
        #[unsafe(method_family = none)]
        pub fn defaultContentConfiguration(&self) -> Retained<UIListContentConfiguration>;

        #[cfg(feature = "UIBackgroundConfiguration")]
        /// Returns the default background configuration for this item and the configuration state.
        #[unsafe(method(defaultBackgroundConfiguration))]
        #[unsafe(method_family = none)]
        pub fn defaultBackgroundConfiguration(&self) -> Retained<UIBackgroundConfiguration>;

        /// Creates a sidebar item from the specified request. The sidebar item will be preconfigured with the appropriate defaults for its content.
        #[unsafe(method(itemFromRequest:))]
        #[unsafe(method_family = none)]
        pub fn itemFromRequest(request: &UITabSidebarItemRequest) -> 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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitabsidebaritemrequest?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UITabSidebarItemRequest;
);

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

impl UITabSidebarItemRequest {
    extern_methods!(
        #[cfg(feature = "UITab")]
        /// The tab that the receiver represents. Only one of `tab` or `action` will be valid for an item.
        #[unsafe(method(tab))]
        #[unsafe(method_family = none)]
        pub fn tab(&self) -> Option<Retained<UITab>>;

        #[cfg(all(feature = "UIAction", feature = "UIMenuElement"))]
        /// The action that the receiver represents. Only one of `tab` or `action` will be valid for an item.
        #[unsafe(method(action))]
        #[unsafe(method_family = none)]
        pub fn action(&self) -> Option<Retained<UIAction>>;

        #[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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}