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::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenterrordomain?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentErrorDomain: &'static NSErrorDomain;
}

/// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenterror?language=objc)
// NS_ERROR_ENUM
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVDocumentError(pub NSInteger);
impl TVDocumentError {
    #[doc(alias = "TVDocumentErrorFailed")]
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub const Failed: Self = Self(0);
    #[doc(alias = "TVDocumentErrorCancelled")]
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub const Cancelled: Self = Self(1);
}

unsafe impl Encode for TVDocumentError {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for TVDocumentError {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumentevent?language=objc)
#[deprecated = "Please use SwiftUI or UIKit"]
// NS_TYPED_EXTENSIBLE_ENUM
pub type TVDocumentEvent = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventplay?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventPlay: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventselect?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventSelect: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventholdselect?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventHoldSelect: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventhighlight?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventHighlight: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventload?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventLoad: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventunload?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventUnload: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventappear?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventAppear: &'static TVDocumentEvent;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumenteventdisappear?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub static TVDocumentEventDisappear: &'static TVDocumentEvent;
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvdocumentviewcontrollerdelegate?language=objc)
    #[deprecated = "Please use SwiftUI or UIKit"]
    pub unsafe trait TVDocumentViewControllerDelegate: NSObjectProtocol {
        #[cfg(feature = "objc2-ui-kit")]
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[optional]
        #[unsafe(method(documentViewControllerWillUpdate:))]
        #[unsafe(method_family = none)]
        unsafe fn documentViewControllerWillUpdate(
            &self,
            document_view_controller: &TVDocumentViewController,
        );

        #[cfg(feature = "objc2-ui-kit")]
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[optional]
        #[unsafe(method(documentViewControllerDidUpdate:))]
        #[unsafe(method_family = none)]
        unsafe fn documentViewControllerDidUpdate(
            &self,
            document_view_controller: &TVDocumentViewController,
        );

        #[cfg(feature = "objc2-ui-kit")]
        /// # Safety
        ///
        /// `context` generic should be of the correct type.
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[optional]
        #[unsafe(method(documentViewController:didUpdateWithContext:))]
        #[unsafe(method_family = none)]
        unsafe fn documentViewController_didUpdateWithContext(
            &self,
            document_view_controller: &TVDocumentViewController,
            context: &NSDictionary<NSString, AnyObject>,
        );

        #[cfg(feature = "objc2-ui-kit")]
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[optional]
        #[unsafe(method(documentViewController:didFailUpdateWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn documentViewController_didFailUpdateWithError(
            &self,
            document_view_controller: &TVDocumentViewController,
            error: &NSError,
        );

        #[cfg(all(feature = "TVViewElement", feature = "objc2-ui-kit"))]
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[optional]
        #[unsafe(method(documentViewController:handleEvent:withElement:))]
        #[unsafe(method_family = none)]
        unsafe fn documentViewController_handleEvent_withElement(
            &self,
            document_view_controller: &TVDocumentViewController,
            event: &TVDocumentEvent,
            element: &TVViewElement,
        ) -> bool;
    }
);

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

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

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

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

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

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

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

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

#[cfg(feature = "objc2-ui-kit")]
impl TVDocumentViewController {
    extern_methods!(
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[unsafe(method(documentContext))]
        #[unsafe(method_family = none)]
        pub unsafe fn documentContext(&self) -> Retained<NSDictionary<NSString, AnyObject>>;

        #[cfg(feature = "TVApplicationController")]
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[unsafe(method(appController))]
        #[unsafe(method_family = none)]
        pub unsafe fn appController(&self) -> Option<Retained<TVApplicationController>>;

        #[deprecated = "Please use SwiftUI or UIKit"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn TVDocumentViewControllerDelegate>>>;

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

        #[cfg(feature = "TVApplicationController")]
        /// # Safety
        ///
        /// `context` generic should be of the correct type.
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[unsafe(method(viewControllerWithContext:forAppController:))]
        #[unsafe(method_family = none)]
        pub unsafe fn viewControllerWithContext_forAppController(
            context: &NSDictionary<NSString, AnyObject>,
            app_controller: &TVApplicationController,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `context` generic should be of the correct type.
        #[deprecated = "Please use SwiftUI or UIKit"]
        #[unsafe(method(updateUsingContext:))]
        #[unsafe(method_family = none)]
        pub unsafe fn updateUsingContext(&self, context: &NSDictionary<NSString, AnyObject>);

        #[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 TVDocumentViewController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}