objc2-tv-ml-kit 0.3.2

Bindings to the TVMLKit 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

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

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

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UIViewControllerAnimatedTransitioning for TVBrowserTransitionAnimator {}
);

impl TVBrowserTransitionAnimator {
    extern_methods!();
}

/// Methods declared on superclass `NSObject`.
impl TVBrowserTransitionAnimator {
    extern_methods!(
        #[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_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvbrowserviewcontrollerdatasource?language=objc)
    pub unsafe trait TVBrowserViewControllerDataSource: NSObjectProtocol {
        #[cfg(all(
            feature = "TVDocumentViewController",
            feature = "TVViewElement",
            feature = "objc2-ui-kit"
        ))]
        #[unsafe(method(browserViewController:documentViewControllerForElement:))]
        #[unsafe(method_family = none)]
        unsafe fn browserViewController_documentViewControllerForElement(
            &self,
            browser_view_controller: &TVBrowserViewController,
            view_element: &TVViewElement,
        ) -> Option<Retained<TVDocumentViewController>>;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvbrowserviewcontrollerdelegate?language=objc)
    pub unsafe trait TVBrowserViewControllerDelegate: NSObjectProtocol {
        #[cfg(all(feature = "TVViewElement", feature = "objc2-ui-kit"))]
        #[optional]
        #[unsafe(method(browserViewController:willCenterOnViewElement:))]
        #[unsafe(method_family = none)]
        unsafe fn browserViewController_willCenterOnViewElement(
            &self,
            browser_view_controller: &TVBrowserViewController,
            view_element: &TVViewElement,
        );

        #[cfg(all(feature = "TVViewElement", feature = "objc2-ui-kit"))]
        #[optional]
        #[unsafe(method(browserViewController:didCenterOnViewElement:))]
        #[unsafe(method_family = none)]
        unsafe fn browserViewController_didCenterOnViewElement(
            &self,
            browser_view_controller: &TVBrowserViewController,
            view_element: &TVViewElement,
        );
    }
);

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvbrowserviewcontroller?language=objc)
    #[unsafe(super(UIViewController, UIResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-ui-kit")]
    pub struct TVBrowserViewController;
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl NSCoding for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl NSObjectProtocol for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UIAppearanceContainer for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UIContentContainer for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UIFocusEnvironment for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
extern_conformance!(
    unsafe impl UITraitEnvironment for TVBrowserViewController {}
);

#[cfg(feature = "objc2-ui-kit")]
impl TVBrowserViewController {
    extern_methods!(
        #[cfg(feature = "TVViewElement")]
        #[unsafe(method(viewElement))]
        #[unsafe(method_family = none)]
        pub unsafe fn viewElement(&self) -> Retained<TVViewElement>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(cornerRadius))]
        #[unsafe(method_family = none)]
        pub unsafe fn cornerRadius(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`cornerRadius`][Self::cornerRadius].
        #[unsafe(method(setCornerRadius:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(interitemSpacing))]
        #[unsafe(method_family = none)]
        pub unsafe fn interitemSpacing(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`interitemSpacing`][Self::interitemSpacing].
        #[unsafe(method(setInteritemSpacing:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInteritemSpacing(&self, interitem_spacing: CGFloat);

        #[unsafe(method(maskInset))]
        #[unsafe(method_family = none)]
        pub unsafe fn maskInset(&self) -> UIEdgeInsets;

        /// Setter for [`maskInset`][Self::maskInset].
        #[unsafe(method(setMaskInset:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMaskInset(&self, mask_inset: UIEdgeInsets);

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

        #[cfg(feature = "TVViewElement")]
        /// Setter for [`centeredViewElement`][Self::centeredViewElement].
        #[unsafe(method(setCenteredViewElement:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCenteredViewElement(&self, centered_view_element: &TVViewElement);

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

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

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

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

        #[cfg(feature = "TVViewElement")]
        #[unsafe(method(viewControllerForElement:))]
        #[unsafe(method_family = none)]
        pub unsafe fn viewControllerForElement(
            view_element: &TVViewElement,
            mtm: MainThreadMarker,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe 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>;

        /// # 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 = "objc2-ui-kit")]
impl TVBrowserViewController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}