objc2_tv_ml_kit/generated/
TVImageElement.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvimagetype?language=objc)
10// NS_ENUM
11#[deprecated = "Please use SwiftUI or UIKit"]
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct TVImageType(pub NSInteger);
15impl TVImageType {
16    #[doc(alias = "TVImageTypeImage")]
17    #[deprecated = "Please use SwiftUI or UIKit"]
18    pub const Image: Self = Self(0);
19    #[doc(alias = "TVImageTypeFullscreen")]
20    #[deprecated = "Please use SwiftUI or UIKit"]
21    pub const Fullscreen: Self = Self(1);
22    #[doc(alias = "TVImageTypeDecoration")]
23    #[deprecated = "Please use SwiftUI or UIKit"]
24    pub const Decoration: Self = Self(2);
25    #[doc(alias = "TVImageTypeHero")]
26    #[deprecated = "Please use SwiftUI or UIKit"]
27    pub const Hero: Self = Self(3);
28}
29
30unsafe impl Encode for TVImageType {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for TVImageType {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38extern_class!(
39    /// Convenience class representing
40    /// <img/>
41    /// element.
42    ///
43    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvimageelement?language=objc)
44    #[unsafe(super(TVViewElement, NSObject))]
45    #[derive(Debug, PartialEq, Eq, Hash)]
46    #[cfg(feature = "TVViewElement")]
47    #[deprecated = "Please use SwiftUI or UIKit"]
48    pub struct TVImageElement;
49);
50
51#[cfg(feature = "TVViewElement")]
52extern_conformance!(
53    unsafe impl NSCopying for TVImageElement {}
54);
55
56#[cfg(feature = "TVViewElement")]
57unsafe impl CopyingHelper for TVImageElement {
58    type Result = Self;
59}
60
61#[cfg(feature = "TVViewElement")]
62extern_conformance!(
63    unsafe impl NSObjectProtocol for TVImageElement {}
64);
65
66#[cfg(feature = "TVViewElement")]
67impl TVImageElement {
68    extern_methods!(
69        #[deprecated = "Please use SwiftUI or UIKit"]
70        #[unsafe(method(URL))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn URL(&self) -> Option<Retained<NSURL>>;
73
74        #[deprecated = "Please use SwiftUI or UIKit"]
75        #[unsafe(method(srcset))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn srcset(&self) -> Option<Retained<NSDictionary<NSString, NSURL>>>;
78
79        #[deprecated = "Please use SwiftUI or UIKit"]
80        #[unsafe(method(imageType))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn imageType(&self) -> TVImageType;
83    );
84}
85
86/// Methods declared on superclass `NSObject`.
87#[cfg(feature = "TVViewElement")]
88impl TVImageElement {
89    extern_methods!(
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94        #[unsafe(method(new))]
95        #[unsafe(method_family = new)]
96        pub unsafe fn new() -> Retained<Self>;
97    );
98}