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_protocol!(
#[deprecated = "Please use SwiftUI or UIKit"]
pub unsafe trait TVInterfaceCreating: NSObjectProtocol {
#[cfg(all(feature = "TVViewElement", feature = "objc2-ui-kit"))]
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(viewForElement:existingView:))]
#[unsafe(method_family = none)]
unsafe fn viewForElement_existingView(
&self,
element: &TVViewElement,
existing_view: Option<&UIView>,
mtm: MainThreadMarker,
) -> Option<Retained<UIView>>;
#[cfg(all(feature = "TVViewElement", feature = "objc2-ui-kit"))]
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(viewControllerForElement:existingViewController:))]
#[unsafe(method_family = none)]
unsafe fn viewControllerForElement_existingViewController(
&self,
element: &TVViewElement,
existing_view_controller: Option<&UIViewController>,
mtm: MainThreadMarker,
) -> Option<Retained<UIViewController>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(URLForResource:))]
#[unsafe(method_family = none)]
unsafe fn URLForResource(&self, resource_name: &NSString) -> Option<Retained<NSURL>>;
#[cfg(feature = "objc2-ui-kit")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(imageForResource:))]
#[unsafe(method_family = none)]
unsafe fn imageForResource(&self, resource_name: &NSString) -> Option<Retained<UIImage>>;
#[cfg(feature = "TVViewElement")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(collectionViewCellClassForElement:))]
#[unsafe(method_family = none)]
unsafe fn collectionViewCellClassForElement(
&self,
element: &TVViewElement,
) -> Option<&'static AnyClass>;
#[cfg(all(feature = "TVPlayback", feature = "objc2-ui-kit"))]
#[deprecated = "Please use SwiftUI or UIKit"]
#[optional]
#[unsafe(method(playerViewControllerForPlayer:))]
#[unsafe(method_family = none)]
unsafe fn playerViewControllerForPlayer(
&self,
player: &TVPlayer,
mtm: MainThreadMarker,
) -> Option<Retained<UIViewController>>;
}
);
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVInterfaceFactory;
);
extern_conformance!(
unsafe impl NSObjectProtocol for TVInterfaceFactory {}
);
extern_conformance!(
unsafe impl TVInterfaceCreating for TVInterfaceFactory {}
);
impl TVInterfaceFactory {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(sharedInterfaceFactory))]
#[unsafe(method_family = none)]
pub unsafe fn sharedInterfaceFactory() -> Retained<Self>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(extendedInterfaceCreator))]
#[unsafe(method_family = none)]
pub unsafe fn extendedInterfaceCreator(
&self,
) -> Option<Retained<ProtocolObject<dyn TVInterfaceCreating>>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(setExtendedInterfaceCreator:))]
#[unsafe(method_family = none)]
pub unsafe fn setExtendedInterfaceCreator(
&self,
extended_interface_creator: Option<&ProtocolObject<dyn TVInterfaceCreating>>,
);
);
}
impl TVInterfaceFactory {
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() -> Retained<Self>;
);
}