use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVElementEventType(pub NSInteger);
impl TVElementEventType {
#[doc(alias = "TVElementEventTypePlay")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Play: Self = Self(1);
#[doc(alias = "TVElementEventTypeSelect")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Select: Self = Self(2);
#[doc(alias = "TVElementEventTypeHoldSelect")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const HoldSelect: Self = Self(3);
#[doc(alias = "TVElementEventTypeHighlight")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Highlight: Self = Self(4);
#[doc(alias = "TVElementEventTypeChange")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Change: Self = Self(5);
}
unsafe impl Encode for TVElementEventType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVElementEventType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVElementUpdateType(pub NSInteger);
impl TVElementUpdateType {
#[doc(alias = "TVElementUpdateTypeNone")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const None: Self = Self(0);
#[doc(alias = "TVElementUpdateTypeSubtree")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Subtree: Self = Self(1);
#[doc(alias = "TVElementUpdateTypeStyles")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Styles: Self = Self(2);
#[doc(alias = "TVElementUpdateTypeChildren")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Children: Self = Self(3);
#[doc(alias = "TVElementUpdateTypeSelf")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const Node: Self = Self(4);
}
unsafe impl Encode for TVElementUpdateType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVElementUpdateType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated = "Please use SwiftUI or UIKit"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TVElementResettableProperty(pub NSInteger);
impl TVElementResettableProperty {
#[doc(alias = "TVElementResettablePropertyUpdateType")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const UpdateType: Self = Self(0);
#[doc(alias = "TVElementResettablePropertyAutoHighlightIdentifier")]
#[deprecated = "Please use SwiftUI or UIKit"]
pub const AutoHighlightIdentifier: Self = Self(1);
}
unsafe impl Encode for TVElementResettableProperty {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for TVElementResettableProperty {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Please use SwiftUI or UIKit"]
pub struct TVViewElement;
);
extern_conformance!(
unsafe impl NSCopying for TVViewElement {}
);
unsafe impl CopyingHelper for TVViewElement {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for TVViewElement {}
);
impl TVViewElement {
extern_methods!(
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(elementIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn elementIdentifier(&self) -> Retained<NSString>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(elementName))]
#[unsafe(method_family = none)]
pub unsafe fn elementName(&self) -> Retained<NSString>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(parentViewElement))]
#[unsafe(method_family = none)]
pub unsafe fn parentViewElement(&self) -> Option<Retained<TVViewElement>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(childViewElements))]
#[unsafe(method_family = none)]
pub unsafe fn childViewElements(&self) -> Option<Retained<NSArray<TVViewElement>>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(attributes))]
#[unsafe(method_family = none)]
pub unsafe fn attributes(&self) -> Option<Retained<NSDictionary<NSString, NSString>>>;
#[cfg(feature = "TVViewElementStyle")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub unsafe fn style(&self) -> Option<Retained<TVViewElementStyle>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(autoHighlightIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn autoHighlightIdentifier(&self) -> Option<Retained<NSString>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(isDisabled))]
#[unsafe(method_family = none)]
pub unsafe fn isDisabled(&self) -> bool;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(setDisabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setDisabled(&self, disabled: bool);
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(updateType))]
#[unsafe(method_family = none)]
pub unsafe fn updateType(&self) -> TVElementUpdateType;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(elementData))]
#[unsafe(method_family = none)]
pub unsafe fn elementData(&self) -> Retained<NSDictionary<NSString, AnyObject>>;
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(resetProperty:))]
#[unsafe(method_family = none)]
pub unsafe fn resetProperty(&self, resettable_property: TVElementResettableProperty);
#[cfg(feature = "block2")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(dispatchEventOfType:canBubble:cancellable:extraInfo:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn dispatchEventOfType_canBubble_cancellable_extraInfo_completion(
&self,
r#type: TVElementEventType,
can_bubble: bool,
is_cancellable: bool,
extra_info: Option<&NSDictionary<NSString, AnyObject>>,
completion: Option<&block2::DynBlock<dyn Fn(Bool, Bool)>>,
);
#[cfg(feature = "block2")]
#[deprecated = "Please use SwiftUI or UIKit"]
#[unsafe(method(dispatchEventWithName:canBubble:cancellable:extraInfo:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn dispatchEventWithName_canBubble_cancellable_extraInfo_completion(
&self,
event_name: &NSString,
can_bubble: bool,
is_cancellable: bool,
extra_info: Option<&NSDictionary<NSString, AnyObject>>,
completion: Option<&block2::DynBlock<dyn Fn(Bool, Bool)>>,
);
);
}
impl TVViewElement {
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>;
);
}