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" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentErrorDomain: &'static NSErrorDomain;
}
#[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);
}
#[deprecated = "Please use SwiftUI or UIKit"]
pub type TVDocumentEvent = NSString;
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventPlay: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventSelect: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventHoldSelect: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventHighlight: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventLoad: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventUnload: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventAppear: &'static TVDocumentEvent;
}
extern "C" {
#[deprecated = "Please use SwiftUI or UIKit"]
pub static TVDocumentEventDisappear: &'static TVDocumentEvent;
}
extern_protocol!(
#[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")]
#[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!(
#[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>>>;
#[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")]
#[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>;
#[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>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-ui-kit")]
impl TVDocumentViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}